-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package net.bzzt.reproduciblebuilds | ||
|
||
import com.typesafe.sbt.packager.universal.UniversalPlugin | ||
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport._ | ||
import sbt._ | ||
import sbt.Keys._ | ||
|
||
/** | ||
* Helper code for sbt-native-packager integration. | ||
* | ||
* The main ReproducibleBuildsPlugin code should not rely on any | ||
* sbt-native-packager code, since this plugin should be usable without | ||
* sbt-native-packager and not introduce it to projects not already using it. | ||
* | ||
* Any code dependent on sbt-native-packager classes | ||
* should go here, and only be called in case it is indeed available. | ||
* | ||
* To avoid 'leaking' references to sbt-native-packager classes into other | ||
* classes, care should be taken that none appear in parameter or return | ||
* value types either. | ||
*/ | ||
object SbtNativePackagerHelpers { | ||
val plugin: Plugins.Basic = UniversalPlugin | ||
|
||
val none: File = new File("none") | ||
|
||
val settings: Seq[Setting[_]] = Seq( | ||
// Make sure there's always a value defined, even when the Universal plugin isn't loaded: | ||
packageBin in Global := none, | ||
packageBin in Universal := { | ||
val upstream = (packageBin in Universal).value | ||
// If the value is still `none`, the Universal plugin isn't loaded. | ||
if (upstream == none) none | ||
else ReproducibleBuildsPlugin.postProcessZip(upstream) | ||
} | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
src/sbt-test/sbt-reproducible-builds/native-packager/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.disambiguation | ||
|
||
enablePlugins(ReproducibleBuildsPlugin) | ||
enablePlugins(JavaAppPackaging) | ||
|
||
// Universal plugin settings: | ||
maintainer := "[email protected]" | ||
|
||
// Make the filename static for easier validation: | ||
disambiguation in Compile := (_ => Some("STATIC")) |
Binary file added
BIN
+2.94 KB
.../sbt-reproducible-builds/native-packager/expected/native-packager_2.12-0.1.0-SNAPSHOT.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
src/sbt-test/sbt-reproducible-builds/native-packager/project/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.2.1 |
7 changes: 7 additions & 0 deletions
7
src/sbt-test/sbt-reproducible-builds/native-packager/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sys.props.get("plugin.version") match { | ||
case Some(x) => addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % sys.props("plugin.version")) | ||
case _ => sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.9") |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-reproducible-builds/native-packager/src/main/scala/Main.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.bzzt | ||
|
||
object Main extends App { | ||
println("Hello, Reproducible World") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
> package | ||
$ exists target/scala-2.12/stripped/native-packager_2.12-0.1.0-SNAPSHOT.jar | ||
$ must-mirror target/scala-2.12/stripped/native-packager_2.12-0.1.0-SNAPSHOT.jar expected/native-packager_2.12-0.1.0-SNAPSHOT.jar | ||
> reproducibleBuildsCertification | ||
$ exists target/scala-2.12/native-packager_2.12_0.1.0-SNAPSHOT_all_STATIC.buildinfo | ||
# Not on travis: | ||
#> signedReproducibleBuildsCertification | ||
#> reproducibleBuildsUploadCertification | ||
#> reproducibleBuildsCheckCertification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters