Bug 58914 - Enhance target with a new runOnce="true/[false]" attribute
Summary: Enhance target with a new runOnce="true/[false]" attribute
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.9.6
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-22 18:02 UTC by Robert Flaherty
Modified: 2016-01-22 18:02 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Flaherty 2016-01-22 18:02:44 UTC
Multiple calls to a target will be reduced when called via the "depends" tree resolution, but if a target is called with antcall/runtarget, a target will be rerun.  By creating a property and checking for it with "unless" I worked around this, but having an internal method to control it might be useful.

<project name="test" default="task2">
	<target name="init" unless="stop">
		<echo message="init" />
		<property name="stop" value="now" />
	</target>
	
	<target name="task1" depends="init">
		<echo message="task1" />
	</target>
	
	<target name="task2" depends="init">
		<echo message="task2" />
		<antcall target="task1" />
	</target>
</project>

This bug may be looking for similar functionality, but may also involve an actual bug.

https://bz.apache.org/bugzilla/show_bug.cgi?id=58886