Skip to content

Commit

Permalink
Fix JVM error branch logic. (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss authored Apr 25, 2022
1 parent c89f8a7 commit 2080caf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ goto fail
@rem LUCENE-9266: verify and download the gradle wrapper jar if we don't have one.
set GRADLE_WRAPPER_JAR=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
"%JAVA_EXE%" %JAVA_OPTS% --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "%GRADLE_WRAPPER_JAR%"
IF %ERRORLEVEL% EQU 1 goto failWithJvmMessage
IF %ERRORLEVEL% NEQ 0 goto fail

@rem Setup the command line
Expand All @@ -91,15 +92,17 @@ IF NOT EXIST "%DIRNAME%\gradle.properties" SET GRADLE_DAEMON_CTRL=--no-daemon

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% EQU 0 goto mainEnd
goto fail

:fail
:failWithJvmMessage
@rem https://github.com/apache/lucene/pull/819
echo Error: Something went wrong. Make sure you're using Java 17.

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
Expand Down

0 comments on commit 2080caf

Please sign in to comment.