@@ -39,17 +39,7 @@ object ReproducibleBuildsPlugin extends AutoPlugin {
39
39
disambiguation in Compile := ((packagedFiles : Iterable [File ]) =>
40
40
Some (sys.env.get(" USER" ).orElse(sys.env.get(" USERNAME" )).map(_ + " -" ).getOrElse(" " ) + packagedFiles.map(_.lastModified()).max)
41
41
),
42
- packageBin in Compile := {
43
- val bin = (packageBin in Compile ).value
44
- val dir = bin.getParentFile.toPath.resolve(" stripped" )
45
- dir.toFile.mkdir()
46
- val out = dir.resolve(bin.getName).toFile
47
- new ZipStripper ()
48
- .addFileStripper(" META-INF/MANIFEST.MF" , new ManifestStripper ())
49
- .addFileStripper(" META-INF/maven/\\ S*/pom.properties" , new PomPropertiesStripper ())
50
- .strip(bin, out)
51
- out
52
- },
42
+ packageBin in Compile := postProcessJar((packageBin in Compile ).value),
53
43
artifactPath in reproducibleBuildsCertification := artifactPathSetting(artifact in reproducibleBuildsCertification).value,
54
44
reproducibleBuildsPackageName := moduleName.value + " _" + scalaBinaryVersion.value,
55
45
reproducibleBuildsCertification := {
@@ -136,6 +126,17 @@ object ReproducibleBuildsPlugin extends AutoPlugin {
136
126
}
137
127
)
138
128
129
+ def postProcessJar (jar : File ): File = {
130
+ val dir = jar.getParentFile.toPath.resolve(" stripped" )
131
+ dir.toFile.mkdir()
132
+ val out = dir.resolve(jar.getName).toFile
133
+ new ZipStripper ()
134
+ .addFileStripper(" META-INF/MANIFEST.MF" , new ManifestStripper ())
135
+ .addFileStripper(" META-INF/maven/\\ S*/pom.properties" , new PomPropertiesStripper ())
136
+ .strip(jar, out)
137
+ out
138
+ }
139
+
139
140
private def checkVerification (ours : File , uri : URI ): Unit = {
140
141
import scala .collection .JavaConverters ._
141
142
val ourSums = parseChecksums(Files .readAllLines(ours.toPath, Charset .forName(" UTF-8" )).asScala.toList)
0 commit comments