ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Dibi" <George.D...@intervoice.com>
Subject RE: How to command line argument to build.xml file
Date Mon, 10 Jan 2005 20:29:26 GMT

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:rhino1@sympatico.ca] 
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" <George.Dibi@intervoice.com>
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: 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