ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: do task if condition is value
Date Wed, 17 Jul 2002 09:44:26 GMT
On Wed, 17 Jul 2002, Tibor Strausz <> wrote:

> My problem now is that i want to print the output of the command
> line (which is in a log file) to the screen (prompt) only when there
> is a failer, when 'resultproperty' is 1.  Is there a way to do
> this?? Or should i make a task which looks like:
> <writeLog src="out.log" condition="${resultproperty}" equals="1"/>

You'd run target "run" - replace the <exec> with whatever is
appropriate for you:

<target name="exec-task">
  <exec ... resultproperty="retcode" />
  <condition propery="exec.failed">
    <equals arg1="${retcode}" arg2="1" />

<target name="run" depends="exec-task" if="exec.failed">
    <filelist dir="." files="out.log" />


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message