groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cchamp...@apache.org
Subject [58/62] [abbrv] groovy git commit: Replace filter with regular expression rename
Date Sun, 17 Dec 2017 15:05:20 GMT
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/da8fdb22
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/da8fdb22
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/da8fdb22

Branch: refs/heads/GROOVY_2_5_X
Commit: da8fdb2211e142d85fd8520fa85c73fd5edd0de9
Parents: b549ba9
Author: Cedric Champeau <cchampeau@apache.org>
Authored: Fri Dec 15 08:33:39 2017 +0100
Committer: Cedric Champeau <cchampeau@apache.org>
Committed: Sun Dec 17 15:37:01 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/da8fdb22/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/da8fdb22/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index d1c16be..0fdaf16 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -167,7 +167,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'
     }
@@ -356,7 +356,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
@@ -496,7 +496,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


Mime
View raw message