ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: how to retrieve ant command line arguments on LINUX
Date Mon, 04 Dec 2006 15:58:38 GMT
On Windows the ANT_CMD_LINE_ARGS environment variable is set by the launcher script bin\ant.bat.
So the equivalent would be found in the unix launcher: bin/ant

bin/ant:0024: for arg in "$@" ; do
bin/ant:0031:   elif [ my"$arg" = my"--h"  -o my"$arg" = my"--help"  ] ; then
bin/ant:0032:     show_help=true
bin/ant:0033:     ant_exec_args="$ant_exec_args -h"
bin/ant:0034:   else
bin/ant:0035:     if [  my"$arg" = my"-h"  -o  my"$arg" = my"-help" ] ; then
bin/ant:0036:       show_help=true
bin/ant:0037:     fi
bin/ant:0038:     ant_exec_args="$ant_exec_args \"$arg\""
bin/ant:0039:   fi
bin/ant:0040: done
bin/ant:0322: ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\"

              -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts 
     $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
bin/ant:0323: if $ant_exec_debug ; then
bin/ant:0324:     echo $ant_exec_command
bin/ant:0325: fi
bin/ant:0326: eval $ant_exec_command

So try "ant_exec_command".
I havent Linux, so let us know ;-)


>-----Ursprüngliche Nachricht-----
>Von: Bernard LUPIN [] 
>Gesendet: Montag, 4. Dezember 2006 16:44
>Betreff: how to retrieve ant command line arguments on LINUX
>Hi all,
>Is it possible to retrieve the ant command line arguments 
>(like -verbose, -quiet, ...) within an ant task ?
>On windows platforms, I've found that
>env.ANT_CMD_LINE_ARGS contains all the ant arguments, so I can 
>parse them with the contrib's propertyregex task.
>But this don't work on my Linux platform, since 
>ANT_CMD_LINE_ARGS seems to be not set.
>Thanks a lot !
>Découvrez une nouvelle façon d'obtenir des réponses à toutes 
>vos questions ! 
>Profitez des connaissances, des opinions et des expériences 
>des internautes sur Yahoo! Questions/Réponses 
>To unsubscribe, e-mail: For 
>additional commands, e-mail:

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

View raw message