Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to execute a subtask conditionally if used several times

How to execute a subtask conditionally if used several times

2005-06-15       - By Dr. Michael Lipp
Reply:     1     2     3     4  

Hi,

I have a target that produces an output file based on an input file. I
invoke this target several times using antcall with different pairs of
input and output files (using <antcall><param ...>).

As an optimization, I want to do the generation only if the input file
is newer than the output file. In order to do this, I have to set a
property with <uptodate>. Of course, I would like to do this in my
antcall-ed target to avoid duplication of code.

But how can I reset the property once it has been set in my
"sub-target"? Once a property is set, it cannot be changed. So if the
first antcall causes e.g. "isUpToDate" to be set, all subsequent
antcalls will be executed as well.

Any solution?

Regards,

   Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.