gradlew.bat 2.9 KB

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