It's all about the answers!

Ask a question

How to use the user define ant script to create save file in AS400 build?


Jia Jia Li (8057152192) | asked Jul 23 '13, 10:38 p.m.
edited Jul 25 '13, 11:34 a.m. by Kevin Doyle (60425)
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


permanent link
Kevin Doyle (60425) | answered Jul 25 '13, 1:06 p.m.
JAZZ DEVELOPER
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"/>
Jia Jia Li selected this answer as the correct answer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.