ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill.J.Fell...@mail.sprint.com
Subject RE: trying to check 3 command-line arguments passed to my build
Date Thu, 23 Aug 2001 23:31:19 GMT
I would suspect that it'd be far easier to handle the checking of 
number of arguments in the script that invokes ant rather than doing it 
within Ant itself.  You could then know which target to call in what 
order.

As for the first, code it and try.  I would but my Ant had a little too 
much Raid.

<target name="main">
  <echo message="${arg1} + ${arg2}" />
</target>

/bill

-----Original Message-----
From: vesanchez [mailto:vesanchez@yahoo.com]
Sent: Thursday, August 23, 2001 6:23 PM
To: ant-user
Cc: vesanchez
Subject: trying to check 3 command-line arguments passed to my build


   Hi everyone..

  first of all, thank you for all your help.

  second....

The follow command line arguments are correct in order
to by passed to my build file?

    ant -Darg1=data1,arg2=data2

  or do I need to put a "-D" every time I want to send
the next argument??


   How do I check if someone only put 1 or 2 or none
of the arguments in order to execute a target, is is
correct in this way?

<target name="verify">
   <condition property="jmptarget" value="arquitect">
      <equals check="${arg1}"/>
   </condition>
   <condition property="jumptarget" value="security">
      <equals check="${arg1}"/>
   </condition>
   <condition property="jumptarget" value="colect">
      <equals check="${arg1}"/>
   </condition>
</target>


<!-- if is arquitect GO -->
<target name="arquitect" depends="verify"
if="jmptarget"/>
 .....
</target>

<target name="security" depends="verify"
unless="jmptarget"/>
 .....
</target>

<!-- it wasn't arquitect, but is not security
     its colect -->

<target name="colect" depends="verify"
unless="jmptarget"/>
 .....
</target>

<target name="jumtarget" depends="verify"
unless="jmptarget"/>
 .....
</target>

 I don't know if a made myself clear??
  the thing is..

  I have 3 modules, inside this modules a compilation
could be take for one of them. e.g.

   Security has
       util
       mgr
       ght
   Architec as
       util
       mgr
       ght

  if some one put:
  ant -Darg1=Security,arg2=util
   the XML has to check what submodule has to compile
(javac), but if they only put:
   ant -Darg1=Architec
   All the modules has to be compiled in the order
wich appeared, but Architec depens on Security
  And the last option could be.
    ant -buildfile test.xml
  and all the modules has to be compiled with their
submodules.


  Could anyone could help me pleasee??!!! just show me
the way please. Here at my office want to develop this
but, this is my second day on it, I'm just learning
it, also I have the background from Microsoft, can you
believe that??

  Thanks in advance.  Hope not to boder you at all
VES

=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero estás condenado si no lo 
intentas."

"You can get disappointed if you fail down, but you are doomed if you 
do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


Mime
View raw message