Skip to content

Commit 9d78708

Browse files
committedOct 17, 2024
Add build support for sbt 2, scala 3.
1 parent 0c486a8 commit 9d78708

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed
 

‎.github/workflows/build-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
java: 17, 11, 8
2121
scala: 2.12.20
2222
cmd: |
23-
sbt ++$MATRIX_SCALA test ^scripted
23+
sbt ++$MATRIX_SCALA test scripted
2424
2525
finish:
2626
name: Finish

‎.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
persist-credentials: false
1919

2020
- name: Check project is formatted
21-
uses: jrouly/scalafmt-native-action@v3
21+
uses: jrouly/scalafmt-native-action@v4
2222
with:
2323
arguments: '--list --mode diff-ref=origin/main'

‎.scalafmt.conf

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ align.tokens."+" = [
2424
]
2525
}
2626
]
27+
fileOverride {
28+
"glob:**/scala-3/**" {
29+
runner.dialect = scala3
30+
}
31+
}

‎build.sbt

+18
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ developers += Developer(
1111
url("https://github.com/playframework")
1212
)
1313

14+
lazy val scala212 = "2.12.20"
15+
lazy val scala3 = "3.3.4"
16+
ThisBuild / crossScalaVersions := Seq(scala212)
17+
1418
libraryDependencies ++= Seq(
1519
"org.webjars" % "webjars-locator-core" % "0.59",
1620
"org.specs2" %% "specs2-core" % "4.20.8" % "test",
@@ -26,3 +30,17 @@ Global / onLoad := (Global / onLoad).value.andThen { s =>
2630
dynverAssertTagVersion.value
2731
s
2832
}
33+
34+
(pluginCrossBuild / sbtVersion) := {
35+
scalaBinaryVersion.value match {
36+
case "2.12" => "1.10.2"
37+
case _ => "2.0.0-M2"
38+
}
39+
}
40+
41+
scalacOptions := {
42+
CrossVersion.partialVersion(scalaVersion.value) match {
43+
case Some((2, major)) => Seq("-Xsource:3")
44+
case _ => Seq.empty
45+
}
46+
}

0 commit comments

Comments
 (0)
Please sign in to comment.