Skip to content

Commit 7cd1edd

Browse files
authored
Merge pull request #38 from raboof/nextToSbtOsgi
OSGi example
2 parents 0018fdc + cc51fb4 commit 7cd1edd

File tree

8 files changed

+41
-0
lines changed

8 files changed

+41
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.disambiguation
2+
3+
enablePlugins(ReproducibleBuildsPlugin)
4+
enablePlugins(SbtOsgi)
5+
6+
OsgiKeys.exportPackage := Seq("net.bzzt")
7+
8+
// When replacing packageBin with the OSGi bundle...
9+
Compile / packageBin := OsgiKeys.bundle.value
10+
11+
// We need to explicitly load the rb settings again to
12+
// make sure the OSGi package is post-processed:
13+
ReproducibleBuildsPlugin.projectSettings
14+
15+
// Make the filename static for easier validation:
16+
disambiguation in Compile := (_ => Some("STATIC"))
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.2.1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sys.props.get("plugin.version") match {
2+
case Some(x) => addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % sys.props("plugin.version"))
3+
case _ => sys.error("""|The system property 'plugin.version' is not defined.
4+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
5+
}
6+
7+
8+
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.4")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package net.bzzt
2+
3+
object Main extends App {
4+
println("Hello, Reproducible World")
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
> package
2+
$ exists target/scala-2.12/stripped/osgi_2.12-0.1.0-SNAPSHOT.jar
3+
$ must-mirror target/scala-2.12/stripped/osgi_2.12-0.1.0-SNAPSHOT.jar expected/osgi_2.12-0.1.0-SNAPSHOT.jar
4+
> reproducibleBuildsCertification
5+
$ exists target/scala-2.12/osgi_2.12_0.1.0-SNAPSHOT_all_STATIC.buildinfo
6+
# Not on travis:
7+
#> signedReproducibleBuildsCertification
8+
#> reproducibleBuildsUploadCertification
9+
#> reproducibleBuildsCheckCertification
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package net.bzzt
2+
13
object Main extends App {
24
println("Hello, Reproducible World")
35
}

0 commit comments

Comments
 (0)