Skip to content

Commit 14d1209

Browse files
committed
chore: 🤖 Cross compile for Scala 3.0.0-RC1
1 parent 9ef32e3 commit 14d1209

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

‎build.sbt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ThisBuild / homepage := Some(
3333
val scala211 = "2.11.12"
3434
val scala212 = "2.12.13"
3535
val scala213 = "2.13.5"
36+
val scala3 = "3.0.0-RC1"
3637

3738
scalaVersion := scala213
3839

@@ -52,6 +53,7 @@ lazy val commonSettings = Seq(
5253
case Some((2, 11)) => ScalacOptions.scalacOptions211
5354
case Some((2, 12)) => ScalacOptions.scalacOptions212
5455
case Some((2, 13)) => ScalacOptions.scalacOptions213
56+
case Some((3, 0)) => ScalacOptions.scalacOptions3
5557
case _ => Seq()
5658
}
5759
}
@@ -75,10 +77,12 @@ lazy val cucumberScala = (projectMatrix in file("cucumber-scala"))
7577
libraryDependencies ++= Seq(
7678
"io.cucumber" % "cucumber-core" % cucumberVersion,
7779
// Users have to provide it (for JacksonDefaultDataTableTransformer)
78-
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion % Provided,
80+
("com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion % Provided)
81+
.withDottyCompat(scalaVersion.value),
7982
"junit" % "junit" % junitVersion % Test,
8083
"io.cucumber" % "cucumber-junit" % cucumberVersion % Test,
81-
"org.mockito" %% "mockito-scala" % mockitoScalaVersion % Test
84+
("org.mockito" %% "mockito-scala" % mockitoScalaVersion % Test)
85+
.withDottyCompat(scalaVersion.value)
8286
),
8387
libraryDependencies ++= {
8488
CrossVersion.partialVersion(scalaVersion.value) match {
@@ -102,7 +106,7 @@ lazy val cucumberScala = (projectMatrix in file("cucumber-scala"))
102106
Seq(file)
103107
}.taskValue
104108
)
105-
.jvmPlatform(scalaVersions = Seq(scala213, scala212, scala211))
109+
.jvmPlatform(scalaVersions = Seq(scala3, scala213, scala212, scala211))
106110

107111
// Examples project
108112
lazy val examples = (projectMatrix in file("examples"))
@@ -116,7 +120,7 @@ lazy val examples = (projectMatrix in file("examples"))
116120
publishArtifact := false
117121
)
118122
.dependsOn(cucumberScala % Test)
119-
.jvmPlatform(scalaVersions = Seq(scala213, scala212))
123+
.jvmPlatform(scalaVersions = Seq(scala3, scala213, scala212))
120124

121125
// Version policy check
122126

‎project/ScalacOptions.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
object ScalacOptions {
22

3+
val scalacOptions3 = Seq(
4+
"-source:3.0",
5+
"-deprecation", // Emit warning and location for usages of deprecated APIs.
6+
"-explain", // Explain type errors in more detail.
7+
// "-explaintypes", // Explain type errors in more detail.
8+
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
9+
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
10+
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
11+
"-language:higherKinds", // Allow higher-kinded types
12+
"-language:implicitConversions", // Allow definition of implicit functions called views
13+
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
14+
"-Xfatal-warnings" // Fail the compilation if there are any warnings.
15+
)
16+
317
// Source: https://nathankleyn.com/2019/05/13/recommended-scalac-flags-for-2-13/
418
val scalacOptions213 = Seq(
519
"-deprecation", // Emit warning and location for usages of deprecated APIs.

‎project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Cross compilation matrix
22
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.7.0")
33

4+
// Scala 3 (Dotty)
5+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.3")
6+
47
// Scalafmt (formatter)
58
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
69

0 commit comments

Comments
 (0)