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:[EMAIL 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:[EMAIL 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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to