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 16*6613e772Smaotoumao@rem SPDX-License-Identifier: Apache-2.0 17*6613e772Smaotoumao@rem 18bf6e62f2S猫头猫 19bf6e62f2S猫头猫@if "%DEBUG%"=="" @echo off 20bf6e62f2S猫头猫@rem ########################################################################## 21bf6e62f2S猫头猫@rem 22bf6e62f2S猫头猫@rem Gradle startup script for Windows 23bf6e62f2S猫头猫@rem 24bf6e62f2S猫头猫@rem ########################################################################## 25bf6e62f2S猫头猫 26bf6e62f2S猫头猫@rem Set local scope for the variables with windows NT shell 27bf6e62f2S猫头猫if "%OS%"=="Windows_NT" setlocal 28bf6e62f2S猫头猫 29bf6e62f2S猫头猫set DIRNAME=%~dp0 30bf6e62f2S猫头猫if "%DIRNAME%"=="" set DIRNAME=. 315589cdf3S猫头猫@rem This is normally unused 32bf6e62f2S猫头猫set APP_BASE_NAME=%~n0 33bf6e62f2S猫头猫set APP_HOME=%DIRNAME% 34bf6e62f2S猫头猫 35bf6e62f2S猫头猫@rem Resolve any "." and ".." in APP_HOME to make it shorter. 36bf6e62f2S猫头猫for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37bf6e62f2S猫头猫 38bf6e62f2S猫头猫@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39bf6e62f2S猫头猫set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40bf6e62f2S猫头猫 41bf6e62f2S猫头猫@rem Find java.exe 42bf6e62f2S猫头猫if defined JAVA_HOME goto findJavaFromJavaHome 43bf6e62f2S猫头猫 44bf6e62f2S猫头猫set JAVA_EXE=java.exe 45bf6e62f2S猫头猫%JAVA_EXE% -version >NUL 2>&1 465589cdf3S猫头猫if %ERRORLEVEL% equ 0 goto execute 47bf6e62f2S猫头猫 485589cdf3S猫头猫echo. 1>&2 495589cdf3S猫头猫echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 505589cdf3S猫头猫echo. 1>&2 515589cdf3S猫头猫echo Please set the JAVA_HOME variable in your environment to match the 1>&2 525589cdf3S猫头猫echo location of your Java installation. 1>&2 53bf6e62f2S猫头猫 54bf6e62f2S猫头猫goto fail 55bf6e62f2S猫头猫 56bf6e62f2S猫头猫:findJavaFromJavaHome 57bf6e62f2S猫头猫set JAVA_HOME=%JAVA_HOME:"=% 58bf6e62f2S猫头猫set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59bf6e62f2S猫头猫 60bf6e62f2S猫头猫if exist "%JAVA_EXE%" goto execute 61bf6e62f2S猫头猫 625589cdf3S猫头猫echo. 1>&2 635589cdf3S猫头猫echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 645589cdf3S猫头猫echo. 1>&2 655589cdf3S猫头猫echo Please set the JAVA_HOME variable in your environment to match the 1>&2 665589cdf3S猫头猫echo location of your Java installation. 1>&2 67bf6e62f2S猫头猫 68bf6e62f2S猫头猫goto fail 69bf6e62f2S猫头猫 70bf6e62f2S猫头猫:execute 71bf6e62f2S猫头猫@rem Setup the command line 72bf6e62f2S猫头猫 73bf6e62f2S猫头猫set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74bf6e62f2S猫头猫 75bf6e62f2S猫头猫 76bf6e62f2S猫头猫@rem Execute Gradle 77bf6e62f2S猫头猫"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78bf6e62f2S猫头猫 79bf6e62f2S猫头猫:end 80bf6e62f2S猫头猫@rem End local scope for the variables with windows NT shell 815589cdf3S猫头猫if %ERRORLEVEL% equ 0 goto mainEnd 82bf6e62f2S猫头猫 83bf6e62f2S猫头猫:fail 84bf6e62f2S猫头猫rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85bf6e62f2S猫头猫rem the _cmd.exe /c_ return code! 865589cdf3S猫头猫set EXIT_CODE=%ERRORLEVEL% 875589cdf3S猫头猫if %EXIT_CODE% equ 0 set EXIT_CODE=1 885589cdf3S猫头猫if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 895589cdf3S猫头猫exit /b %EXIT_CODE% 90bf6e62f2S猫头猫 91bf6e62f2S猫头猫:mainEnd 92bf6e62f2S猫头猫if "%OS%"=="Windows_NT" endlocal 93bf6e62f2S猫头猫 94bf6e62f2S猫头猫:omega 95