11import Settings ._
22import 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
1415lazy 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
2123val 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 : _* )
0 commit comments