Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 85583 invoked from network); 16 Sep 2004 18:23:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Sep 2004 18:23:34 -0000 Received: (qmail 37101 invoked by uid 500); 16 Sep 2004 18:23:18 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 36963 invoked by uid 500); 16 Sep 2004 18:23:16 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 36925 invoked by uid 99); 16 Sep 2004 18:23:15 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [65.198.133.203] (HELO irco.com) (65.198.133.203) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 16 Sep 2004 11:23:14 -0700 Received: from ([10.126.49.195]) by mail2.irco.com with ESMTP ; Thu, 16 Sep 2004 13:22:38 -0500 Subject: RE: Using command line arguments Date: Thu, 16 Sep 2004 13:23:48 -0500 MIME-Version: 1.0 To: user@ant.apache.org Cc: From: "Satish Jeejula" X-Mailer: Microsoft Outlook v 10.00.2627, MSOC v 2.00.4007.00 Message-ID: X-MIMETrack: Serialize by Router on scsirusntsh2/Servers/IRCorp(Release 5.0.11 |July 24, 2002) at 09/16/2004 02:36:36 PM, Serialize complete at 09/16/2004 02:36:36 PM Content-Transfer-Encoding: 7bit X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Content-Type: text/plain; charset="us-ascii" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jeff, How can pass the value from command line to the property in build file? In my example, "deleteBuildDir=true" should be copied to the property in the build file. Also the 'if' attribute checks to the property is set or not. It does not check to see if the value of the property is true or false. But if I can figure out a way to take the command-line and set the property at run time, it should work. Thanks, Satish -----Original Message----- From: Jeff Davidson [mailto:JeffD@rocketgaming.com] Sent: Thursday, September 16, 2004 1:13 PM To: Ant Users List Subject: RE: Using command line arguments Satish, You want to investigate the if="${property}" attribute of the 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 R ----------------------------------------- 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. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org