Avatar of vvsrk76
vvsrk76

asked on 

How do I grab the error msgs or any output in the <exec> task using Ant script?

In my Ant build script I am executing third party tool.
I want to show the error msgs from the  executable netchangestaging.exe if we get any errors
<target name="tp-netchange" depends="kill-tp-users">
    <if>
      <available file="${tp.netchangestaging.exe}" />
      <then>
        <tstamp>
          <format property="tp.start.time" pattern="yyyy/MM/dd @ HH:mm:ss" />
        </tstamp>
        <echo message="Talking Pictures NetChange started ${tp.start.time}" /> 
        <exec executable="${tp.netchangestaging.exe}" failonerror="true">
          <arg line="ALL" />
          <arg line="-DELETETALKPIC" />
        </exec>
        <tstamp>
           <format property="tp.finish.time" pattern="yyyy/MM/dd @ HH:mm:ss" />
        </tstamp>
        <echo message="Talking Pictures NetChange finished ${tp.finish.time}" /> 
      </then>
      <else>
        <echo message="Talking Pictures export tool not found: ${tp.netchangestaging.exe}" />
      </else>
    </if>
  </target>

Open in new window

Editors IDEs

Avatar of undefined
Last Comment
rsneale

8/22/2022 - Mon