You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Edgar S�nchez <ve...@yahoo.com> on 2001/08/24 01:22:37 UTC

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/

Re: trying to check 3 command-line arguments passed to my build

Posted by Erik Hatcher <er...@earthlink.net>.
I looks like you are trying to recreate the wheel by implementing your own
build "dependencies".

Think about re-architecting your build so that you have defined a target for
each module, with dependencies specified on the targets in order to achieve
what I think you're doing.

    Erik


----- Original Message -----
From: "Edgar Sánchez" <ve...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, August 23, 2001 4:22 PM
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/