@@ -29,9 +29,6 @@ if "%DIRNAME%" == "" set DIRNAME=.
29
29
set APP_BASE_NAME = %~n0
30
30
set APP_HOME = %DIRNAME%
31
31
32
- @ rem Resolve any "." and ".." in APP_HOME to make it shorter.
33
- for %%i in (" %APP_HOME% " ) do set APP_HOME = %%~fi
34
-
35
32
@ rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36
33
set DEFAULT_JVM_OPTS = " -Xmx64m" " -Xms64m"
37
34
@@ -40,7 +37,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
40
37
41
38
set JAVA_EXE = java.exe
42
39
%JAVA_EXE% -version > NUL 2 >& 1
43
- if " %ERRORLEVEL% " == " 0" goto execute
40
+ if " %ERRORLEVEL% " == " 0" goto init
44
41
45
42
echo .
46
43
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +51,7 @@ goto fail
54
51
set JAVA_HOME = %JAVA_HOME:" =%
55
52
set JAVA_EXE = %JAVA_HOME% /bin/java.exe
56
53
57
- if exist " %JAVA_EXE% " goto execute
54
+ if exist " %JAVA_EXE% " goto init
58
55
59
56
echo .
60
57
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,14 +61,28 @@ echo location of your Java installation.
64
61
65
62
goto fail
66
63
64
+ :init
65
+ @ rem Get command-line arguments, handling Windows variants
66
+
67
+ if not " %OS% " == " Windows_NT" goto win9xME_args
68
+
69
+ :win9xME_args
70
+ @ rem Slurp the command line arguments.
71
+ set CMD_LINE_ARGS =
72
+ set _SKIP = 2
73
+
74
+ :win9xME_args_slurp
75
+ if " x%~1 " == " x" goto execute
76
+
77
+ set CMD_LINE_ARGS = %*
78
+
67
79
:execute
68
80
@ rem Setup the command line
69
81
70
82
set CLASSPATH = %APP_HOME% \gradle\wrapper\gradle-wrapper.jar
71
83
72
-
73
84
@ rem Execute Gradle
74
- " %JAVA_EXE% " %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% " -Dorg.gradle.appname=%APP_BASE_NAME% " -classpath " %CLASSPATH% " org.gradle.wrapper.GradleWrapperMain %*
85
+ " %JAVA_EXE% " %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% " -Dorg.gradle.appname=%APP_BASE_NAME% " -classpath " %CLASSPATH% " org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
75
86
76
87
:end
77
88
@ rem End local scope for the variables with windows NT shell
0 commit comments