<target name="CheckState">
<exec executable="${App.path}"/>
</target>
In this task, the executable will return a value which will indicate the state of my app. How could I get the value returned in the Ant build file. I will use this value to determine some behaviour.
Use the
resultproperty
andfailonerror
attributes of theexec
task, e.g.:Quoting from the
exec
task docs Errors and return codes:Here is a generic way to check the result and display the output of the execution only if the process returns a failure code.