You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by cc...@apache.org on 2017/12/15 08:32:25 UTC

[1/2] groovy git commit: Consistently create manifests

Repository: groovy
Updated Branches:
  refs/heads/master ed1c4c4b9 -> a67c1dfcc


Consistently create manifests

This commit is a build cache optimization: while we don't really care about the manifest of
the "raw" cache, it's better to consistently create one that does **not** include the OSGI
last modified entry, as it will trigger unnecessary rebuilds, because of cache misses.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a67c1dfc
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a67c1dfc
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a67c1dfc

Branch: refs/heads/master
Commit: a67c1dfccf81a353007a635d68a47e015c1c2943
Parents: 6e69d57
Author: Cedric Champeau <cc...@apache.org>
Authored: Fri Dec 15 09:29:32 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Fri Dec 15 09:31:04 2017 +0100

----------------------------------------------------------------------
 gradle/assemble.gradle | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a67c1dfc/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index bf54c51..9a06ee1 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -113,7 +113,7 @@ ext.groovyOsgiManifest = {
     // Exclude the Bnd-LastModified attribute as it always triggers a rebuild without being really needed.
     from(allManifest) {
         eachEntry { details ->
-            if (excludedFromManifest.any { it == details.key}) {
+            if (excludedFromManifest.any { it == details.key }) {
                 details.exclude()
             }
         }
@@ -143,6 +143,15 @@ allprojects {
     def producedJars = [jar]
     jar {
         appendix = 'raw'
+        manifest {
+            from(allManifest) {
+                eachEntry { details ->
+                    if (excludedFromManifest.any { it == details.key }) {
+                        details.exclude()
+                    }
+                }
+            }
+        }
     }
     if (rootProject.indyCapable()) {
         task jarWithIndy(type: Jar) {


[2/2] groovy git commit: Replace filter with regular expression rename

Posted by cc...@apache.org.
Replace filter with regular expression rename


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/6e69d579
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/6e69d579
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/6e69d579

Branch: refs/heads/master
Commit: 6e69d579af25e8c27ac2e4189e5a09e20c67bcc5
Parents: ed1c4c4
Author: Cedric Champeau <cc...@apache.org>
Authored: Fri Dec 15 08:33:39 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Fri Dec 15 09:31:04 2017 +0100

----------------------------------------------------------------------
 .../codehaus/groovy/gradle/CacheableJar.groovy  | 29 ++++++++++++++++++++
 gradle/assemble.gradle                          |  8 +++---
 2 files changed, 33 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6e69d579/buildSrc/src/main/groovy/org/codehaus/groovy/gradle/CacheableJar.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/codehaus/groovy/gradle/CacheableJar.groovy b/buildSrc/src/main/groovy/org/codehaus/groovy/gradle/CacheableJar.groovy
new file mode 100644
index 0000000..fa4b5f2
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/codehaus/groovy/gradle/CacheableJar.groovy
@@ -0,0 +1,29 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.gradle
+
+import groovy.transform.CompileStatic
+import org.gradle.api.tasks.CacheableTask
+import org.gradle.api.tasks.bundling.Jar
+
+@CompileStatic
+@CacheableTask
+class CacheableJar extends Jar {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/6e69d579/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index aba14d6..bf54c51 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -166,7 +166,7 @@ allprojects {
             }
             from("$projectDir/notices/NOTICE-JARJAR")
             from(generateReleaseInfo)
-            rename { String filename -> filename == 'LICENSE-JARJAR' ? 'LICENSE' : filename == 'NOTICE-JARJAR' ? 'NOTICE' : filename }
+            rename '([A-Z]+)-(.*)', '$1'
         }
         arch.exclude '**/package-info.class'
 
@@ -314,7 +314,7 @@ subprojects { sp ->
             } else {
                 from "${rootProject.projectDir}/notices/NOTICE-BASE"
             }
-            rename { String filename -> filename == 'LICENSE-BASE' ? 'LICENSE' : filename == 'NOTICE-BASE' ? 'NOTICE' : filename }
+            rename '([A-Z]+)-(.*)', '$1'
         }
         exclude '**/package-info.class'
     }
@@ -351,7 +351,7 @@ ext.distSpec = copySpec {
     duplicatesStrategy = DuplicatesStrategy.EXCLUDE
     from("$projectDir/licenses/LICENSE-BINZIP")
     from("$projectDir/notices/NOTICE-BINZIP")
-    rename { String filename -> filename == 'LICENSE-BINZIP' ? 'LICENSE' : filename == 'NOTICE-BINZIP' ? 'NOTICE' : filename }
+    rename '([A-Z]+)-(.*)', '$1'
     exclude { it.file.name =~ /-raw/ }
     into('lib') {
         from jarjar
@@ -493,7 +493,7 @@ task dist(type: Zip, dependsOn: [checkCompatibility, distBin, distSrc, distDoc,
     into "groovy-$version"
     from("$projectDir/licenses/LICENSE-SDK")
     from("$projectDir/notices/NOTICE-SDK")
-    rename { String filename -> filename == 'LICENSE-SDK' ? 'LICENSE' : filename == 'NOTICE-SDK' ? 'NOTICE' : filename }
+    rename '([A-Z]+)-(.*)', '$1'
     with distSpec
     into('doc') {
         with docSpec