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 06:26:48 UTC

[groovy] branch master updated: minor build refactor: pre-work for 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 b8d2050  minor build refactor: pre-work for GROOVY-9628 (initial support for reproducible builds)
b8d2050 is described below

commit b8d20502ebef64668eececb6a3dee135edc7f38b
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 22 16:26:40 2021 +1000

    minor build refactor: pre-work for GROOVY-9628 (initial support for reproducible builds)
---
 buildSrc/src/main/groovy/Services.groovy                     |  8 ++++++++
 buildSrc/src/main/groovy/org.apache.groovy-base.gradle       | 12 +++++-------
 .../src/main/groovy/org.apache.groovy-distribution.gradle    |  8 +-------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/buildSrc/src/main/groovy/Services.groovy b/buildSrc/src/main/groovy/Services.groovy
new file mode 100644
index 0000000..f678855
--- /dev/null
+++ b/buildSrc/src/main/groovy/Services.groovy
@@ -0,0 +1,8 @@
+import org.gradle.api.component.SoftwareComponentFactory
+
+import javax.inject.Inject
+
+interface Services {
+    @Inject
+    SoftwareComponentFactory getSoftwareComponentFactory()
+}
\ No newline at end of file
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-base.gradle b/buildSrc/src/main/groovy/org.apache.groovy-base.gradle
index e6fe00b..b4da24e 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-base.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-base.gradle
@@ -17,14 +17,12 @@
  *  under the License.
  */
 
-
 import groovy.transform.CompileStatic
 import org.apache.groovy.gradle.GroovyLibraryExtension
 import org.apache.groovy.gradle.JarJarTask
 import org.apache.groovy.gradle.ReleaseInfoGenerator
 import org.gradle.api.attributes.java.TargetJvmVersion
 
-import javax.inject.Inject
 import com.github.spotbugs.snom.SpotBugsTask
 import org.apache.groovy.gradle.CheckstyleHtmlReport
 
@@ -145,6 +143,11 @@ tasks.named('jar') {
     groovyLibrary.configureManifest(manifest, excludedFromManifest)
 }
 
+tasks.withType(AbstractArchiveTask) {
+    preserveFileTimestamps = false
+    reproducibleFileOrder = true
+}
+
 tasks.withType(Jar).configureEach {
     metaInf {
         if (file("${projectDir}/LICENSE").exists()) {
@@ -265,11 +268,6 @@ tasks.withType(Checkstyle).configureEach {
     }
 }
 
-interface Services {
-    @Inject
-    SoftwareComponentFactory getSoftwareComponentFactory()
-}
-
 // Groovy doesn't publish the regular jars: it publishes
 // the repackaged jars, which is why we can't use the
 // default publication, and need to create our own
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle b/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
index 363edab..8c46d0e 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
@@ -16,8 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-import javax.inject.Inject
-import org.apache.groovy.gradle.SharedConfiguration
+
 import org.apache.groovy.gradle.DistributionExtension
 import org.apache.groovy.gradle.DocGDK
 
@@ -208,11 +207,6 @@ tasks.named('asciidoctorPdf') {
     outputDir = "$buildDir/asciidocAll/pdf"
 }
 
-interface Services {
-    @Inject
-    SoftwareComponentFactory getSoftwareComponentFactory()
-}
-
 // The Groovy distribution module isn't a Java library
 // so we create a custom publication
 def factory = objects.newInstance(Services).softwareComponentFactory