You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/04/07 13:31:27 UTC
[44/50] [abbrv] groovy git commit: merge global transforms from
subprojects
merge global transforms from subprojects
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/42b9a423
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/42b9a423
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/42b9a423
Branch: refs/heads/parrot
Commit: 42b9a42323b8a8cb74bf76b17427a49a2de92d78
Parents: 1877bed
Author: paulk <pa...@asert.com.au>
Authored: Wed Mar 29 22:46:20 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Mar 29 22:47:09 2017 +1000
----------------------------------------------------------------------
gradle/assemble.gradle | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/42b9a423/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 57a0bbb..72ef7f5 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -315,6 +315,36 @@ def mergeModuleDescriptors() {
descriptor
}
+def mergeGlobalTransforms() {
+ new File("$buildDir/tmp/").mkdirs()
+
+ def descriptor = new File("$buildDir/tmp/org.codehaus.groovy.transform.ASTTransformation")
+ descriptor.withWriter('UTF-8') {
+ it << '# This is a generated file, do not edit\n'
+ }
+
+ def files = []
+ files << new File("${rootProject.buildDir}/resources/main/META-INF/services/org.codehaus.groovy.transform.ASTTransformation")
+ modules().collect {
+ new File("${it.buildDir}/resources/main/META-INF/services/org.codehaus.groovy.transform.ASTTransformation")
+ }.findAll { it.exists() }.each {
+ files << it
+ }
+ files.each {
+ def skipping = true
+ it.readLines().each { line ->
+ if (skipping) {
+ skipping = line.startsWith('#')
+ }
+ if (!skipping) {
+ descriptor << line + '\n'
+ }
+ }
+ }
+
+ descriptor
+}
+
task replaceJarWithJarJar(dependsOn: allprojects.jarjar ) {
description = "Overwrites normal JAR files with their JARJAR version"
doLast {
@@ -370,6 +400,10 @@ task jarAll(type: Jar, dependsOn: replaceJarWithJarJar) {
into "$owner.ext.metaInfDir/services"
}
copy {
+ from(mergeGlobalTransforms())
+ into "$owner.ext.metaInfDir/services"
+ }
+ copy {
into "$owner.ext.metaInfDir"
}
logger.info 'Packaging with jarjar'