Do you mean in my exec, in this line <arg line="${basedir} ${perl.bin.dir} ${lbl.perl.target} ${client.only}"/> Substitute ${client.only} by -Dclient.only=true.
The real command that I trying to run in the build.xml file is perl.exe malkelabel.pl example.txt. Since example.txt could take any name, I can't make it as a variable in any of my property file. -----Original Message----- From: EJ Ciramella [mailto:[EMAIL PROTECTED] Sent: Monday, January 10, 2005 2:35 PM To: Ant Users List Subject: RE: How to command line argument to build.xml file I think on the commandline, it should be -Dclient.only=true? (Rhino pointed this out. . .) -----Original Message----- From: George Dibi [mailto:[EMAIL PROTECTED] Sent: Monday, January 10, 2005 3:29 PM To: Ant Users List Subject: RE: How to command line argument to build.xml file Rhino, Sorry for getting back with you late, but I did what you suggested and the <arg line="${basedir} ${perl.bin.dir} ${lbl.perl.target}${client.only}"/> And at the cmdline ant -Dclient=true -buildfile test.xml target All get is: perl.exe maklelabel.pl "false" What I am trying to resolve is: perl.exe malkelabel.pl example.txt where example.txt is the none argument I am passing. Example.txt could be any text file the user will type. <property name="client.only" value="false"/> <property name="drive" value="V:"/> <target name="init" description="Create output directories if they don't already exist"> <tstamp> <format property="DATE" pattern="MM/dd/yyyy"/> <format property="TIME" pattern="hh:mm aa z"/> <format property="STAMP" pattern="yyMMddHHmmssZ"/> </tstamp> </target> <target name="isoft36"> <echo> Labeling... </echo> <exec executable="${ant.common.dir}/createProcess.exe"> <arg line="${basedir} ${perl.bin.dir} ${lbl.perl.target} ${client.only}"/> </exec> </target> -----Original Message----- From: Rhino [mailto:[EMAIL PROTECTED] Sent: Friday, January 07, 2005 6:28 PM To: Ant Users List Subject: Re: How to command line argument to build.xml file This is the technique; you should be able to adapt it to your needs very easily. Suppose we have a property named 'client.only' defined as follows: <property name="client.only" value="false"/> The default value of the property is 'false'. If you want to override the value of the property from the command line, do this on the command line: ant -Dclient.only=true Note that there are no spaces and no quotes, apostrophes, or backtics anywhere in the expression that overrides the value of the property. Naturally, you can extend this concept to as many properties as you want. For example: ant -Dclient.only=true -Duserid=me -Dpassword=mypass Rhino ----- Original Message ----- From: "George Dibi" <[EMAIL PROTECTED]> To: "Ant Users List" <user@ant.apache.org> Sent: Friday, January 07, 2005 6:40 PM Subject: How to command line argument to build.xml file Can someone tell me how to pass a stdin argument on a build file And that argument be a value in arg line. i.e >ant isoft.xml isoftlbl.txt where isoftlbl.txt is the stdin that will be a value to my arg line. <target name="isoftLabel"> <echo> ${perl.bin.dir} ${ivc.perl.target} ${drive} ${BUILD_VIEW} ${IVCOMMONVOB_VER} ${IVCOMMONVOB_BLD} </echo> <exec executable="${ant.common.dir}/createProcess.exe"> <arg line="${basedir} ${perl.bin.dir} makelabelpl isoftlbl.txt "/> </exec> </target> Thanks --------------------------------------------------------------------- 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] --------------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]