How to use the user define ant script to create save file in AS400 build?
Hi,
When use user define ant script in RTCi build, the pre/post command can not work. Support suggests use the ant script to execute command.
Any one can tell me or give the instruction how to use ant script to executes the System i command like create the save file.
I also confuse that why the user define ant script overwrite the pre/post command, maybe I will submit enhancement for it.
Thanks!
Accepted answer
The pre/post commands from an IBM i Build Specification build definition are put into the generated ant script, so if you use your own ant script the pre/post commands are never run.
You can add in your own IBM i Commands to run through an Ant script as follows, by replacing COMMAND with the command you want to run:
<target name="default">
<ibmicommand commandString="COMMAND" systemref="SystemInstance"/>
</target>
You will also need the following in your Ant script:
<typedef name="AS400Type" classname="com.ibm.iant.types.AS400Type"/>
<taskdef name="ibmicommand" classname="com.ibm.iant.taskdefs.build.IBMICommandTask"/>
<AS400Type systemname="" userid="" userpassword="" id="SystemInstance"/>
You can add in your own IBM i Commands to run through an Ant script as follows, by replacing COMMAND with the command you want to run:
<target name="default">
<ibmicommand commandString="COMMAND" systemref="SystemInstance"/>
</target>
You will also need the following in your Ant script:
<typedef name="AS400Type" classname="com.ibm.iant.types.AS400Type"/>
<taskdef name="ibmicommand" classname="com.ibm.iant.taskdefs.build.IBMICommandTask"/>
<AS400Type systemname="" userid="" userpassword="" id="SystemInstance"/>