You can use a wrapper script for that:
I�ve attached two files:
ant2.bat - the wrapper script which stores the targets in an ant property and calls ant
build.xml - test buildfile
After invoking
>ant2 target1 target2 target3 target1
I got
target1:
[echo] Target 1
[echo] Targetnames = target1::target2::target3::target1
target2:
[echo] Target 2
[echo] Targetnames = target1::target2::target3::target1
target3:
[echo] Target 3
[echo] Targetnames = target1::target2::target3::target1
target1:
[echo] Target 1
[echo] Targetnames = target1::target2::target3::target1
BUILD SUCCESSFUL
Total time: 1 second
Jan Mat�rne
-----Urspr�ngliche Nachricht-----
Von: Erik Hatcher [mailto:[EMAIL PROTECTED]]
Gesendet am: Mittwoch, 5. Februar 2003 06:48
An: Ant Users List
Betreff: Re: Can you get name of target to be run?
No. And this has been a hotly debated topic, in fact.
Keep in mind that Ant can be run this way also:
ant target1 target2 target3
That probably doesn't factor into why its a debatable topic, but does
add some food for thought on it.
You could do something like this though:
ant -Dtarget=target1
And in the default target do an <antcall> to ${target}
Erik
On Tuesday, February 4, 2003, at 06:07 PM, David Clements wrote:
> Can you get the name of the target that is going to be run upon entry
> into the build file? I want to set a
> property based on what target is going to be run.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
