ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Davidson" <Je...@rocketgaming.com>
Subject RE: Using command line arguments
Date Thu, 16 Sep 2004 18:13:26 GMT
Satish,

You want to investigate the if="${property}" attribute of the <target/>
element.  That attribute specifies that the target should only run if
the given property is defined.  (i.e. by your command-line argument)

http://ant.apache.org/manual/using.html#targets

Regards,
~Jeff

-----Original Message-----
From: Satish Jeejula [mailto:Satish_Jeejula@irco.com] 
Sent: September 16, 2004 11:08
To: user@ant.apache.org
Subject: Using command line arguments

Hi All,
 
I just started learning ANT tool. I have a simple build file that
compiles java file into a build directory successfully. The build file
right now deletes the build directory every time it runs. I would like
to change it such a way so that the build directory is deleted only when
user specifies it as command-line argument.
 
e.g.: ant -f compile.xml compile -DdeleteBuildDir=true  ----> should
delete the build directory
e.g.: ant -f comile.xml compile ----> should not delete the build
directory.
 
I am thinking of creating another target which deletes the directory.
Then execute that target only when this command-line argument is passed.
 
Please let me know if this can achieved and if so, any clue or hints
will help me.
 
Thanks,
Satish



-----------------------------------------
The information contained in this message is privileged and intended
only for the recipients named. If the reader is not a representative of
the intended recipient, any review, dissemination or copying of this
message or the information it contains is prohibited. If you have
received this message in error, please immediately notify the sender,
and delete the original message and attachments. 
  
 
This electronic message transmission, including attachments, is for the exclusive use of the
individuals to which this e-mail is addressed and is to be reviewed and used exclusively for
authorized company purposes.  This transmission may contain proprietary, confidential or privileged
information.  If you are not the intended recipient of this transmission, you are hereby notified
that any use, copying, disclosure, dissemination, distribution or taking of any action in
reliance upon the contents of this transmission is strictly prohibited.  If you believe you
may have received this electronic message in error, please notify the sender immediately by
return email and delete or destroy the original message and/or any copy of it from your computer
system and/or your files.  Thank you. 

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


Mime
View raw message