From 77d069617c0a67e9baddc0acf3db3fdebe171717 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Tue, 15 Sep 2026 10:55:29 +0200 Subject: [PATCH 1/2] Build Scala 3 artifacts with 3.3 and test newer versions --- .github/workflows/build-test.yml | 5 +++-- build.sbt | 9 +++++++-- project/Dependencies.scala | 23 +++++++++++++++++++++++ project/plugins.sbt | 4 +++- 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 project/Dependencies.scala diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a97649b..a1ab68d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -26,8 +26,9 @@ jobs: uses: playframework/.github/.github/workflows/cmd.yml@v4 with: java: 21, 17 - scala: 2.12.x, 2.13.x, 3.x - cmd: sbt "++$MATRIX_SCALA ; test" + # Symbolic lanes resolve to exact versions in project/Dependencies.scala. + scala: 2.12.x, 2.13.x, 3.3.x, 3.9.x, 3.next + cmd: sbt -Dscala.version=$MATRIX_SCALA testFull finish: name: Finish diff --git a/build.sbt b/build.sbt index 237c3ca..763e581 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,10 @@ import sbtheader.HeaderPlugin.autoImport.HeaderPattern.commentBetween import sbtheader.CommentStyle import sbtheader.FileType import sbtheader.LineCommentCreator +import Dependencies._ + +ThisBuild / resolvers += Resolver.sonatypeCentralSnapshots + // Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed (ThisBuild / dynverVTagPrefix) := false @@ -22,7 +26,8 @@ lazy val `play-doc` = (project in file(".")) organizationHomepage := Some(uri("https://playframework.com")), homepage := Some(uri(s"https://github.com/playframework/${Omnidoc.repoName}")), licenses := Seq("Apache-2.0" -> uri("https://www.apache.org/licenses/LICENSE-2.0.html")), - crossScalaVersions := Seq("2.12.21", "2.13.18", "3.9.0"), + scalaVersion := resolveScalaVersion(sys.props.getOrElse("scala.version", scala213Version)), + crossScalaVersions := publishedScalaVersions, exportJars := false, developers += Developer( "playframework", @@ -90,7 +95,7 @@ scalacOptions ++= Seq( "-unchecked", "-encoding", "utf8" -) +) ++ (if (scalaVersion.value.startsWith("3.3.")) Seq("-Yfuture-lazy-vals") else Seq.empty) addCommandAlias( "validateCode", diff --git a/project/Dependencies.scala b/project/Dependencies.scala new file mode 100644 index 0000000..6e87d62 --- /dev/null +++ b/project/Dependencies.scala @@ -0,0 +1,23 @@ +/* + * Copyright (C) from 2022 The Play Framework Contributors , 2011-2021 Lightbend Inc. + */ + +object Dependencies { + val scala212Version = "2.12.21" + val scala213Version = "2.13.18" + val scala3Version = "3.3.8" + val scala39LTSVersion = "3.9.0" + val scala3NextVersion = "3.10.0-RC2" + + val publishedScalaVersions = Seq(scala212Version, scala213Version, scala3Version) + + private val scalaVersionAliases = Map( + "2.12.x" -> scala212Version, + "2.13.x" -> scala213Version, + "3.3.x" -> scala3Version, + "3.9.x" -> scala39LTSVersion, + "3.next" -> scala3NextVersion, + ) + + def resolveScalaVersion(version: String): String = scalaVersionAliases.getOrElse(version, version) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 54edfd5..0d5af0b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,8 @@ // Copyright (C) from 2022 The Play Framework Contributors , 2011-2021 Lightbend Inc. -addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.1.0-M9") +resolvers += Resolver.sonatypeCentralSnapshots + +addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.1.0-M9+123-dae60cad-SNAPSHOT") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.2") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.12.1") addSbtPlugin("com.github.sbt" % "sbt-header" % "5.11.0") From 8930afdd5d1c46dbc8cbf84c6af55a9b1e995534 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 18 Sep 2026 12:07:07 +0200 Subject: [PATCH 2/2] Use sbt nightly --- .github/workflows/build-test.yml | 6 +++--- .github/workflows/publish.yml | 2 +- project/build.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a1ab68d..d620755 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ concurrency: jobs: check-code-style: name: Code Style - uses: playframework/.github/.github/workflows/cmd.yml@v4 + uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org with: cmd: sbt validateCode @@ -23,7 +23,7 @@ jobs: name: Tests needs: - "check-code-style" - uses: playframework/.github/.github/workflows/cmd.yml@v4 + uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org with: java: 21, 17 # Symbolic lanes resolve to exact versions in project/Dependencies.scala. @@ -35,4 +35,4 @@ jobs: if: github.event_name == 'pull_request' needs: # Should be last - "tests" - uses: playframework/.github/.github/workflows/rtm.yml@v4 + uses: playframework/.github/.github/workflows/rtm.yml@unblock-repo_scala_sbt_org diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ded11b2..2891ae5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,5 +9,5 @@ on: jobs: publish-artifacts: name: Publish / Artifacts - uses: playframework/.github/.github/workflows/publish.yml@v4 + uses: playframework/.github/.github/workflows/publish.yml@unblock-repo_scala_sbt_org secrets: inherit diff --git a/project/build.properties b/project/build.properties index d75cc0e..a31b922 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,3 +1,3 @@ # Copyright (C) from 2022 The Play Framework Contributors , 2011-2021 Lightbend Inc. -sbt.version=2.0.8 +sbt.version=2.1.0-bin-20260918-2ef94e0-NIGHTLY