You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/04/22 12:45:11 UTC

[groovy] branch master updated: GROOVY-9628: Initial support for reproducible builds

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new bf160bb  GROOVY-9628: Initial support for reproducible builds
bf160bb is described below

commit bf160bbaaf812fac9ffa246206e1b16b37ef4ac4
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 22 22:45:03 2021 +1000

    GROOVY-9628: Initial support for reproducible builds
---
 buildSrc/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/buildSrc/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy b/buildSrc/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy
index 993cb0b..ddbf55c 100644
--- a/buildSrc/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy
+++ b/buildSrc/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy
@@ -112,10 +112,11 @@ class JarJarTask extends DefaultTask {
         def manifestFile = new File(temporaryDir, 'MANIFEST.MF')
         // First step is to create a repackaged jar
         outputFile.parentFile.mkdirs()
+        def tstamp = Date.parse('yyyy-MM-dd HH:mm', '1980-02-01 00:00').time.toString()
         try {
             project.ant {
                 taskdef name: 'jarjar', classname: JARJAR_CLASS_NAME, classpath: jarjarToolClasspath.asPath
-                jarjar(jarfile: tmpJar, filesonly: true) {
+                jarjar(jarfile: tmpJar, filesonly: true, modificationtime: tstamp) {
                     zipfileset(
                             src: originalJar,
                             excludes: (untouchedFiles + excludes).join(','))
@@ -167,7 +168,7 @@ class JarJarTask extends DefaultTask {
                 it.into(outputFile.parentFile)
                 it.rename { outputFile.name }
             }
-            project.ant.jar(destfile: outputFile, update: true, index: true, manifest: manifestFile) {
+            project.ant.jar(destfile: outputFile, update: true, index: true, manifest: manifestFile, modificationtime: tstamp) {
                 manifest {
                     // because we don't want to use JDK 1.8.0_91, we don't care and it will
                     // introduce cache misses