Skip to content

Commit cb76a73

Browse files
committed
Update scala-module-plugin, use scalaVersionsByJvm
- Update scala-module-plugin to 1.0.6 - Use scalaVersionsByJvm to set crossScalaVersions and scalaVersion - Based on scala/scala-swing#60 - Motivated by scala/sbt-scala-module#18
1 parent 17164b4 commit cb76a73

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

build.sbt

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import com.typesafe.tools.mima.plugin.{MimaPlugin, MimaKeys}
22

3-
scalaVersion in ThisBuild := crossScalaVersions.value.head
4-
crossScalaVersions in ThisBuild := {
5-
val java = System.getProperty("java.version")
6-
if (java.startsWith("1.6.") || java.startsWith("1.7."))
7-
Seq("2.11.8")
8-
else if (java.startsWith("1.8.") || java.startsWith("1.9."))
9-
Seq("2.12.1")
10-
else
11-
sys.error(s"don't know what Scala versions to build on $java")
12-
}
13-
143
lazy val root = project.in(file("."))
154
.aggregate(xmlJS, xmlJVM)
165
.settings(publish := {}, publishLocal := {})
@@ -25,6 +14,19 @@ lazy val xml = crossProject.in(file("."))
2514
scalaModuleSettings ++
2615
scalaModuleOsgiSettings ++
2716
List(
17+
scalaVersionsByJvm := {
18+
val v213 = "2.13.0-M1"
19+
val v212 = "2.12.2"
20+
val v211 = "2.11.11"
21+
val vs = List(v213, v212, v211)
22+
// Map[JvmMajorVersion, List[(ScalaVersion, UseForPublishing)]]
23+
Map(
24+
6 -> List(v213 -> false, v212 -> false, v211 -> true),
25+
7 -> vs.map(_ -> false),
26+
8 -> List(v213 -> true, v212 -> true, v211 -> false),
27+
9 -> vs.map(_ -> false)
28+
)
29+
},
2830
OsgiKeys.exportPackage := Seq(s"scala.xml.*;version=${version.value}"),
2931
libraryDependencies += "junit" % "junit" % "4.11" % "test",
3032
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test",

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.4")
1+
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.6")
22

33
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")

0 commit comments

Comments
 (0)