ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: pass command-lines through to class
Date Tue, 07 Dec 2004 06:50:03 GMT
At the moment you can use properties.

ant target -Darg1=a -Darg2=b -Darg3=c

<property name="arg1" value=""/>
<property name="arg2" value=""/>
<property name="arg3" value=""/>
<java ...>
   <arg value="${arg1}"/>
   <arg value="${arg2}"/>
   <arg value="${arg3}"/>
</java>
   

Setting the props to empty string results in passing "no-args" to the
class if not set.


Jan



> -----Urspr√ľngliche Nachricht-----
> Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Gesendet am: Dienstag, 7. Dezember 2004 00:05
> An: Ant Users List
> Betreff: Re: pass command-lines through to class
> 
> --- Kendall Shaw <queshaw@pacbell.net> wrote:
> [blank lines removed]
> > I have to use main(String[] args) in a class,
> > instead of using properties.
> > Is there a way to pass through arguments to the
> > class?
> > I've read an example such as:
> > ant target -- a b c
> > But, ant complains that -- is an unknown argument.
> 
> This is an incomplete representation of one of
> Dominique's proposals, IIRC.  You probably want to
> define properties and pass them as nested <arg>
> elements to the <java> task.
> 
> -Matt
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - now with 250MB free storage. Learn more.
> http://info.mail.yahoo.com/mail_250
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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