Skip to content

Commit 78c4d97

Browse files
committed
Set minimum JDK version for -release flag to java 17, drop java 8 tests
1 parent f4e6239 commit 78c4d97

File tree

11 files changed

+50
-94
lines changed

11 files changed

+50
-94
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ jobs:
200200
)"
201201

202202
steps:
203-
######################################################################################
204-
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
205-
######################################################################################
206-
- name: Set JDK 8 as default
207-
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
203+
##############################################################################################
204+
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ##
205+
##############################################################################################
206+
- name: Set JDK 17 as default
207+
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
208208
- name: Reset existing repo
209209
run: |
210210
git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -257,11 +257,11 @@ jobs:
257257
)"
258258

259259
steps:
260-
######################################################################################
261-
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
262-
######################################################################################
263-
- name: Set JDK 8 as default
264-
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
260+
##############################################################################################
261+
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ##
262+
##############################################################################################
263+
- name: Set JDK 17 as default
264+
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
265265
- name: Reset existing repo
266266
run: |
267267
git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -314,11 +314,11 @@ jobs:
314314
)"
315315

316316
steps:
317-
######################################################################################
318-
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
319-
######################################################################################
320-
- name: Set JDK 8 as default
321-
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
317+
##############################################################################################
318+
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ##
319+
##############################################################################################
320+
- name: Set JDK 17 as default
321+
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
322322
- name: Reset existing repo
323323
run: |
324324
git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -415,11 +415,11 @@ jobs:
415415
SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }}
416416

417417
steps:
418-
######################################################################################
419-
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
420-
######################################################################################
421-
- name: Set JDK 8 as default
422-
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
418+
##############################################################################################
419+
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ##
420+
##############################################################################################
421+
- name: Set JDK 17 as default
422+
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
423423
- name: Reset existing repo
424424
run: |
425425
git config --global --add safe.directory $GITHUB_WORKSPACE

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ object projects:
127127
s""";set $project/Compile/doc/sources ++= ($project/Compile/doc/dotty.tools.sbtplugin.DottyPlugin.autoImport.tastyFiles).value ;$project/doc"""
128128
).mkString(" ")
129129

130+
private def removeRelease8(projects: String*): String =
131+
projects.map(project =>
132+
s"""set $project/Compile/scalacOptions := ($project/Compile/scalacOptions).value.filterNot(opt => opt == "-release" || opt == "8")"""
133+
).mkString("; ")
134+
130135
private def aggregateDoc(in: String)(projects: String*) =
131136
val tastyFiles =
132137
(in +: projects).map(p => s"($p/Compile/doc/dotty.tools.sbtplugin.DottyPlugin.autoImport.tastyFiles).value").mkString(" ++ ")
@@ -445,7 +450,10 @@ object projects:
445450

446451
lazy val discipline = SbtCommunityProject(
447452
project = "discipline",
448-
sbtTestCommand = "coreJVM/test;coreJS/test",
453+
sbtTestCommand = List(
454+
removeRelease8("core.jvm", "core.js"),
455+
"coreJVM/test;coreJS/test"
456+
).mkString("; "),
449457
sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal",
450458
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
451459
)
@@ -544,7 +552,12 @@ object projects:
544552

545553
lazy val scissLucre = SbtCommunityProject(
546554
project = "Lucre",
547-
sbtTestCommand = "adjunctJVM/test;baseJVM/test;confluentJVM/test;coreJVM/test;dataJVM/test;exprJVM/test;geomJVM/test;lucre-bdb/test;testsJVM/test",
555+
sbtTestCommand =
556+
val subprojects = List("adjunct.jvm", "base.jvm", "confluent.jvm", "core.jvm", "data.jvm", "expr.jvm", "geom.jvm", "bdb", "tests.jvm")
557+
List(
558+
subprojects.map(name => s"""set ($name/Compile/compile/scalacOptions) := ($name/Compile/compile/scalacOptions).value.filterNot(opt => opt == "-release" || opt == "8")"""),
559+
List("adjunctJVM/test;baseJVM/test;confluentJVM/test;coreJVM/test;dataJVM/test;exprJVM/test;geomJVM/test;lucre-bdb/test;testsJVM/test")
560+
).flatten.mkString("; "),
548561
extraSbtArgs = List("-Dde.sciss.lucre.ShortTests=true"),
549562
sbtPublishCommand = "adjunctJVM/publishLocal;baseJVM/publishLocal;confluentJVM/publishLocal;coreJVM/publishLocal;dataJVM/publishLocal;exprJVM/publishLocal;geomJVM/publishLocal;lucre-bdb/publishLocal",
550563
)
@@ -615,7 +628,11 @@ object projects:
615628

616629
lazy val fs2 = SbtCommunityProject(
617630
project = "fs2",
618-
sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+
631+
sbtTestCommand =
632+
List(
633+
removeRelease8("coreJVM", "coreJS"), // io/test currently fails JDK9+
634+
"coreJVM/test; coreJS/test;"
635+
).mkString("; "),
619636
sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal",
620637
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"),
621638
)

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ end CommunityBuildTestB
5858
@Category(Array(classOf[TestCategory]))
5959
class CommunityBuildTestC:
6060
@Test def akka = projects.akka.run()
61-
@Test def betterfiles = projects.betterfiles.run()
61+
// Disabled because `javax.xml.bind` is not available since java 11
62+
// @Test def betterfiles = projects.betterfiles.run()
6263
@Test def cask = projects.cask.run()
6364
// Temporarily disabled until problem discovered in comments to #9449 is fixed
6465
// @Test def dottyCpsAsync = projects.dottyCpsAsync.run()
@@ -75,7 +76,8 @@ class CommunityBuildTestC:
7576
@Test def oslib = projects.oslib.run()
7677
// @Test def oslibWatch = projects.oslibWatch.run()
7778
@Test def parboiled2 = projects.parboiled2.run()
78-
@Test def playJson = projects.playJson.run()
79+
// Disabled because `javax.xml.bind` is not available since java 11
80+
// @Test def playJson = projects.playJson.run()
7981
@Test def pprint = projects.pprint.run()
8082
//@Test def protoquill = projects.protoquill.run()
8183
@Test def requests = projects.requests.run()

compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ object ScalaSettingsProperties:
1010
private lazy val minTargetVersion = classfileVersionMap.keysIterator.min
1111
private lazy val maxTargetVersion = classfileVersionMap.keysIterator.max
1212

13+
private val minReleaseVersion = 17
14+
1315
def supportedTargetVersions: List[String] =
1416
(minTargetVersion to maxTargetVersion).toList.map(_.toString)
1517

1618
def supportedReleaseVersions: List[String] =
17-
if scala.util.Properties.isJavaAtLeast("9") then
18-
val jdkVersion = JDK9Reflectors.runtimeVersionMajor(JDK9Reflectors.runtimeVersion()).intValue()
19-
val maxVersion = Math.min(jdkVersion, maxTargetVersion)
20-
(minTargetVersion to maxVersion).toList.map(_.toString)
21-
else List(minTargetVersion).map(_.toString)
19+
val jdkVersion = JDK9Reflectors.runtimeVersionMajor(JDK9Reflectors.runtimeVersion()).intValue()
20+
val maxVersion = Math.min(jdkVersion, maxTargetVersion)
21+
(minReleaseVersion to maxVersion).toList.map(_.toString)
2222

2323
def supportedScalaReleaseVersions: List[String] =
2424
ScalaRelease.values.toList.map(_.show)

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionRelease11Suite.scala

Lines changed: 0 additions & 32 deletions
This file was deleted.

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionRelease8Suite.scala

Lines changed: 0 additions & 31 deletions
This file was deleted.

sbt-test/sbt-dotty/scaladoc-regressions/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ lazy val i20476 = project
66

77
lazy val i18231 = project
88
.in(file("i18231"))
9-
.settings(scalacOptions += "-release:8")
9+
.settings(scalacOptions += "-release:17")
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)