ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Passing arguments.
Date Wed, 27 Jun 2001 06:46:57 GMT
Praveen C. <> wrote:

> Can ant recognize and capture arguments
> in the command line.

Everything that doesn't start with a "-" will be interpreted as a
target name by Ant.  You want to pass in a property.

> For example:
> # ant -buildfile build.xml execute

ant -buildfile build.xml execute

and in your buildfile, wherever you wanted to say or $1 or %1
or whatever, say ${filename}.  Use

<project name="dummy" default="echoparameter" basedir=".">
  <target name="echoparameter">
    <echo message="Parameter is ${filename}" />

as a starting point.


View raw message