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