1bf6e62f2S猫头猫@rem 2bf6e62f2S猫头猫@rem Copyright 2015 the original author or authors. 3bf6e62f2S猫头猫@rem 4bf6e62f2S猫头猫@rem Licensed under the Apache License, Version 2.0 (the "License"); 5bf6e62f2S猫头猫@rem you may not use this file except in compliance with the License. 6bf6e62f2S猫头猫@rem You may obtain a copy of the License at 7bf6e62f2S猫头猫@rem 8bf6e62f2S猫头猫@rem https://www.apache.org/licenses/LICENSE-2.0 9bf6e62f2S猫头猫@rem 10bf6e62f2S猫头猫@rem Unless required by applicable law or agreed to in writing, software 11bf6e62f2S猫头猫@rem distributed under the License is distributed on an "AS IS" BASIS, 12bf6e62f2S猫头猫@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bf6e62f2S猫头猫@rem See the License for the specific language governing permissions and 14bf6e62f2S猫头猫@rem limitations under the License. 15bf6e62f2S猫头猫@rem 16bf6e62f2S猫头猫 17bf6e62f2S猫头猫@if "%DEBUG%"=="" @echo off 18bf6e62f2S猫头猫@rem ########################################################################## 19bf6e62f2S猫头猫@rem 20bf6e62f2S猫头猫@rem Gradle startup script for Windows 21bf6e62f2S猫头猫@rem 22bf6e62f2S猫头猫@rem ########################################################################## 23bf6e62f2S猫头猫 24bf6e62f2S猫头猫@rem Set local scope for the variables with windows NT shell 25bf6e62f2S猫头猫if "%OS%"=="Windows_NT" setlocal 26bf6e62f2S猫头猫 27bf6e62f2S猫头猫set DIRNAME=%~dp0 28bf6e62f2S猫头猫if "%DIRNAME%"=="" set DIRNAME=. 29*5589cdf3S猫头猫@rem This is normally unused 30bf6e62f2S猫头猫set APP_BASE_NAME=%~n0 31bf6e62f2S猫头猫set APP_HOME=%DIRNAME% 32bf6e62f2S猫头猫 33bf6e62f2S猫头猫@rem Resolve any "." and ".." in APP_HOME to make it shorter. 34bf6e62f2S猫头猫for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35bf6e62f2S猫头猫 36bf6e62f2S猫头猫@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37bf6e62f2S猫头猫set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38bf6e62f2S猫头猫 39bf6e62f2S猫头猫@rem Find java.exe 40bf6e62f2S猫头猫if defined JAVA_HOME goto findJavaFromJavaHome 41bf6e62f2S猫头猫 42bf6e62f2S猫头猫set JAVA_EXE=java.exe 43bf6e62f2S猫头猫%JAVA_EXE% -version >NUL 2>&1 44*5589cdf3S猫头猫if %ERRORLEVEL% equ 0 goto execute 45bf6e62f2S猫头猫 46*5589cdf3S猫头猫echo. 1>&2 47*5589cdf3S猫头猫echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48*5589cdf3S猫头猫echo. 1>&2 49*5589cdf3S猫头猫echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50*5589cdf3S猫头猫echo location of your Java installation. 1>&2 51bf6e62f2S猫头猫 52bf6e62f2S猫头猫goto fail 53bf6e62f2S猫头猫 54bf6e62f2S猫头猫:findJavaFromJavaHome 55bf6e62f2S猫头猫set JAVA_HOME=%JAVA_HOME:"=% 56bf6e62f2S猫头猫set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57bf6e62f2S猫头猫 58bf6e62f2S猫头猫if exist "%JAVA_EXE%" goto execute 59bf6e62f2S猫头猫 60*5589cdf3S猫头猫echo. 1>&2 61*5589cdf3S猫头猫echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62*5589cdf3S猫头猫echo. 1>&2 63*5589cdf3S猫头猫echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64*5589cdf3S猫头猫echo location of your Java installation. 1>&2 65bf6e62f2S猫头猫 66bf6e62f2S猫头猫goto fail 67bf6e62f2S猫头猫 68bf6e62f2S猫头猫:execute 69bf6e62f2S猫头猫@rem Setup the command line 70bf6e62f2S猫头猫 71bf6e62f2S猫头猫set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72bf6e62f2S猫头猫 73bf6e62f2S猫头猫 74bf6e62f2S猫头猫@rem Execute Gradle 75bf6e62f2S猫头猫"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76bf6e62f2S猫头猫 77bf6e62f2S猫头猫:end 78bf6e62f2S猫头猫@rem End local scope for the variables with windows NT shell 79*5589cdf3S猫头猫if %ERRORLEVEL% equ 0 goto mainEnd 80bf6e62f2S猫头猫 81bf6e62f2S猫头猫:fail 82bf6e62f2S猫头猫rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83bf6e62f2S猫头猫rem the _cmd.exe /c_ return code! 84*5589cdf3S猫头猫set EXIT_CODE=%ERRORLEVEL% 85*5589cdf3S猫头猫if %EXIT_CODE% equ 0 set EXIT_CODE=1 86*5589cdf3S猫头猫if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87*5589cdf3S猫头猫exit /b %EXIT_CODE% 88bf6e62f2S猫头猫 89bf6e62f2S猫头猫:mainEnd 90bf6e62f2S猫头猫if "%OS%"=="Windows_NT" endlocal 91bf6e62f2S猫头猫 92bf6e62f2S猫头猫:omega 93