xref: /aosp_15_r20/system/extras/simpleperf/demo/SimpleperfExampleCpp/gradlew.bat (revision 288bf5226967eb3dac5cce6c939ccc2a7f2b4fe5)
1*288bf522SAndroid Build Coastguard Worker@if "%DEBUG%" == "" @echo off
2*288bf522SAndroid Build Coastguard Worker@rem ##########################################################################
3*288bf522SAndroid Build Coastguard Worker@rem
4*288bf522SAndroid Build Coastguard Worker@rem  Gradle startup script for Windows
5*288bf522SAndroid Build Coastguard Worker@rem
6*288bf522SAndroid Build Coastguard Worker@rem ##########################################################################
7*288bf522SAndroid Build Coastguard Worker
8*288bf522SAndroid Build Coastguard Worker@rem Set local scope for the variables with windows NT shell
9*288bf522SAndroid Build Coastguard Workerif "%OS%"=="Windows_NT" setlocal
10*288bf522SAndroid Build Coastguard Worker
11*288bf522SAndroid Build Coastguard Workerset DIRNAME=%~dp0
12*288bf522SAndroid Build Coastguard Workerif "%DIRNAME%" == "" set DIRNAME=.
13*288bf522SAndroid Build Coastguard Workerset APP_BASE_NAME=%~n0
14*288bf522SAndroid Build Coastguard Workerset APP_HOME=%DIRNAME%
15*288bf522SAndroid Build Coastguard Worker
16*288bf522SAndroid 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.
17*288bf522SAndroid Build Coastguard Workerset DEFAULT_JVM_OPTS=
18*288bf522SAndroid Build Coastguard Worker
19*288bf522SAndroid Build Coastguard Worker@rem Find java.exe
20*288bf522SAndroid Build Coastguard Workerif defined JAVA_HOME goto findJavaFromJavaHome
21*288bf522SAndroid Build Coastguard Worker
22*288bf522SAndroid Build Coastguard Workerset JAVA_EXE=java.exe
23*288bf522SAndroid Build Coastguard Worker%JAVA_EXE% -version >NUL 2>&1
24*288bf522SAndroid Build Coastguard Workerif "%ERRORLEVEL%" == "0" goto init
25*288bf522SAndroid Build Coastguard Worker
26*288bf522SAndroid Build Coastguard Workerecho.
27*288bf522SAndroid Build Coastguard Workerecho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28*288bf522SAndroid Build Coastguard Workerecho.
29*288bf522SAndroid Build Coastguard Workerecho Please set the JAVA_HOME variable in your environment to match the
30*288bf522SAndroid Build Coastguard Workerecho location of your Java installation.
31*288bf522SAndroid Build Coastguard Worker
32*288bf522SAndroid Build Coastguard Workergoto fail
33*288bf522SAndroid Build Coastguard Worker
34*288bf522SAndroid Build Coastguard Worker:findJavaFromJavaHome
35*288bf522SAndroid Build Coastguard Workerset JAVA_HOME=%JAVA_HOME:"=%
36*288bf522SAndroid Build Coastguard Workerset JAVA_EXE=%JAVA_HOME%/bin/java.exe
37*288bf522SAndroid Build Coastguard Worker
38*288bf522SAndroid Build Coastguard Workerif exist "%JAVA_EXE%" goto init
39*288bf522SAndroid Build Coastguard Worker
40*288bf522SAndroid Build Coastguard Workerecho.
41*288bf522SAndroid Build Coastguard Workerecho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42*288bf522SAndroid Build Coastguard Workerecho.
43*288bf522SAndroid Build Coastguard Workerecho Please set the JAVA_HOME variable in your environment to match the
44*288bf522SAndroid Build Coastguard Workerecho location of your Java installation.
45*288bf522SAndroid Build Coastguard Worker
46*288bf522SAndroid Build Coastguard Workergoto fail
47*288bf522SAndroid Build Coastguard Worker
48*288bf522SAndroid Build Coastguard Worker:init
49*288bf522SAndroid Build Coastguard Worker@rem Get command-line arguments, handling Windows variants
50*288bf522SAndroid Build Coastguard Worker
51*288bf522SAndroid Build Coastguard Workerif not "%OS%" == "Windows_NT" goto win9xME_args
52*288bf522SAndroid Build Coastguard Worker
53*288bf522SAndroid Build Coastguard Worker:win9xME_args
54*288bf522SAndroid Build Coastguard Worker@rem Slurp the command line arguments.
55*288bf522SAndroid Build Coastguard Workerset CMD_LINE_ARGS=
56*288bf522SAndroid Build Coastguard Workerset _SKIP=2
57*288bf522SAndroid Build Coastguard Worker
58*288bf522SAndroid Build Coastguard Worker:win9xME_args_slurp
59*288bf522SAndroid Build Coastguard Workerif "x%~1" == "x" goto execute
60*288bf522SAndroid Build Coastguard Worker
61*288bf522SAndroid Build Coastguard Workerset CMD_LINE_ARGS=%*
62*288bf522SAndroid Build Coastguard Worker
63*288bf522SAndroid Build Coastguard Worker:execute
64*288bf522SAndroid Build Coastguard Worker@rem Setup the command line
65*288bf522SAndroid Build Coastguard Worker
66*288bf522SAndroid Build Coastguard Workerset CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67*288bf522SAndroid Build Coastguard Worker
68*288bf522SAndroid Build Coastguard Worker@rem Execute Gradle
69*288bf522SAndroid Build Coastguard Worker"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70*288bf522SAndroid Build Coastguard Worker
71*288bf522SAndroid Build Coastguard Worker:end
72*288bf522SAndroid Build Coastguard Worker@rem End local scope for the variables with windows NT shell
73*288bf522SAndroid Build Coastguard Workerif "%ERRORLEVEL%"=="0" goto mainEnd
74*288bf522SAndroid Build Coastguard Worker
75*288bf522SAndroid Build Coastguard Worker:fail
76*288bf522SAndroid Build Coastguard Workerrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77*288bf522SAndroid Build Coastguard Workerrem the _cmd.exe /c_ return code!
78*288bf522SAndroid Build Coastguard Workerif  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79*288bf522SAndroid Build Coastguard Workerexit /b 1
80*288bf522SAndroid Build Coastguard Worker
81*288bf522SAndroid Build Coastguard Worker:mainEnd
82*288bf522SAndroid Build Coastguard Workerif "%OS%"=="Windows_NT" endlocal
83*288bf522SAndroid Build Coastguard Worker
84*288bf522SAndroid Build Coastguard Worker:omega
85