Skip to content
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

Drop Java 8 #488

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ concurrency:
jobs:
check-code-style:
name: Code Style
uses: playframework/.github/.github/workflows/cmd.yml@v2
uses: playframework/.github/.github/workflows/cmd.yml@v3
with:
cmd: sbt validateCode

check-binary-compatibility:
name: Binary Compatibility
uses: playframework/.github/.github/workflows/binary-check.yml@v2
uses: playframework/.github/.github/workflows/binary-check.yml@v3

check-docs:
name: Docs
uses: playframework/.github/.github/workflows/cmd.yml@v2
uses: playframework/.github/.github/workflows/cmd.yml@v3
with:
java: 11, 8
java: 17, 11
scala: 2.11.x, 2.12.x, 2.13.x # TODO: 3.x (other play modules not ok)
cmd: sbt ++$MATRIX_SCALA docs/test

Expand All @@ -37,9 +37,9 @@ jobs:
- "check-code-style"
- "check-binary-compatibility"
- "check-docs"
uses: playframework/.github/.github/workflows/cmd.yml@v2
uses: playframework/.github/.github/workflows/cmd.yml@v3
with:
java: 11, 8
java: 17, 11
scala: 2.11.x, 2.12.x, 2.13.x, 3.x
cmd: sbt ++$MATRIX_SCALA publishLocal test

Expand All @@ -48,4 +48,4 @@ jobs:
if: github.event_name == 'pull_request'
needs: # Should be last
- "tests"
uses: playframework/.github/.github/workflows/rtm.yml@v2
uses: playframework/.github/.github/workflows/rtm.yml@v3
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ on:
jobs:
publish-artifacts:
name: Publish / Artifacts
uses: playframework/.github/.github/workflows/publish.yml@v2
uses: playframework/.github/.github/workflows/publish.yml@v3
secrets: inherit
1 change: 0 additions & 1 deletion .jvmopts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-Xss2M
-XX:+CMSClassUnloadingEnabled
-XX:ReservedCodeCacheSize=192m
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ lazy val docs = project
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-jdbc" % playVer.value % Test,
"com.typesafe.play" %% "play-specs2" % playVer.value % Test,
"com.h2database" % "h2" % "1.4.199"
"com.google.inject" % "guice" % "5.1.0" % Test, // TODO: Remove when depending on play-jdbc/-specs2 2.8.x+
Copy link
Member Author

Choose a reason for hiding this comment

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

playVer is 2.6.14.... So need to pull in newer Guice version that works with Java 17... It's only in test scope however. But I think this needs more refactoring...

"com.h2database" % "h2" % "1.4.199"
)
)
.dependsOn(`anorm-core`)
Expand Down
9 changes: 8 additions & 1 deletion project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ object Common extends AutoPlugin {
scalacOptions ++= Seq("-Xfatal-warnings"),
scalacOptions ++= {
if (scalaBinaryVersion.value != "3") {
Seq("-target:jvm-1.8", "-Xlint", "-g:vars")
Seq("-Xlint", "-g:vars")
} else {
Seq.empty
}
},
scalacOptions ++= {
if (scalaBinaryVersion.value != "2.11") {
Seq("-release", "11")
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of -target we should use -release, which however is not availabe in Scala 2.11. Bad news is in Scala 2.11 we can not set -target to Java 11:

$ scalac -version
Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

$ scalac -help
...
-target:<target>   Target platform for object files. All JVM 1.5 targets are deprecated. (jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8) default:jvm-1.6

So... if we drop Java 8 for anorm... we might also should think about dropping Scala 2.11? The last release was cut 5 years ago...

Copy link
Member Author

Choose a reason for hiding this comment

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

To be honest I would even drop Scala 2.12... build.sbt does lot of conditional stuff to make everyhing work. I think it's time to move on for people. Scala 2.13 has been out for a long time already and it just gets harder and harder to support older Scala and Java releases...

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW: I do not se a reason to not set release for Scala 3, should be totally fine.

} else {
Seq.empty
}
Expand Down