ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mani G. Iyer" <i...@rcn.com>
Subject RE: command line args to ANT
Date Wed, 26 May 2004 01:08:40 GMT
Rob:
You don't even have to define a target.  Simply put the property task
under the project as:
<property name="classToRun" value="defaultClass" />

If the classToRun property is not defined via the -D option then it will
be set to the default value.  This is a way of setting default values
for properties.
HTH
mani

-----Original Message-----
From: Anderson, Rob (Global Trade) [mailto:Rob.Anderson@nike.com] 
Sent: Tuesday, May 25, 2004 7:20 PM
To: Ant Users List
Subject: RE: command line args to ANT

You would need to run ant with -D option like this...

ant -DclassToRun=blah

Then in your build.xml create a target like this one...

<target name="setclass" unless="classToRun">
	<property name="classToRun" value="defaultClass"/>
<target/>

Then use the depends attribute on another target to run this target
first.

-Rob Anderson

> -----Original Message-----
> From: ah49@drexel.edu [mailto:ah49@drexel.edu]
> Sent: Tuesday, May 25, 2004 3:35 PM
> To: Ant Users List
> Subject: command line args to ANT
> 
> 
> hey i would like to supply on the command line an arg for the 
> ANT script
> -classToRun=blah
> 
> and in my script, if its supplied on command line then 
> $classToRun= that value , but if its not supplied then 
> $classToRun=defaultClass
> 
> how can this be done with if/elses for <property>
> 
> ?
> Thanx in advance
> 
> 
> ---------------------------------------------------------------------
> 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




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


Mime
View raw message