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