Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Help with running different target based on user input?

Help with running different target based on user input?

2007-02-23       - By RADEMAKERS Tanguy
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

do you think you'll ever want to run script 3 *without* running script
4? 'Coz if you do, antcall is not the way to go - just make the script 4
target depend on the script 3 target. That way, if you want to run just
script 3, you just call "ant script3", otherwise you call "ant script4",
which will run script 3 as well... that's more the "ant way" to do
things. Same logic applies for running script 1 and script 2 - if they
always need to run then put them both in the same target (call it dbinit
or setup or whatever) and then make script 3 dependent on that. Then you
can:

"ant dbinit" -> runs script 1 and script 2
"ant script3" -> runs script 1 and script 2 and script 3
"ant script4" -> runs script 1 and script 2 and script 3 and script 4

/t

>-----Original Message-----
>From: Priest, James (NIH/NIEHS) [C] [mailto:PriestJ@(protected)]
>Sent: Friday, February 23, 2007 4:15 PM
>To: Ant Users List
>Subject: RE: Help with running different target based on user input?
>
>> -----Original Message-----
>> From: RADEMAKERS Tanguy [mailto:Tanguy.RADEMAKERS@(protected)]
>
>> Ant is not a scripting language... assuming that "run script
>> four" is a target in your build file, you could call it from
>> within another target using the <antcall> task. You should
>> also look into the AntContrib third party tasks, since they
>> have an "if" task.
>>
>> Maybe if you gave us some more info on what you're trying to achieve?
>
>Basically I have a series of sql scripts that I want to run...
>
>Script1 and Script2 need to always run.
>
>Script2 and Script3 are optional but there are some table
>dependencies -
>so for example if I don't run Script3, I can't run Script 4 without
>throwing an error.
>
>I added an AntCall within Script3 to call Script4 and it seems to
>work!!!
>
>Thanks again for the pointers!
>
>Jim
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@(protected)
>For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.