dweiss commented on code in PR #16483: URL: https://github.com/apache/lucene/pull/16483#discussion_r3738323826
########## gradlew.bat: ########## @@ -105,21 +86,34 @@ IF NOT EXIST "%APP_HOME%\gradle.properties" ( endlocal ) -goto launchGradle - -:failWithJvmMessage -@rem https://github.com/apache/lucene/pull/819 -echo Error: Something went wrong. Make sure you're using the minimum required Java version to compile Lucene. -goto exitWithErrorLevel - -:launchGradle +@rem A manually-installed gradle-wrapper.jar takes priority over our source-based bootstrap. +SET GRADLE_WRAPPER_JAR=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +SET GRADLE_WRAPPER_SRC=%APP_HOME%\gradle\wrapper\GradleWrapper.java +SET GRADLE_WRAPPER_CACHE=%APP_HOME%\.gradle\tmp\gradle-wrapper-classes +SET "JAVAC_EXE=%JAVA_EXE:java.exe=javac.exe%" + +@rem Compile GradleWrapper.java once and reuse the compiled classes, instead of paying the +@rem single-file-source-launch recompile cost on every invocation. Falls back to source-launch +@rem (slower, but self-healing) if compilation isn't available or fails for any reason. +@rem No staleness check: if you edit GradleWrapper.java, delete %GRADLE_WRAPPER_CACHE% to force +@rem a recompile (this file changes rarely, so keeping this simple is worth that manual step). Review Comment: There seem to be some powershell solutions to check the 'if newer' condition but they're rather hairy. Don't know if there's any other way but right now I think it's going to be trappy for WIndows users. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
