ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12015] - [PATCH] RunTarget, the fast alternative to CallTarget (antcall)
Date Sat, 24 Aug 2002 22:07:21 GMT
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:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message