ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johann.pet...@gmail.com
Subject Re: Passing command line arguments to the "run" target??
Date Sat, 26 Aug 2006 18:21:16 GMT
On 8/26/06, Mathieu Champlon <m.champlon@free.fr> wrote:
>
> johann.petrak@gmail.com a écrit :
> > (...)
> > I would like to run the program from within an ant task so that I can
> > make
> > use of how ant can collect the classpath etc., but I would like to
> > pass such
> > command line parameters on the program being called in the run task.
> > (...)
> How do you run the program ? Don't you use the <java> task ?
> It accepts nested <arg> parameters for what you are looking for.
>
> http://ant.apache.org/manual/CoreTasks/java.html


I do use the <java>  task.
But I do not want the parameters to be constant but I want
to pass them down from the actual command line when I
run the "run" task.

So I want to do something like
  ant run -a -b -c
which should result in "-a -b -c" to be passed to the <java> task.
Next time I want to do
  ant run -x a 12 23
and now "-a a 12 23" should be used by the java task.

The point is that I want to use ant to use the "infrastructure"
for setting up the actual run command but I want the
flexibility of passing parameters to the program as if
I would directly call it from the command line using
"java -cp ..... classname <all the args>"

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message