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 2002/08/25 00:07:21 UTC
DO NOT REPLY [Bug 12015] -
[PATCH] RunTarget, the fast alternative to CallTarget (antcall)
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12015>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12015
[PATCH] RunTarget, the fast alternative to CallTarget (antcall)
nicolaken@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[PATCH] RunTarget |[PATCH] RunTarget, the fast
| |alternative to CallTarget
| |(antcall)
------- Additional Comments From nicolaken@apache.org 2002-08-24 22:07 -------
Oops, sorry, I pressed <enter> before filling out the form.
Anyway... this is a task that calls a target without creating a new Project as
CallTarget (antcall).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Beware though that it's *not* reentrant, thus acting as a *direct* call to the
target without further dependency resolution and without any property
scope.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Example snippet that shows the speed difference (I used it in the embed
proposal test.xml file):
<target name="test-runvscall" depends="test-run, test-call"/>
<target name="test-run">
<taskdef classname="org.apache.tools.ant.taskdefs.RunTarget"
name="antrun" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
<antrun target="main" />
</target>
<target name="test-call">
<taskdef classname="org.apache.tools.ant.taskdefs.RunTarget"
name="antrun" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
<antcall target="main" />
</target>
The need?
I ask the user what task it should run using an input task, and then I should
just run it, without scoping whatsoever.
In this regard RunTarget is much better:
<input message="Please select a target "
addproperty="input.selection"/>
<antrun target="${input.selection}"/>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>