This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Rename according to Typesafe sbt conventions

  • Loading branch information...
Heiko Seeberger
Heiko Seeberger committed Oct 22, 2012
1 parent 4173043 commit b5c2110fb7cecd8d88686eded457ebc7ceb3ecf9
Showing with 75 additions and 94 deletions.
  1. +9 −9 README.rst
  2. +5 −5 build.sbt
  3. +0 −5 notes/0.1.0.markdown
  4. +0 −9 notes/0.2.0.markdown
  5. +0 −1 notes/about.markdown
  6. +2 −5 project/plugins.sbt
  7. 0 src/main/scala/com/typesafe/{sbtosgi → sbt/osgi}/OsgiExecutionEnvironment.scala
  8. +1 −1 src/main/scala/com/typesafe/{sbtosgi → sbt/osgi}/OsgiKeys.scala
  9. +1 −1 src/main/scala/com/typesafe/{sbtosgi → sbt/osgi}/OsgiManifestHeaders.scala
  10. +4 −6 src/main/scala/com/typesafe/{sbtosgi/OsgiPlugin.scala → sbt/osgi/SbtOsgi.scala}
  11. +5 −5 src/main/scala/com/typesafe/{sbtosgi → sbt/osgi}/package.scala
  12. +6 −6 src/sbt-test/{sbtosgi → sbt-osgi}/00-defaults/build.sbt
  13. +2 −0 src/sbt-test/sbt-osgi/00-defaults/project/plugins.sbt
  14. +1 −1 src/sbt-test/{sbtosgi → sbt-osgi}/00-defaults/test
  15. +12 −12 src/sbt-test/{sbtosgi → sbt-osgi}/01-contents/build.sbt
  16. +2 −0 src/sbt-test/sbt-osgi/01-contents/project/plugins.sbt
  17. +3 −0 src/sbt-test/sbt-osgi/01-contents/src/main/scala/com/typesafe/sbt/osgi/test/Foo.scala
  18. +2 −1 ...btosgi → sbt-osgi/01-contents/src/main/scala/com/typesafe/sbt/osgi}/test/internal/Activator.scala
  19. 0 src/sbt-test/{sbtosgi → sbt-osgi}/01-contents/test
  20. +6 −6 src/sbt-test/{sbtosgi → sbt-osgi}/02-includeresource/build.sbt
  21. +2 −0 src/sbt-test/sbt-osgi/02-includeresource/project/plugins.sbt
  22. 0 src/sbt-test/{sbtosgi → sbt-osgi}/02-includeresource/src/main/resources/foo.properties
  23. +3 −0 src/sbt-test/sbt-osgi/02-includeresource/src/main/scala/com/typesafe/sbt/osgi/test/Foo.scala
  24. +1 −1 ...→ sbt-osgi/02-includeresource/src/main/scala/com/typesafe/sbt/osgi}/test/internal/Activator.scala
  25. 0 src/sbt-test/{sbtosgi → sbt-osgi}/02-includeresource/test
  26. +5 −5 src/sbt-test/{sbtosgi → sbt-osgi}/03-arbitraryHeaders/build.sbt
  27. +2 −0 src/sbt-test/sbt-osgi/03-arbitraryHeaders/project/plugins.sbt
  28. 0 src/sbt-test/{sbtosgi → sbt-osgi}/03-arbitraryHeaders/test
  29. +0 −2 src/sbt-test/sbtosgi/00-defaults/project/plugins.sbt
  30. +0 −2 src/sbt-test/sbtosgi/01-contents/project/plugins.sbt
  31. +0 −3 src/sbt-test/sbtosgi/01-contents/src/main/scala/com/typesafe/sbtosgi/test/Foo.scala
  32. +0 −2 src/sbt-test/sbtosgi/02-includeresource/project/plugins.sbt
  33. +0 −3 src/sbt-test/sbtosgi/02-includeresource/src/main/scala/com/typesafe/sbtosgi/test/Foo.scala
  34. +0 −2 src/sbt-test/sbtosgi/03-arbitraryHeaders/project/plugins.sbt
  35. +1 −1 src/test/scala/com/typesafe/{sbtosgi → sbt/osgi}/packageSpec.scala
View
@@ -1,24 +1,24 @@
-sbtosgi
-=======
+sbt-osgi
+========
Plugin for `sbt`_ to create `OSGi`_ bundles.
-Installing sbtosgi
-------------------
+Installing sbt-osgi
+-------------------
Just add the following line to your plugin definition (*plugins.sbt* file in the *project/* folder of your project or *plugins.sbt* file in the *~/.sbt/plugins/* directory, for details about plugins see the `sbt documentation`_), paying attention to the blank line between settings::
- addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0")
+ addSbtPlugin("com.typesafe.sbt-osgi" % "sbt-osgi" % "0.4.0")
If you want to use the latest and greates features, you can also give the latest snapshot release a try::
resolvers += Classpaths.typesafeSnapshots
- addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.4.0-SNAPSHOT")
+ addSbtPlugin("com.typesafe.sbt-osgi" % "sbt-osgi" % "0.5.0-SNAPSHOT")
-Adding sbtosgi settings
+Adding sbt-osgi settings
-----------------------
Add the below line to your build definition, which will add the task *osgi-bundle* and also publish an OSGi bundle instead of a raw JAR archive. Again, pay attention to the blank line between settings::
@@ -37,7 +37,7 @@ Notice that automatically publishing an OSGi bundle and *defaultOsgiSettings* ar
-Configuring sbtosgi
+Configuring sbt-osgi
-------------------
This plugin comes with the following configuration options, available as sbt settings:
@@ -57,7 +57,7 @@ This plugin comes with the following configuration options, available as sbt set
Mailing list
------------
-Please use the `sbt mailing list`_ and prefix the subject with "[sbtosgi]".
+Please use the `sbt mailing list`_ and prefix the subject with "[sbt-osgi]".
Contribution policy
View
@@ -1,21 +1,21 @@
-organization := "com.typesafe.sbtosgi"
+organization := "com.typesafe.sbt.osgi"
-name := "sbtosgi"
+name := "sbt-osgi"
-// version is defined in 0.2.0-SNAPSHOT in order to support sbt-release
+// version is defined in version.sbt in order to support sbt-release
sbtPlugin := true
libraryDependencies ++= Seq(
"biz.aQute" % "bndlib" % "1.50.0",
- "org.specs2" %% "specs2" % "1.11" % "test",
+ "org.specs2" %% "specs2" % "1.12.2" % "test",
"junit" % "junit" % "4.7" % "test"
)
scalacOptions ++= Seq("-unchecked", "-deprecation")
-publishTo <<= isSnapshot(if (_) Some(Classpaths.typesafeSnapshots) else Some(Classpaths.typesafeReleases))
+publishTo <<= isSnapshot(if (_) Some(Classpaths.sbtPluginSnapshots) else Some(Classpaths.sbtPluginReleases))
publishMavenStyle := false
View
@@ -1,5 +0,0 @@
-This is the first (pre-)release of [sbtosgi](https://github.com/typesafehub/sbtosgi), an [sbt](https://github.com/harrah/xsbt/) plugin for creating [OSGi](http://www.osgi.org) bundles.
-
-sbtosgi is inspired by [bnd4sbt](https://github.com/weiglewilczek/bnd4sbt) and makes use of the awesome [bnd library](http://www.aqute.biz/Bnd/Bnd). sbtosgi requires sbt 0.11.2.
-
-For installation and usage instructinos, please refer to the [sbtosgi README](https://github.com/typesafehub/sbtosgi).
View
@@ -1,9 +0,0 @@
-This is the 0.2 (pre-)release of [sbtosgi](https://github.com/typesafehub/sbtosgi), an [sbt](https://github.com/harrah/xsbt/) plugin for creating [OSGi](http://www.osgi.org) bundles.
-
-These are the most important changes between sbteclipse 2.1.0 and 2.0.x:
-
-* [Issue #1](https://github.com/typesafehub/sbtosgi/issues/1): Support for passing arbitrary additional headers to BND
-
-sbtosgi is inspired by [bnd4sbt](https://github.com/weiglewilczek/bnd4sbt) and makes use of the awesome [bnd library](http://www.aqute.biz/Bnd/Bnd). sbtosgi requires sbt 0.11.3.
-
-For installation and usage instructinos, please refer to the [sbtosgi README](https://github.com/typesafehub/sbtosgi).
View
@@ -1 +0,0 @@
-[sbtosgi](https://github.com/typesafehub/sbtosgi) is an [sbt](https://github.com/harrah/xsbt/) plugin for creating [OSGi](http://www.osgi.org) bundles.
View
@@ -1,9 +1,6 @@
-resolvers ++= Seq(
-)
+addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.6")
-addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.5")
-
-addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.5.1")
+addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.0.0")
libraryDependencies <+= (sbtVersion)("org.scala-sbt" % "scripted-plugin" % _)
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.typesafe.sbtosgi
+package com.typesafe.sbt.osgi
import sbt._
import sbt.Keys._
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.typesafe.sbtosgi
+package com.typesafe.sbt.osgi
case class OsgiManifestHeaders(
bundleActivator: Option[String],
@@ -14,16 +14,14 @@
* limitations under the License.
*/
-package com.typesafe.sbtosgi
+package com.typesafe.sbt.osgi
import sbt._
import sbt.Keys._
-object OsgiPlugin extends Plugin {
+object SbtOsgi extends Plugin {
- // val OsgiExecutionEnvironment = com.typesafe.sbtosgi.OsgiExecutionEnvironment
-
- val OsgiKeys = com.typesafe.sbtosgi.OsgiKeys
+ val OsgiKeys = com.typesafe.sbt.osgi.OsgiKeys
def osgiSettings: Seq[Setting[_]] = defaultOsgiSettings ++ Seq(
packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap,
@@ -64,5 +62,5 @@ object OsgiPlugin extends Plugin {
)
}
- type OsgiManifestHeaders = com.typesafe.sbtosgi.OsgiManifestHeaders
+ type OsgiManifestHeaders = com.typesafe.sbt.osgi.OsgiManifestHeaders
}
@@ -14,19 +14,19 @@
* limitations under the License.
*/
-package com.typesafe
+package com.typesafe.sbt
import aQute.lib.osgi.Builder
import java.util.Properties
import sbt._
import sbt.Keys._
-package object sbtosgi {
+package object osgi {
def seqToStrOpt[A](seq: Seq[A])(f: A => String): Option[String] =
if (seq.isEmpty) None else Some(seq map f mkString ",")
- private[sbtosgi] def bundleTask(
+ private[osgi] def bundleTask(
headers: OsgiManifestHeaders,
additionalHeaders: Map[String, String],
fullClasspath: Seq[Attributed[File]],
@@ -61,7 +61,7 @@ package object sbtosgi {
properties
}
- private[sbtosgi] def defaultBundleSymbolicName(organization: String, name: String): String = {
+ private[osgi] def defaultBundleSymbolicName(organization: String, name: String): String = {
val organizationParts = parts(organization)
val nameParts = parts(name)
val partsWithoutOverlap = (organizationParts.lastOption, nameParts.headOption) match {
@@ -71,7 +71,7 @@ package object sbtosgi {
partsWithoutOverlap mkString "."
}
- private[sbtosgi] def id(s: String) = s
+ private[osgi] def id(s: String) = s
private def parts(s: String) = s split "[.-]" filterNot (_.isEmpty)
}
@@ -1,7 +1,7 @@
-organization := "com.typesafe.sbtosgi"
+organization := "com.typesafe.sbt"
-name := "sbtosgi-test"
+name := "sbt-osgi-test"
version := "1.2.3"
@@ -14,8 +14,8 @@ TaskKey[Unit]("verify-bundle-activator") <<= OsgiKeys.bundleActivator map (activ
)
TaskKey[Unit]("verify-bundle-symbolic-name") <<= OsgiKeys.bundleSymbolicName map (name =>
- if (name != "com.typesafe.sbtosgi.test")
- error("Expected bundle-symbolic-name to be %s, but was %s!".format("com.typesafe.sbtosgi.test", name))
+ if (name != "com.typesafe.sbt.osgi.test")
+ error("Expected bundle-symbolic-name to be %s, but was %s!".format("com.typesafe.sbt.osgi.test", name))
)
TaskKey[Unit]("verify-bundle-verion") <<= OsgiKeys.bundleVersion map (version =>
@@ -44,8 +44,8 @@ TaskKey[Unit]("verify-fragment-host") <<= OsgiKeys.fragmentHost map (host =>
)
TaskKey[Unit]("verify-private-package") <<= OsgiKeys.privatePackage map (pkg =>
- if (pkg != Seq("com.typesafe.sbtosgi.test.*"))
- error("Expected private-package to be %s, but was %s!".format(Seq("com.typesafe.sbtosgi.test.*"), pkg))
+ if (pkg != Seq("com.typesafe.sbt.osgi.test.*"))
+ error("Expected private-package to be %s, but was %s!".format(Seq("com.typesafe.sbt.osgi.test.*"), pkg))
)
TaskKey[Unit]("verify-require-bundle") <<= OsgiKeys.requireBundle map (bundle =>
@@ -0,0 +1,2 @@
+
+addSbtPlugin("com.typesafe.sbt.osgi" % "sbt-osgi" % "0.4.0-SNAPSHOT")
@@ -11,4 +11,4 @@
# Existence of JAR file
> osgi-bundle
-$ exists target/scala-2.9.2/sbtosgi-test_2.9.2-1.2.3.jar
+$ exists target/scala-2.9.2/sbt-osgi-test_2.9.2-1.2.3.jar
@@ -1,19 +1,19 @@
-organization := "com.typesafe.sbtosgi"
+organization := "com.typesafe.sbt"
-name := "sbtosgi-test"
+name := "sbt-osgi-test"
version := "1.2.3"
libraryDependencies += "org.osgi" % "org.osgi.core" % "4.3.0" % "provided"
osgiSettings
-OsgiKeys.bundleActivator := Some("com.typesafe.sbtosgi.test.internal.Activator")
+OsgiKeys.bundleActivator := Some("com.typesafe.sbt.osgi.test.internal.Activator")
OsgiKeys.dynamicImportPackage := Seq("scala.*")
-OsgiKeys.exportPackage := Seq("com.typesafe.sbtosgi.test")
+OsgiKeys.exportPackage := Seq("com.typesafe.sbt.osgi.test")
TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
import java.io.IOException
@@ -27,20 +27,20 @@ TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
val lines = Source.fromInputStream(manifestIn).getLines().toList
val allLines = lines mkString newLine
val butWas = newLine + "But was:" + newLine + allLines
- if (!(lines contains "Bundle-Activator: com.typesafe.sbtosgi.test.internal.Activator"))
- error("Expected 'Bundle-Activator: com.typesafe.sbtosgi.test.internal.Activator' in manifest!" + butWas)
- if (!(lines contains "Bundle-SymbolicName: com.typesafe.sbtosgi.test"))
- error("Expected 'Bundle-SymbolicName: com.typesafe.sbtosgi.test' in manifest!" + butWas)
+ if (!(lines contains "Bundle-Activator: com.typesafe.sbt.osgi.test.internal.Activator"))
+ error("Expected 'Bundle-Activator: com.typesafe.sbt.osgi.test.internal.Activator' in manifest!" + butWas)
+ if (!(lines contains "Bundle-SymbolicName: com.typesafe.sbt.osgi.test"))
+ error("Expected 'Bundle-SymbolicName: com.typesafe.sbt.osgi.test' in manifest!" + butWas)
if (!(lines contains "Bundle-Version: 1.2.3"))
error("Expected 'Bundle-Version: 1.2.3' in manifest!" + butWas)
if (!(lines contains "DynamicImport-Package: scala.*"))
error("Expected 'DynamicImport-Package: scala.*' in manifest!" + butWas)
- if (!(lines exists (_ containsSlice "Export-Package: com.typesafe.sbtosgi.test")))
- error("Expected 'Export-Package: com.typesafe.sbtosgi.test' in manifest!" + butWas)
+ if (!(lines exists (_ containsSlice "Export-Package: com.typesafe.sbt.osgi.test")))
+ error("Expected 'Export-Package: com.typesafe.sbt.osgi.test' in manifest!" + butWas)
if (!(lines exists (l => (l containsSlice "org.osgi.framework") && (l containsSlice "Import-Package: "))))
error("""Expected 'Import-Package: ' and 'org.osgi.framework' in manifest!""" + butWas)
- if (!(lines contains "Private-Package: com.typesafe.sbtosgi.test.internal"))
- error("Expected 'Private-Package: com.typesafe.sbtosgi.test.internal' in manifest!" + butWas)
+ if (!(lines contains "Private-Package: com.typesafe.sbt.osgi.test.internal"))
+ error("Expected 'Private-Package: com.typesafe.sbt.osgi.test.internal' in manifest!" + butWas)
} catch {
case e: IOException => error("Expected to be able to read the manifest, but got exception!" + newLine + e)
} finally manifestIn.close()
@@ -0,0 +1,2 @@
+
+addSbtPlugin("com.typesafe.sbt.osgi" % "sbt-osgi" % "0.4.0-SNAPSHOT")
@@ -0,0 +1,3 @@
+package com.typesafe.sbt.osgi.test
+
+class Foo
@@ -1,4 +1,5 @@
-package com.typesafe.sbtosgi.test.internal
+package com.typesafe.sbt.osgi.test
+package internal
import org.osgi.framework._
@@ -1,19 +1,19 @@
-organization := "com.typesafe.sbtosgi"
+organization := "com.typesafe.sbt"
-name := "sbtosgi-test"
+name := "sbt-osgi-test"
version := "1.2.3"
libraryDependencies += "org.osgi" % "org.osgi.core" % "4.3.0" % "provided"
osgiSettings
-OsgiKeys.bundleActivator := Some("com.typesafe.sbtosgi.test.internal.Activator")
+OsgiKeys.bundleActivator := Some("com.typesafe.sbt.osgi.test.internal.Activator")
OsgiKeys.dynamicImportPackage := Seq("scala.*")
-OsgiKeys.exportPackage := Seq("com.typesafe.sbtosgi.test")
+OsgiKeys.exportPackage := Seq("com.typesafe.sbt.osgi.test")
TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
import java.io.IOException
@@ -27,8 +27,8 @@ TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
val lines = Source.fromInputStream(manifestIn).getLines().toList
val allLines = lines mkString newLine
val butWas = newLine + "But was:" + newLine + allLines
- if (!(lines contains "Private-Package: .,com.typesafe.sbtosgi.test.internal"))
- error("Expected 'Private-Package: .,com.typesafe.sbtosgi.test.internal' in manifest!" + butWas)
+ if (!((lines contains "Private-Package: .,com.typesafe.sbt.osgi.test.internal") || (lines contains "Private-Package: com.typesafe.sbt.osgi.test.internal,.")))
+ error("Expected 'Private-Package: .,com.typesafe.sbt.osgi.test.internal' in manifest!" + butWas)
} catch {
case e: IOException => error("Expected to be able to read the manifest, but got exception!" + newLine + e)
} finally manifestIn.close()
@@ -0,0 +1,2 @@
+
+addSbtPlugin("com.typesafe.sbt.osgi" % "sbt-osgi" % "0.4.0-SNAPSHOT")
@@ -0,0 +1,3 @@
+package com.typesafe.sbt.osgi.test
+
+class Foo
@@ -1,4 +1,4 @@
-package com.typesafe.sbtosgi.test.internal
+package com.typesafe.sbt.osgi.test.internal
import org.osgi.framework._
@@ -1,14 +1,14 @@
-organization := "com.typesafe.sbtosgi"
+organization := "com.typesafe.sbt"
-name := "sbtosgi-test"
+name := "sbt-osgi-test"
version := "1.2.3"
osgiSettings
OsgiKeys.additionalHeaders := Map(
- "Main-Class" -> "com.typesafe.sbtosgi.test.App"
+ "Main-Class" -> "com.typesafe.sbt.osgi.test.App"
)
TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
@@ -23,8 +23,8 @@ TaskKey[Unit]("verify-bundle") <<= OsgiKeys.bundle map { file =>
val lines = Source.fromInputStream(manifestIn).getLines().toList
val allLines = lines mkString newLine
val butWas = newLine + "But was:" + newLine + allLines
- if (!(lines contains "Main-Class: com.typesafe.sbtosgi.test.App"))
- error("Expected 'Main-Class: com.typesafe.sbtosgi.test.App' in manifest!" + butWas)
+ if (!(lines contains "Main-Class: com.typesafe.sbt.osgi.test.App"))
+ error("Expected 'Main-Class: com.typesafe.sbt.osgi.test.App' in manifest!" + butWas)
} catch {
case e: IOException => error("Expected to be able to read the manifest, but got exception!" + newLine + e)
} finally manifestIn.close()
@@ -0,0 +1,2 @@
+
+addSbtPlugin("com.typesafe.sbt.osgi" % "sbt-osgi" % "0.4.0-SNAPSHOT")
@@ -1,2 +0,0 @@
-
-addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0-SNAPSHOT")
@@ -1,2 +0,0 @@
-
-addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0-SNAPSHOT")
@@ -1,3 +0,0 @@
-package com.typesafe.sbtosgi.test
-
-class Foo
@@ -1,2 +0,0 @@
-
-addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0-SNAPSHOT")
@@ -1,3 +0,0 @@
-package com.typesafe.sbtosgi.test
-
-class Foo
Oops, something went wrong.

0 comments on commit b5c2110

Please sign in to comment.