Skip to content

Commit 5401ecd

Browse files
committed
add Scala 3 to crossbuild
fixes #200
1 parent 402adbf commit 5401ecd

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import: scala/scala-dev:travis/default.yml
55
language: scala
66

77
scala:
8+
- 3.0.0-RC1
89
- 2.11.12
910
- 2.12.13
1011
- 2.13.5

build.sbt

+19-10
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ lazy val commonSettings = Seq(
2727
Compile / unmanagedSourceDirectories ++= {
2828
(Compile / unmanagedSourceDirectories).value.flatMap { dir =>
2929
CrossVersion.partialVersion(scalaVersion.value) match {
30-
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
3130
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
32-
case _ => Seq(file(dir.getPath ++ "-2.13-"))
31+
case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
32+
case _ => Seq(file(dir.getPath ++ "-2.13+"))
3333
}
3434
}
3535
},
3636

3737
Test / unmanagedSourceDirectories ++= {
3838
(Test / unmanagedSourceDirectories).value.flatMap { dir =>
3939
CrossVersion.partialVersion(scalaVersion.value) match {
40-
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
4140
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
42-
case _ => Seq(file(dir.getPath ++ "-2.13-"))
41+
case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
42+
case _ => Seq(file(dir.getPath ++ "-2.13+"))
4343
}
4444
}
4545
},
@@ -48,6 +48,8 @@ lazy val commonSettings = Seq(
4848
lazy val fnGen = (project in file("fnGen"))
4949
.settings(commonSettings)
5050
.settings(
51+
crossScalaVersions := Seq("2.12.13"),
52+
scalaVersion := crossScalaVersions.value.head,
5153
run / fork := true, // Needed if you run this project directly
5254
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
5355
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
@@ -73,10 +75,11 @@ lazy val scalaJava8Compat = (project in file("."))
7375

7476
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
7577

76-
// we're still in 0.x land so we could choose to break bincompat,
77-
// but let's at least be aware when we're doing it. also we should
78-
// think about going 1.0, it's been a while
79-
scalaModuleMimaPreviousVersion := Some("0.9.1"),
78+
scalaModuleMimaPreviousVersion := {
79+
// pending resolution of https://github.com/scalacenter/sbt-version-policy/issues/62
80+
if (isDotty.value) None
81+
else Some("0.9.1")
82+
},
8083

8184
mimaBinaryIssueFilters ++= {
8285
import com.typesafe.tools.mima.core._, ProblemFilters._
@@ -146,8 +149,14 @@ lazy val scalaJava8Compat = (project in file("."))
146149
},
147150
JavaDoc / javacOptions := Seq("-Xdoclint:none"),
148151
JavaDoc / packageDoc / artifactName := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
149-
libraryDependencies += compilerPlugin("com.typesafe.genjavadoc" % "genjavadoc-plugin" % "0.16" cross CrossVersion.full),
150-
Compile / scalacOptions += "-P:genjavadoc:out=" + (target.value / "java")
152+
libraryDependencies ++= (
153+
if (isDotty.value) Seq()
154+
else Seq(compilerPlugin("com.typesafe.genjavadoc" % "genjavadoc-plugin" % "0.16" cross CrossVersion.full))
155+
),
156+
Compile / scalacOptions ++= (
157+
if (isDotty.value) Seq()
158+
else Seq(s"""-P:genjavadoc:out=${target.value / "java"}""")
159+
),
151160
)
152161
}
153162
)

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.4")
22
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "1.0.0-RC5")
3+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.3")

0 commit comments

Comments
 (0)