dos - How to run multiple commands from ant exec task -


i want run 2 dos commands ant exec task.

i have tried below code

<exec dir="${testworkspace}\${modulename}" executable="cmd" failonerror="true" output="${testworkspace}\${modulename}\buildconsole_tc${tc_num}.log" resultproperty="execrc">                     <arg value="/c echo download status ${downloadstatus}"/>                     <arg value="/c load.bat ${modulename} ${intapp} ${ccvstatus}"/>                 </exec> 

but executes first command , skips second. trying on windows os.

why need run 2 commands in single <exec> task? instead, use second <exec> task. can include both in single target:

 <target name="execute.this">      <exec dir="${testworkspace}\${modulename}"           executable="cmd" failonerror="true"           output="${testworkspace}/${modulename}/buildconsole_tc${tc_num}.log"           resultproperty="execrc">          <arg value="/c echo download status ${downloadstatus}"/>       <exec dir="${testworkspace}\${modulename}"           executable="cmd" failonerror="true"           output="${testworkspace}/${modulename}/buildconsole_tc${tc_num}.log"           resultproperty="execrc">          <arg value="/c load.bat ${modulename} ${intapp} ${ccvstatus}"/>      </exec> 

or better yet, use <echo> task:

     <echo message="/c echo download status ${downloadstatus}"/>      <exec dir="${testworkspace}\${modulename}"           executable="cmd"           failonerror="true"           output="${testworkspace}/${modulename}/buildconsole_tc${tc_num}.log"           resultproperty="execrc">          <arg value="/c load.bat ${modulename} ${intapp} ${ccvstatus}"/>      </exec> 

if need output of echo task in same file, can use file parameter in echo command, , append parameter in exec task.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -