Skip to content

Commit d18f424

Browse files
committed
OSGify.
Note the importance of having osgiSettings in the main build.
1 parent 276ccde commit d18f424

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ version := "1.0.0-SNAPSHOT"
99
scalaVersion := "2.11.0-M7"
1010

1111
snapshotScalaBinaryVersion := "2.11.0-M7"
12+
13+
// important!! must come here (why?)
14+
osgiSettings
15+
16+
OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}")

standard.sbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ pomExtra := (
6767
</developer>
6868
</developers>
6969
)
70+
71+
val osgiVersion = version(_.replace('-', '.'))
72+
73+
OsgiKeys.bundleSymbolicName := s"${organization.value}.${name.value}"
74+
75+
OsgiKeys.bundleVersion := osgiVersion.value
76+
77+
// Sources should also have a nice MANIFEST file
78+
packageOptions in packageSrc := Seq(Package.ManifestAttributes(
79+
("Bundle-SymbolicName", s"${organization.value}.${name.value}.source"),
80+
("Bundle-Name", s"${name.value} sources"),
81+
("Bundle-Version", osgiVersion.value),
82+
("Eclipse-SourceBundle", s"""${organization.value}.${name.value};version="${osgiVersion.value}";roots:="."""")
83+
))

0 commit comments

Comments
 (0)