You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/08/04 08:58:31 UTC
DO NOT REPLY [Bug 30457] New: -
static targets
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30457>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30457
static targets
Summary: static targets
Product: Ant
Version: 1.1
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Core
AssignedTo: dev@ant.apache.org
ReportedBy: Nagendra.Raja@sun.com
Would it be a nice to have feature to make some of the targets run only once
(irrespective of how times this target gets called).
e.g
<target name="init" static="true">
<property name="abc" value = "xyz"/>
</target>
<target name="compile" depends="init">
..
</target>
<target name="package" depends="init">
..
</target>
<target name="clean" depends="init">
..
</target>
With this build.xml defination if one calls ant with targest clean, compile,
package then init gets called three times (ant clean, compile, package).
By adding new attribute like static at target level we could make the ant
runtime call init only once.
There is a workaround to this by setting a unique property in the said init
target and using unless attribute .. But I belive that this not the better
readable solution.
i.e
<target name="init" unless="initRanOnce">
..
<property name="initRanOnce" value="true"/>
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org