Skip to content

Do not run tests with Java 8 anymore#11435

Merged
mkurz merged 13 commits into
playframework:mainfrom
mkurz:no_more_java8_tests
Sep 27, 2022
Merged

Do not run tests with Java 8 anymore#11435
mkurz merged 13 commits into
playframework:mainfrom
mkurz:no_more_java8_tests

Conversation

@mkurz

@mkurz mkurz commented Sep 21, 2022

Copy link
Copy Markdown
Member

Java 17 will be added in a different PR.
This is just so we can finally upgrade many dependencies that now require Java 11+

Comment thread documentation/build.sbt
},
"--release",
"11",
),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --release flag replaces the -source, -target and -bootclasspath flags. See https://stackoverflow.com/a/43103038/810109


val isJdk11orHigher: Boolean =
VersionNumber(specificationVersion).matchesSemVer(SemanticSelector(">=11"))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need anymore for these methods (they were unused anyway)

}
Seq("-source", "8", "-target", "8", "-bootclasspath", s"$javaHome/jre/lib/rt.jar")
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, sourceAndTarget is not need anymore now.

.settings(omnidocSettings: _*)
.settings(
scalacOptions += "-target:jvm-1.8"
scalacOptions += "-release:11"

@mkurz mkurz Sep 22, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should use release here instead of target (release was only available with Java 9).
Also, good thing is -release got fixed in Scala 2.13.9 and now works the same way like in Scala 3 (where it is an alias for -java-output-version) Also, it's recommended to use it instead of target by scala devs. Makes sense for me.

@mkurz mkurz linked an issue Sep 22, 2022 that may be closed by this pull request
@mkurz

mkurz commented Sep 26, 2022

Copy link
Copy Markdown
Member Author

Blocked by etorreborre/specs2#1103

@mkurz mkurz force-pushed the no_more_java8_tests branch from 07192f4 to 8412471 Compare September 26, 2022 19:36
@mkurz mkurz force-pushed the no_more_java8_tests branch 3 times, most recently from e5c5285 to c0d35b0 Compare September 27, 2022 09:49
@mkurz mkurz force-pushed the no_more_java8_tests branch from a1982eb to ddf6041 Compare September 27, 2022 12:36
This is a workaround until a new sbt version gets released
that finally comes with Scala 2.12.17
@mkurz mkurz force-pushed the no_more_java8_tests branch from ddf6041 to 7d48e8d Compare September 27, 2022 13:14
@mkurz

mkurz commented Sep 27, 2022

Copy link
Copy Markdown
Member Author

Finally, after going through scala-xml dependency hell.
There are a couple of workarounds I need to remove when sbt 1.8 comes out. I will craete create a draft PR this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop support for Java 8

2 participants