Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ lazy val commonSettings = Seq(
lazy val root = project
.in(file("."))
.settings(commonSettings)
.settings(name := "scala-collection-compat")
.settings(dontPublish)
.aggregate(
compat211JVM,
Expand Down Expand Up @@ -50,22 +51,10 @@ lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.11"
lazy val scala213 = "2.13.1"

/** Create an OSGi version range for standard Scala versioning
* schemes that describes binary compatible versions. */
def osgiVersionRange(version: String, requireMicro: Boolean = false): String =
if (version contains '-') "${@}" // M, RC or SNAPSHOT -> exact version
else if (requireMicro) "${range;[===,=+)}" // At least the same micro version
else "${range;[==,=+)}" // Any binary compatible version

/** Create an OSGi Import-Package version specification. */
def osgiImport(pattern: String, version: String, requireMicro: Boolean = false): String =
pattern + ";version=\"" + osgiVersionRange(version, requireMicro) + "\""

lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform)(
"compat",
_.settings(scalaModuleSettings)
.settings(commonSettings)
.jvmSettings(scalaModuleSettingsJVM)
.settings(
name := "scala-collection-compat",
moduleName := "scala-collection-compat",
Expand All @@ -78,15 +67,6 @@ lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform
Test / sourceDirectories += (ThisBuild / baseDirectory).value / "compat/src/test/scala-jvm"
)
.jvmSettings(
OsgiKeys.exportPackage := {
if (scalaVersion.value.startsWith("2.13."))
Seq(s"scala.collection.compat.*;version=${version.value}")
else
Seq(
s"scala.collection.compat.*;version=${version.value},scala.jdk.*;version=${version.value}")
},
OsgiKeys.importPackage := Seq(osgiImport("*", scalaBinaryVersion.value)),
OsgiKeys.privatePackage := Nil,
junit
)
.jsSettings(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJ
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % crossVer)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % crossVer)
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.1.4")
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.11")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")