gradlew.bat
changeset 21 0c6a3ad6b052
parent 0 0a13dcabf7d3
equal deleted inserted replaced
20:92b4a71629e0 21:0c6a3ad6b052
    11 @rem distributed under the License is distributed on an "AS IS" BASIS,
    11 @rem distributed under the License is distributed on an "AS IS" BASIS,
    12 @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12 @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13 @rem See the License for the specific language governing permissions and
    13 @rem See the License for the specific language governing permissions and
    14 @rem limitations under the License.
    14 @rem limitations under the License.
    15 @rem
    15 @rem
       
    16 @rem SPDX-License-Identifier: Apache-2.0
       
    17 @rem
    16 
    18 
    17 @if "%DEBUG%" == "" @echo off
    19 @if "%DEBUG%"=="" @echo off
    18 @rem ##########################################################################
    20 @rem ##########################################################################
    19 @rem
    21 @rem
    20 @rem  Gradle startup script for Windows
    22 @rem  Gradle startup script for Windows
    21 @rem
    23 @rem
    22 @rem ##########################################################################
    24 @rem ##########################################################################
    23 
    25 
    24 @rem Set local scope for the variables with windows NT shell
    26 @rem Set local scope for the variables with windows NT shell
    25 if "%OS%"=="Windows_NT" setlocal
    27 if "%OS%"=="Windows_NT" setlocal
    26 
    28 
    27 set DIRNAME=%~dp0
    29 set DIRNAME=%~dp0
    28 if "%DIRNAME%" == "" set DIRNAME=.
    30 if "%DIRNAME%"=="" set DIRNAME=.
       
    31 @rem This is normally unused
    29 set APP_BASE_NAME=%~n0
    32 set APP_BASE_NAME=%~n0
    30 set APP_HOME=%DIRNAME%
    33 set APP_HOME=%DIRNAME%
    31 
    34 
    32 @rem Resolve any "." and ".." in APP_HOME to make it shorter.
    35 @rem Resolve any "." and ".." in APP_HOME to make it shorter.
    33 for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
    36 for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
    38 @rem Find java.exe
    41 @rem Find java.exe
    39 if defined JAVA_HOME goto findJavaFromJavaHome
    42 if defined JAVA_HOME goto findJavaFromJavaHome
    40 
    43 
    41 set JAVA_EXE=java.exe
    44 set JAVA_EXE=java.exe
    42 %JAVA_EXE% -version >NUL 2>&1
    45 %JAVA_EXE% -version >NUL 2>&1
    43 if "%ERRORLEVEL%" == "0" goto execute
    46 if %ERRORLEVEL% equ 0 goto execute
    44 
    47 
    45 echo.
    48 echo. 1>&2
    46 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
    49 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
    47 echo.
    50 echo. 1>&2
    48 echo Please set the JAVA_HOME variable in your environment to match the
    51 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
    49 echo location of your Java installation.
    52 echo location of your Java installation. 1>&2
    50 
    53 
    51 goto fail
    54 goto fail
    52 
    55 
    53 :findJavaFromJavaHome
    56 :findJavaFromJavaHome
    54 set JAVA_HOME=%JAVA_HOME:"=%
    57 set JAVA_HOME=%JAVA_HOME:"=%
    55 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
    58 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
    56 
    59 
    57 if exist "%JAVA_EXE%" goto execute
    60 if exist "%JAVA_EXE%" goto execute
    58 
    61 
    59 echo.
    62 echo. 1>&2
    60 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
    63 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
    61 echo.
    64 echo. 1>&2
    62 echo Please set the JAVA_HOME variable in your environment to match the
    65 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
    63 echo location of your Java installation.
    66 echo location of your Java installation. 1>&2
    64 
    67 
    65 goto fail
    68 goto fail
    66 
    69 
    67 :execute
    70 :execute
    68 @rem Setup the command line
    71 @rem Setup the command line
    73 @rem Execute Gradle
    76 @rem Execute Gradle
    74 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
    77 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
    75 
    78 
    76 :end
    79 :end
    77 @rem End local scope for the variables with windows NT shell
    80 @rem End local scope for the variables with windows NT shell
    78 if "%ERRORLEVEL%"=="0" goto mainEnd
    81 if %ERRORLEVEL% equ 0 goto mainEnd
    79 
    82 
    80 :fail
    83 :fail
    81 rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
    84 rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
    82 rem the _cmd.exe /c_ return code!
    85 rem the _cmd.exe /c_ return code!
    83 if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
    86 set EXIT_CODE=%ERRORLEVEL%
    84 exit /b 1
    87 if %EXIT_CODE% equ 0 set EXIT_CODE=1
       
    88 if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
       
    89 exit /b %EXIT_CODE%
    85 
    90 
    86 :mainEnd
    91 :mainEnd
    87 if "%OS%"=="Windows_NT" endlocal
    92 if "%OS%"=="Windows_NT" endlocal
    88 
    93 
    89 :omega
    94 :omega