Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

Commit 83008b5

Browse files
committed
Merge pull request #2 from adriaanm/osgi
Fix osgi madness
2 parents 0e3eb35 + 4e447be commit 83008b5

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

build.sbt

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Settings._
22
import Keys.{`package` => packageTask }
3+
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
34

45
// plugin logic of build based on https://github.com/retronym/boxer
56

@@ -13,15 +14,16 @@ lazy val commonSettings = scalaModuleSettings ++ Seq(
1314

1415
lazy val root = project.in( file(".") ).settings( publishArtifact := false ).aggregate(plugin, library).settings(commonSettings : _*)
1516

16-
lazy val plugin = project settings (
17-
name := "scala-continuations-plugin",
18-
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
17+
lazy val plugin = project settings (SbtOsgi.osgiSettings: _*) settings (
18+
name := "scala-continuations-plugin",
19+
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
20+
OsgiKeys.exportPackage := Seq(s"scala.tools.selectivecps;version=${version.value}")
1921
) settings (commonSettings : _*)
2022

2123
val pluginJar = packageTask in (plugin, Compile)
2224

2325
// TODO: the library project's test are really plugin tests, but we first need that jar
24-
lazy val library = project settings (
26+
lazy val library = project settings (SbtOsgi.osgiSettings: _*) settings (
2527
name := "scala-continuations-library",
2628
scalacOptions ++= Seq(
2729
// add the plugin to the compiler
@@ -38,5 +40,6 @@ lazy val library = project settings (
3840
testOptions += Tests.Argument(
3941
TestFrameworks.JUnit,
4042
s"-Dscala-continuations-plugin.jar=${pluginJar.value.getAbsolutePath}"
41-
)
43+
),
44+
OsgiKeys.exportPackage := Seq(s"scala.util.continuations;version=${version.value}")
4245
) settings (commonSettings : _*)

project/ContinuationsBuild.scala

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object Settings {
1414

1515
val osgiVersion = version(_.replace('-', '.'))
1616

17-
lazy val scalaModuleSettings = SbtOsgi.osgiSettings ++ Seq(
17+
lazy val scalaModuleSettings = Seq(
1818
repoName := name.value,
1919

2020
scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value),
@@ -37,10 +37,6 @@ object Settings {
3737
Seq(file)
3838
},
3939

40-
mappings in (Compile, packageBin) += {
41-
(baseDirectory.value / s"${name.value}.properties") -> s"${name.value}.properties"
42-
},
43-
4440

4541
// maven publishing
4642
publishTo := {
@@ -91,7 +87,6 @@ object Settings {
9187

9288
OsgiKeys.bundleSymbolicName := s"${organization.value}.${name.value}",
9389
OsgiKeys.bundleVersion := osgiVersion.value,
94-
OsgiKeys.exportPackage := Seq(s"*;version=${version.value}"),
9590
// Sources should also have a nice MANIFEST file
9691
packageOptions in packageSrc := Seq(
9792
Package.ManifestAttributes(

0 commit comments

Comments
 (0)