For my site antlib, I am currently using a task <onceonly>
which may be usefull to have as a std ant task (or ant-contrib task).
The idea is that the task will only be run once, even if
called multiple times (via ant, antcall, subant - indirectly
via import).
For example:
<project default="caller">
<onceonly>
<echo>Initializing Project</echo>
<!-- some complicated list of initializing tasks -->
</onceonly>
<target name="caller">
<echo>In call</echo>
<antcall target="callee"/>
</target>
<target name="callee">
<echo>In callee</echo>
</target>
<project>
Peter
|