From 11b9af503aa17c710664e88491eb82b10d249ac0 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Mon, 21 May 2012 11:51:08 +0200 Subject: [PATCH] closes #16: Publish as OSGi bundle --- project/Build.scala | 11 ++++++++++- project/plugins.sbt | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index bdc3fbfa..cb6dec64 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,5 +1,6 @@ import sbt._ import Keys._ +import com.typesafe.sbtosgi.OsgiPlugin._ object ConfigBuild extends Build { val unpublished = Seq( @@ -29,7 +30,15 @@ object ConfigBuild extends Build { lazy val configLib = Project(id = "config", base = file("config"), - settings = Project.defaultSettings ++ sonatype.settings) dependsOn(testLib % "test->test") + settings = + Project.defaultSettings ++ + sonatype.settings ++ + osgiSettings ++ + Seq( + OsgiKeys.exportPackage := Seq("com.typesafe.config"), + packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap, + artifact in (Compile, packageBin) ~= { _.copy(`type` = "bundle") } + )) dependsOn(testLib % "test->test") lazy val testLib = Project(id = "test-lib", base = file("test-lib"), diff --git a/project/plugins.sbt b/project/plugins.sbt index fa5a7dae..3c5f8d93 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -9,3 +9,5 @@ addSbtPlugin("de.johoop" % "jacoco4sbt" % "1.2.2") resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns) addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6") + +addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.2.0")