RFR: Upgrade to Gradle 8.0.2
Jorn Vernee
jvernee at openjdk.org
Tue Mar 7 18:25:38 UTC 2023
On Sat, 4 Mar 2023 16:05:22 GMT, James Yuzawa <duke at openjdk.org> wrote:
> Upgrade to the most recent gradle version. The prior version (7.3.3) did not support Java versions after 17 per https://docs.gradle.org/current/userguide/compatibility.html This change will allow user to build jextract on Java 19. I had to make sure I had a JDK 17 around for the gradle, set the JAVA_HOME, then make sure I had another proper JDK to bootstrap the build. Additionally, I added a gradle wrapper validation github action to ensure the integrity of the wrapper.
>
> Question: is "master" not longer the default branch in this repo? Should these changes to into master and then ported to the various versions branches? Let me know how you may want to proceed.
Thanks for the patch!
I'm testing it out on my Windows machine but it seems like there is an issue with this version of gradle:
> .\gradlew clean build
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Error while evaluating property 'javaCompiler' of task ':compileJava'.
> Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
> The configured executable does not exist (<path to jdk>\bin\javac)
It seems like we need to append `.exe` to the javac executable path explicitly now for Windows to work:
diff --git a/build.gradle b/build.gradle
index c349359..45bc921 100644
--- a/build.gradle
+++ b/build.gradle
@@ -32,6 +32,7 @@ def clang_include_dir = "${llvm_home}/lib/clang/${clang_version}/include"
checkPath(clang_include_dir)
def os_lib_dir = Os.isFamily(Os.FAMILY_WINDOWS)? "bin" : "lib"
def os_script_extension = Os.isFamily(Os.FAMILY_WINDOWS)? ".bat" : ""
+def os_exe_extension = Os.isFamily(Os.FAMILY_WINDOWS)? ".exe" : ""
def libclang_dir = "${llvm_home}/${os_lib_dir}"
checkPath(libclang_dir)
@@ -43,7 +44,7 @@ compileJava {
options.release = 21
options.compilerArgs << "--enable-preview"
options.fork = true
- options.forkOptions.executable = "${jdk21_home}/bin/javac"
+ options.forkOptions.executable = "${jdk21_home}/bin/javac${os_exe_extension}"
}
jar {
```
---
> Question: is "master" not longer the default branch in this repo? Should these changes to into master and then ported to the various versions branches? Let me know how you may want to proceed.
The `master` branch is targeting the Java 19 API, which is currently the latest release version. The panama branch targets the API we have in the panama-foreign repo, which is Java 21 now. I don't see support for 21 in the Gradle compatibility matrix though.
Which version of jextract are you interested in building?
-------------
PR: https://git.openjdk.org/jextract/pull/110
More information about the jextract-dev
mailing list