Skip to content

Commit 3c9357b

Browse files
committed
Cross-build for scala 2.12 and 2.13 from a single build.sbt and source tree
1 parent 496415b commit 3c9357b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

build.sbt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@ name := "Slacken"
22

33
version := "2.0.0"
44

5-
scalaVersion := "2.12.20"
5+
lazy val scala212 = "2.12.20"
6+
7+
lazy val scala213 = "2.13.15"
8+
9+
lazy val supportedScalaVersions = List(scala212, scala213)
10+
11+
ThisBuild / scalaVersion := scala212
12+
13+
lazy val root = (project in file(".")).
14+
settings(
15+
crossScalaVersions := supportedScalaVersions,
16+
libraryDependencies ++= {
17+
CrossVersion.partialVersion(scalaVersion.value) match {
18+
case Some((2, 13)) => List("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.0")
19+
case _ => Nil
20+
}
21+
}
22+
)
623

724
val sparkVersion = "3.5.0"
825

0 commit comments

Comments
 (0)