-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build on latest JDK, but run tests on several #664
base: master
Are you sure you want to change the base?
Conversation
[11, 12, 16, 18].each { majorVersion -> | ||
def jdkTest = tasks.register("testJdk$majorVersion", Test) { | ||
javaLauncher = javaToolchains.launcherFor { | ||
languageVersion = JavaLanguageVersion.of(majorVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this also change GradleRunner's JVM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'm not sure. @JakeWharton ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was having "fun" with Java and Gradle versions, I added this println to always see what's up:
https://github.com/TWiStErRob/net.twisterrob.gradle/blob/master/test/src/main/kotlin/net/twisterrob/gradle/test/GradleRunnerRule.kt#L159
(I didn't yet do what Jake suggested in his blog in my Gradle setup.)
[11, 12, 16, 18].each { majorVersion -> | ||
def jdkTest = tasks.register("testJdk$majorVersion", Test) { | ||
javaLauncher = javaToolchains.launcherFor { | ||
languageVersion = JavaLanguageVersion.of(majorVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re CI failure, these might come in handy:
paparazzi/build.gradle
Outdated
// Avoid the native projects in 'libs' | ||
plugins.withId('org.jetbrains.kotlin.jvm') { | ||
// Create a test task for each supported JDK. | ||
[11, 12, 16, 18].each { majorVersion -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should really include 17 as some vendors declared that an LTS release so the probability that someone will have it is high.
I assume the failure is because AdoptOpenJDK (which doesn't even exist anymore) deletes versions which they You can get Gradle to provision Azul Zulu via https://github.com/gradle/foojay-toolchains and specifying "Zulu" as the vendor. |
15db26d
to
cf01a87
Compare
cf01a87
to
1d8f00d
Compare
https://jakewharton.com/build-on-latest-java-test-through-lowest-java/