ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beat Mr Beat je vous prie" <>
Subject passing $* from shell to ant
Date Mon, 11 Mar 2002 10:07:42 GMT

I need to pass args to ant for it to pass them to my main class.
Of course <arg></arg> tags are great.
I've also testes 'ant -Dname=val' syntax.

1) i have NO name for my attributes (and don't want to create one)
2) my main class needs to treat some args while running, so i need to pass them to ant and
ant pass them to my main.
3) i DON'T know how many args and what args i pass. It depends.
   It is often files.
   for ex: i pass to my main :   java mymain file1 file2 file3 file4
   but sometimes there are 6 or 7 files !
   So i don't see how to use <arg></arg> in that case.

To make it simpler, what i want to do is to run ant like this :
   ant runMyMain file1 file2 ... filen
Then in build, i'm looking for the command to say :
  all args are passed to the main file WHATEVER they are and whatever its number is.

so... something like this :
  <target name="myexec"> 
    <java classname="packageA.packageB.Main">
      <arg line=${*}/>        <!-- H E R E --> 
     <pathelement path="${java.class.path}"/>

Is there a way to do this ?

Thanks by advance.

            | \  Beat
          _/ \_

------------------------------------------------------------ for FREE !

Express yourself with a super cool email address from
Hundreds of choices. It's free!

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message