Skip to content

Commit eb62055

Browse files
adriaanmandy1138
authored andcommitted
OSGify.
Note the importance of having osgiSettings in the main build. Conflicts: build.sbt
1 parent 8f9d927 commit eb62055

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ snapshotScalaBinaryVersion := "2.11.1"
1313
scalacOptions ++= Seq("-deprecation", "-feature", "-target:jvm-1.6")
1414

1515
snapshotScalaBinaryVersion := "2.11"
16+
17+
// important!! must come here (why?)
18+
osgiSettings
19+
20+
OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}")

standard.sbt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ resourceGenerators in Compile <+= Def.task {
2222
Seq(file)
2323
}
2424

25-
mappings in (Compile, packageBin) += {
26-
(baseDirectory.value / s"${name.value}.properties") -> s"${name.value}.properties"
27-
}
28-
2925

3026
// maven publishing
3127
publishTo := {
@@ -71,3 +67,17 @@ pomExtra := (
7167
</developer>
7268
</developers>
7369
)
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)