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