Skip to content

Commit

Permalink
Merge pull request #321 from lrytz/no-osgi
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz authored Apr 17, 2020
2 parents 49c4f12 + 0f12e84 commit 7d1f7aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
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")

0 comments on commit 7d1f7aa

Please sign in to comment.