[jboss-jira] [JBoss JIRA] (JGRP-1166) Fix processing of Windows batch file arguments
Bela Ban (JIRA)
jira-events at lists.jboss.org
Thu Jun 7 00:38:18 EDT 2012
[ https://issues.jboss.org/browse/JGRP-1166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bela Ban deleted JGRP-1166:
---------------------------
> Fix processing of Windows batch file arguments
> ----------------------------------------------
>
> Key: JGRP-1166
> URL: https://issues.jboss.org/browse/JGRP-1166
> Project: JGroups
> Issue Type: Bug
> Environment: Windows
> Reporter: Richard Achmatowicz
> Assignee: Richard Achmatowicz
>
> The file build.bat can sometimes take a rather long set of command line arguments, due to specification of JVM system properties; for example,
> $ build.bat -Djgroups.bind_addr=%MYTESTIP_1% -Djgroups.udp.mcast_addr=%MCAST_ADDR% -Djgroups.tcpping.initial_hosts="%MYTESTIP_1%[7800],%MYTESTIP_1[7801]" all-tests-functional
> Windows batch files provide positional parameters %0 through %9 to collect the first nine arguments. Windows batch files also process a single parameter -Dfred=barney as two parameters -Dfred and barney. This leads to a limit on the number of system properties we can pass to the build.bat file, due to the way the command line arguments are processed (i.e. using the maximum number of positional parameters). In the worst case, some system properties get lost.
> One way to fix this is to gather together the all the command line arguments using the shift operator and store them in a variable, BUILD_ARGS. Here is the code:
> REM ******************************************************
> REM ********Save the command line arguments***************
> REM ******************************************************
> set BUILD_ARGS=%1
> if ""%1""=="""" goto completedArgs
> shift
> :processArg
> if ""%1""=="""" goto completedArgs
> set BUILD_ARGS=%BUILD_ARGS% %1
> shift
> goto processArg
> :completedArgs
> The variable BUILD_ARGS can then be passed to the
> %JAVA_HOME%\bin\java -classpath "%CP%" org.apache.tools.ant.Main -buildfile build.xml %BUILD_ARGS%
> This gets rid of the limit on command line parameters for batch files.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list