You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by yitzle <yi...@users.sourceforge.net> on 2007/05/30 21:15:54 UTC

Running another target - can it be done?

I know. This is not something that you would usually want to do. But
I'm sure there is at least 3 valid cases where this would be correct.

1:	<target name="num1" >
2:		...
3:	</target>
4:
5:	<target name="num2">
6:		...
7:**		<RUN NUM1>		**
8:	</target>
9:
10:	<target name="num3" depends="num2,num1" />

I want to basically replace line 10 with something at line 7. Does it exist?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Running another target - can it be done?

Posted by Doug Lochart <dl...@capecomputing.com>.
yitzle wrote:
> That looks like what I want. Thanks!
>
> When you are self taught multiple tools, frameworks, etc on the job
> its hard to look through all the components, especially something like
> Ant, where, as long as it works, I'm pretty happy. I did look at the
> list of tasks, but some of the names are not self-explanatory.
>
I feel your pain.  I am routinely goven tasks in which I have to learn 
something (most recently how to build, install, configure, implement an 
LDAP) server and I have 3-4 days to do it.  That is what these lists are 
for.  Luckily I am a developer (well I used to be and will be again) and 
have been able to spend a lot of time with ant.  It is so popular (and 
so good!) there is a wealth of help around.

keep on keepin on!
> Anyhow, sorry for the rant and thanks again!
>
> On 5/31/07, Qazwart <qa...@gmail.com> wrote:
>> Have you looked at <ant> and <antcall>?
>>
>> These allow you to call another target from inside of another target:
>>
>> <target name="num2">
>>      ...
>>      <antcall target="num1"/>
>> </target>
>>
>> David Weintraub
>> david@weintraub.name
>> qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Running another target - can it be done?

Posted by Peter Reilly <pe...@gmail.com>.
<antcall> creates a new ant child context (project), this means
than any properties, references set in that project will not
appear in the caller project. Sometimes this is needed and
sometimes not.

Alternatives are to:
  - set dependenices up so that this antcall is not required
  - use macrodefs instead of a target
  - use ant-contrib's <runtarget> which runs a target without creating
    a new project.
Peter


On 5/31/07, yitzle <yi...@users.sourceforge.net> wrote:
> That looks like what I want. Thanks!
>
> When you are self taught multiple tools, frameworks, etc on the job
> its hard to look through all the components, especially something like
> Ant, where, as long as it works, I'm pretty happy. I did look at the
> list of tasks, but some of the names are not self-explanatory.
>
> Anyhow, sorry for the rant and thanks again!
>
> On 5/31/07, Qazwart <qa...@gmail.com> wrote:
> > Have you looked at <ant> and <antcall>?
> >
> > These allow you to call another target from inside of another target:
> >
> > <target name="num2">
> >      ...
> >      <antcall target="num1"/>
> > </target>
> >
> > David Weintraub
> > david@weintraub.name
> > qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Running another target - can it be done?

Posted by yitzle <yi...@users.sourceforge.net>.
That looks like what I want. Thanks!

When you are self taught multiple tools, frameworks, etc on the job
its hard to look through all the components, especially something like
Ant, where, as long as it works, I'm pretty happy. I did look at the
list of tasks, but some of the names are not self-explanatory.

Anyhow, sorry for the rant and thanks again!

On 5/31/07, Qazwart <qa...@gmail.com> wrote:
> Have you looked at <ant> and <antcall>?
>
> These allow you to call another target from inside of another target:
>
> <target name="num2">
>      ...
>      <antcall target="num1"/>
> </target>
>
> David Weintraub
> david@weintraub.name
> qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Running another target - can it be done?

Posted by Qazwart <qa...@gmail.com>.
Have you looked at <ant> and <antcall>?

These allow you to call another target from inside of another target:

<target name="num2">
     ...
     <antcall target="num1"/>
</target>


On May 30, 2007, at 3:15 PM, yitzle wrote:

> I know. This is not something that you would usually want to do. But
> I'm sure there is at least 3 valid cases where this would be correct.
>
> 1:	<target name="num1" >
> 2:		...
> 3:	</target>
> 4:
> 5:	<target name="num2">
> 6:		...
> 7:**		<RUN NUM1>		**
> 8:	</target>
> 9:
> 10:	<target name="num3" depends="num2,num1" />
>
> I want to basically replace line 10 with something at line 7. Does  
> it exist?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

David Weintraub
david@weintraub.name
qazwart@gmail.com



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org