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:26 UTC
[2/2] groovy git commit: Replace filter with regular expression rename
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