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 2022/09/01 02:41:04 UTC

[groovy] branch GROOVY_3_0_X updated: minor build tweaks

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

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


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 3346431086 minor build tweaks
3346431086 is described below

commit 334643108667028b1282ea373d7d189404fef910
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Sep 1 12:40:53 2022 +1000

    minor build tweaks
    
    We should come back and try to revert back to WARN (or FAIL) once we can clean up build further
---
 build.gradle           |  2 +-
 gradle/assemble.gradle | 28 +++++++++++++++-------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/build.gradle b/build.gradle
index a8679681f9..6ff683aaf0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -364,7 +364,7 @@ allprojects {
     }
 
     tasks.withType(AbstractCopyTask) {
-        duplicatesStrategy = DuplicatesStrategy.WARN
+        duplicatesStrategy = DuplicatesStrategy.EXCLUDE
     }
 
     tasks.withType(JavaCompile) {
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index a074decd1f..f82873309e 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -165,7 +165,7 @@ allprojects {
 
     def producedJars = [jar]
     jar {
-        duplicatesStrategy = DuplicatesStrategy.WARN
+        duplicatesStrategy = DuplicatesStrategy.EXCLUDE
         appendix = 'raw'
         manifest {
             from(allManifest) {
@@ -180,7 +180,7 @@ allprojects {
     if (rootProject.indyCapable()) {
         task jarWithIndy(type: Jar) {
             dependsOn compileGroovyWithIndy
-            duplicatesStrategy = DuplicatesStrategy.WARN
+            duplicatesStrategy = DuplicatesStrategy.EXCLUDE
             classifier = 'indy'
             appendix = 'raw'
             from sourceSets.main.java.outputDir
@@ -306,19 +306,21 @@ producedJars.each {
 }
 
 subprojects { sp ->
-    jar {
+    tasks.withType(Jar).configureEach { jar ->
         metaInf {
-            if (file("${projectDir}/LICENSE").exists()) {
-                from "${projectDir}/LICENSE"
-            } else {
-                from "${rootProject.projectDir}/licenses/LICENSE-BASE"
-            }
-            if (file("${projectDir}/NOTICE").exists()) {
-                from "${projectDir}/NOTICE"
-            } else {
-                from "${rootProject.projectDir}/notices/NOTICE-BASE"
+            if (jar.name == 'sourcesJar') {
+                if (file("${projectDir}/LICENSE").exists()) {
+                    from "${projectDir}/LICENSE"
+                } else {
+                    from "${rootProject.projectDir}/licenses/LICENSE-BASE"
+                }
+                if (file("${projectDir}/NOTICE").exists()) {
+                    from "${projectDir}/NOTICE"
+                } else {
+                    from "${rootProject.projectDir}/notices/NOTICE-BASE"
+                }
+                rename '^([A-Z]+)-([^.]*)', '$1'
             }
-            rename '^([A-Z]+)-([^.]*)', '$1'
         }
         exclude '**/package-info.class'
     }