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