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/11 19:25:15 UTC

[01/13] groovy git commit: Avoid resolving dependencies at configuration time

Repository: groovy
Updated Branches:
  refs/heads/master 0d1890c04 -> 6d0c66773


Avoid resolving dependencies at configuration time


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

Branch: refs/heads/master
Commit: db85fc27cc89ea9cee2917893f8bc35aeebbcc06
Parents: fe90fda
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 19:06:50 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/assemble.gradle | 67 ++++++++++++++++++++++++++++-----------------
 1 file changed, 42 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/db85fc27/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index a7dd207..0e5cbae 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -165,7 +165,7 @@ allprojects {
         }
         arch.exclude '**/package-info.class'
 
-        task "jar${arch.name}"(type:Jar, dependsOn: arch) {
+        task "jar${arch.name}"(type: Jar, dependsOn: arch) {
             outputs.cacheIf {
                 // caching JarJar because it's quite expensive to create
                 true
@@ -258,7 +258,7 @@ allprojects {
             classifier = jar.classifier ? "${jar.classifier}grooid" : 'grooid'
             includeEmptyDirs = false
             def target = new File("${archivePath}.tmp")
-            boolean isRootProject = project==rootProject
+            boolean isRootProject = project == rootProject
 
             doFirst {
                 from zipTree(target)
@@ -268,7 +268,9 @@ allprojects {
                         zipfileset(dir: "$rootProject.projectDir/notices/", includes: isRootProject ? 'NOTICE-GROOIDJARJAR' : 'NOTICE-GROOID', fullpath: 'META-INF/NOTICE')
                         zipfileset(src: jarjar.archivePath, excludes: 'META-INF/NOTICE')
                         if (isRootProject) {
-                            zipfileset(src: rootProject.configurations.runtime.files.find { it.name.startsWith('openbeans') }, excludes: 'META-INF/*')
+                            zipfileset(src: rootProject.configurations.runtime.files.find {
+                                it.name.startsWith('openbeans')
+                            }, excludes: 'META-INF/*')
                         }
                         rule pattern: 'com.googlecode.openbeans.**', result: 'groovyjarjaropenbeans.@1'
                         rule pattern: 'org.apache.harmony.beans.**', result: 'groovyjarjarharmonybeans.@1'
@@ -349,6 +351,7 @@ task groovydocAllJar(type: Jar, dependsOn: groovydocAll) {
 }
 
 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 }
@@ -356,17 +359,29 @@ ext.distSpec = copySpec {
     into('lib') {
         from jarjar
         from modules()*.jarjar
-        from {
-            configurations.runtime.findAll {
-                it.name.endsWith('jar') && !it.name.startsWith('openbeans-') && !it.name.startsWith('asm-') && !it.name.startsWith('antlr-') && !it.name.startsWith('antlr4-') } +
-                    modules()*.jar.archivePath +
-                    modules().configurations.runtime*.findAll {
-                        it.name.endsWith('jar') && !it.name.contains('livetribe-jsr223') && !it.name.matches(/groovy-\d.*/) &&
-                                !it.name.startsWith('asm-') && !it.name.startsWith('antlr-') && !it.name.startsWith('antlr4-') && !it.name.startsWith('openbeans-')
-                    }.flatten() as Set
+        from(configurations.runtime) {
+            exclude {   it.file.name.startsWith('openbeans-') ||
+                        it.file.name.startsWith('asm-') ||
+                        it.file.name.startsWith('antlr-') ||
+                        it.file.name.startsWith('antlr4-')
+            }
         }
         from('src/bin/groovy.icns')
     }
+    modules().configurations.runtime.each { conf ->
+        into('lib') {
+            from(conf) {
+                exclude {
+                    it.file.name.contains('livetribe-jsr223') ||
+                            it.file.name.matches(/groovy-\d.*/) ||
+                            it.file.name.startsWith('asm-') ||
+                            it.file.name.startsWith('antlr-') ||
+                            it.file.name.startsWith('antlr4-') ||
+                            it.file.name.startsWith('openbeans-')
+                }
+            }
+        }
+    }
     into('indy') {
         from jarjarWithIndy
         from modules()*.jarjarWithIndy
@@ -384,7 +399,7 @@ ext.distSpec = copySpec {
     }
     into('bin') {
         from('src/bin') {
-            filter(ReplaceTokens, tokens: [GROOVYJAR:jarjar.archiveName])
+            filter(ReplaceTokens, tokens: [GROOVYJAR: jarjar.archiveName])
             fileMode = 0755
             exclude 'groovy.icns'
         }
@@ -442,8 +457,8 @@ task distSrc(type: Zip) {
 }
 
 def installDir = {
-    project.hasProperty('groovy_installPath')?project.groovy_installPath:
-        System.properties.installDirectory ?: "$buildDir/install"
+    project.hasProperty('groovy_installPath') ? project.groovy_installPath :
+            System.properties.installDirectory ?: "$buildDir/install"
 }
 
 task installGroovy(type: Sync, dependsOn: [checkCompatibility, distBin]) {
@@ -491,7 +506,7 @@ task dist(type: Zip, dependsOn: [checkCompatibility, distBin, distSrc, distDoc,
     }
 
     if ((version.endsWith('SNAPSHOT') && !groovyBundleVersion.endsWith('SNAPSHOT'))
-        || (!version.endsWith('SNAPSHOT') && groovyBundleVersion.endsWith('SNAPSHOT'))) {
+            || (!version.endsWith('SNAPSHOT') && groovyBundleVersion.endsWith('SNAPSHOT'))) {
         throw new GradleException("Incoherent versions. Found groovyVersion=$version and groovyBundleVersion=$groovyBundleVersion")
     }
 }
@@ -527,16 +542,18 @@ task updateLicenses {
         def jsr223Files = fileTree(licensesDir).include('jsr223-ALLJARJAR-SRC.txt')
         def licenseHdr = '\n\n------------------------------------------------------------------------\n\n'
         [
-                (licenseBinZipFile)     : binzipFiles,
-                (licenseDocFile)        : docFiles,
-                (licenseJarJarFile)     : jarjarFiles,
-                (licenseSrcFile)        : srcFiles,
+                (licenseBinZipFile)      : binzipFiles,
+                (licenseDocFile)         : docFiles,
+                (licenseJarJarFile)      : jarjarFiles,
+                (licenseSrcFile)         : srcFiles,
                 (licenseDocGeneratorFile): docgeneratorFiles,
                 (licenseGroovyDocFile)   : groovydocFiles,
                 (licenseJsr223File)      : jsr223Files,
         ].each { outFile, inFiles ->
             file(outFile).withWriter('utf-8') { writer ->
-                writer << ([file(licenseBaseFile)] + inFiles).collect { it.text.replaceAll(/[\n\r]*$/, '') }.join(licenseHdr) + '\n'
+                writer << ([file(licenseBaseFile)] + inFiles).collect {
+                    it.text.replaceAll(/[\n\r]*$/, '')
+                }.join(licenseHdr) + '\n'
             }
         }
         file(licenseSdkFile).withWriter { writer ->
@@ -582,11 +599,11 @@ task updateNotices {
         }.sort { it.name }
         def groovyconsoleFiles = fileTree(noticesDir)
         [
-                (noticeBinZipFile): binzipFiles,
-                (noticeGrooidFile): grooidFiles,
-                (noticeGrooidJarJarFile): grooidJarjarFiles,
-                (noticeJarJarFile): jarjarFiles,
-                (noticeSrcFile): srcFiles,
+                (noticeBinZipFile)       : binzipFiles,
+                (noticeGrooidFile)       : grooidFiles,
+                (noticeGrooidJarJarFile) : grooidJarjarFiles,
+                (noticeJarJarFile)       : jarjarFiles,
+                (noticeSrcFile)          : srcFiles,
                 (noticeGroovyConsoleFile): groovyconsoleFiles,
         ].each { outFile, inFiles ->
             file(outFile).withWriter('utf-8') { writer ->


[13/13] groovy git commit: Disable some tests with indy

Posted by cc...@apache.org.
Disable some tests with indy


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

Branch: refs/heads/master
Commit: 6d0c66773ba635db1c08f0575c7f901396fd2a4b
Parents: db85fc2
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 20:20:43 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 20:20:43 2017 +0100

----------------------------------------------------------------------
 gradle/test.gradle | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0c6677/gradle/test.gradle
----------------------------------------------------------------------
diff --git a/gradle/test.gradle b/gradle/test.gradle
index 176530d..9bb27c7 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -115,6 +115,9 @@ def buildExcludeFilter(boolean legacyTestSuite) {
     if (legacyTestSuite) {
         // indy tests will only be executed in indy test suite
         excludes += ['indy', 'Indy']
+    } else {
+        // tests not passing with indy : investigation required!
+        excludes += ['Log4j2Test', 'ASTTransformationCustomizerTest']
     }
 
     return { f ->


[04/13] groovy git commit: Make generateGrammarSource cacheable

Posted by cc...@apache.org.
Make generateGrammarSource cacheable


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

Branch: refs/heads/master
Commit: 113eae7f8981f598fd8510587527366a49442ded
Parents: 0d1890c
Author: Cedric Champeau <cc...@apache.org>
Authored: Sun Dec 10 19:42:00 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 subprojects/parser-antlr4/build.gradle | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/113eae7f/subprojects/parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/build.gradle b/subprojects/parser-antlr4/build.gradle
index bbfcc3b..214d4d6 100644
--- a/subprojects/parser-antlr4/build.gradle
+++ b/subprojects/parser-antlr4/build.gradle
@@ -32,6 +32,7 @@ def srcTest = "$srcBase/test"
 
 final PARSER_PACKAGE_NAME = 'org.apache.groovy.parser.antlr4'
 generateGrammarSource {
+    outputs.cacheIf { true }
     arguments += ["-visitor", "-no-listener", "-package", PARSER_PACKAGE_NAME]
 
     doLast {


[09/13] groovy git commit: Fix Groovy distribution zip

Posted by cc...@apache.org.
Fix Groovy distribution zip


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

Branch: refs/heads/master
Commit: 51185f72f534755de79d4f770ff59c559c74e121
Parents: 88fed12
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 11:09:36 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/assemble.gradle | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/51185f72/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 5f8e5af..a7dd207 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -352,8 +352,10 @@ ext.distSpec = copySpec {
     from("$projectDir/licenses/LICENSE-BINZIP")
     from("$projectDir/notices/NOTICE-BINZIP")
     rename { String filename -> filename == 'LICENSE-BINZIP' ? 'LICENSE' : filename == 'NOTICE-BINZIP' ? 'NOTICE' : filename }
+    exclude { it.file.name =~ /-raw/ }
     into('lib') {
-        from jar.archivePath
+        from jarjar
+        from modules()*.jarjar
         from {
             configurations.runtime.findAll {
                 it.name.endsWith('jar') && !it.name.startsWith('openbeans-') && !it.name.startsWith('asm-') && !it.name.startsWith('antlr-') && !it.name.startsWith('antlr4-') } +
@@ -366,12 +368,8 @@ ext.distSpec = copySpec {
         from('src/bin/groovy.icns')
     }
     into('indy') {
-        from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-indy.jar") }
-        from {
-            modules()*.jar.collect { j ->
-                new File(j.archivePath.parent, "${j.baseName}-${j.version}-indy.jar")
-            }
-        }
+        from jarjarWithIndy
+        from modules()*.jarjarWithIndy
     }
     into('grooid') {
         from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-grooid.jar") }
@@ -386,7 +384,7 @@ ext.distSpec = copySpec {
     }
     into('bin') {
         from('src/bin') {
-            filter(ReplaceTokens, tokens: [GROOVYJAR:jar.archiveName])
+            filter(ReplaceTokens, tokens: [GROOVYJAR:jarjar.archiveName])
             fileMode = 0755
             exclude 'groovy.icns'
         }
@@ -404,15 +402,9 @@ ext.distSpec = copySpec {
         include 'junit-license.txt'
         include 'xstream-license.txt'
     }
-    into('embeddable') {
-        subprojects.each {
-            from jar.archivePath
-            from { new File(jar.destinationDir, "${jar.baseName}-${jar.version}-indy.jar") }
-        }
-    }
 }
 
-task distBin(type: Zip, dependsOn: [jarjar]) {
+task distBin(type: Zip) {
     baseName = 'apache-groovy'
     appendix = 'binary'
     into("groovy-$version") {


[05/13] groovy git commit: Remove `groovy-all` jar

Posted by cc...@apache.org.
Remove `groovy-all` jar

This commit removes the generation of a Groovy all jar. This is done because of the JDK 9+ era, that prevents
the use of different "modules" containing the same packages, which is exactly what the all jar is. This also
adds an automatic module name to all generated jars and fixes several caching/up-to-date checking issues.

A "pom packaging" groovy-all artifact is going to be added in a subsequent commit.


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

Branch: refs/heads/master
Commit: 9e39eed4e1b27b1ea3a27258398299319df3122e
Parents: 113eae7
Author: Cedric Champeau <cc...@apache.org>
Authored: Sun Dec 10 21:04:47 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 build.gradle                                    |  40 ++--
 gradle/assemble.gradle                          | 187 +------------------
 gradle/backports.gradle                         |   6 +-
 gradle/binarycompatibility.gradle               |  31 ---
 gradle/quality.gradle                           |   5 +-
 gradle/upload.gradle                            |  47 +----
 .../org/codehaus/groovy/tools/DgmConverter.java |   5 +-
 subprojects/performance/build.gradle            |   4 +-
 8 files changed, 38 insertions(+), 287 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2271c73..580fb0e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -125,12 +125,12 @@ task(copyResources, type: Copy) {
         include('**/*.png', '**/*.gif', '**/*.ico', '**/*.css')
     }
 }
-compileJava.dependsOn(copyResources)
+jar.dependsOn(copyResources)
 task(copyTestResources, type: Copy)
         .from('src/test')
         .into("$buildDir/classes/test")
         .include('**/*.txt', '**/*.xml', '**/*.properties', '**/*.png', '**/*.html', '**/*.gif', '**/*.ico', '**/*.css')
-compileTestJava.dependsOn(copyTestResources)
+test.dependsOn(copyTestResources)
 
 task sourceJar(type: Jar) {
     classifier = 'sources'
@@ -345,8 +345,8 @@ processResources.doLast {
     }
 }
 
-tasks.withType(Jar) {
-    doFirst {
+compileJava {
+    doLast {
         ant.java(classname:'org.jboss.bridger.Bridger', classpath: rootProject.configurations.tools.asPath, outputproperty: 'stdout') {
             arg(value: "${sourceSets.main.java.outputDir.canonicalPath}/org/codehaus/groovy/runtime/DefaultGroovyMethods.class")
         }
@@ -388,24 +388,26 @@ apply from: 'gradle/utils.gradle'
 apply from: 'wrapper.gradle'
 
 task dgmConverter(dependsOn:compileJava) {
+    outputs.cacheIf { true }
+
     description = 'Generates DGM info file required for faster startup.'
-    def classesDir = sourceSets.main.java.outputDir
     def classpath = files(sourceSets.main.output.classesDirs, configurations.compile)
+    ext.outputDir = file("$buildDir/dgm")
 
     //main = 'org.codehaus.groovy.tools.DgmConverter'
     //args = ['--info', classesDir.absolutePath]
     doFirst {
-        file("$classesDir/META-INF").mkdirs()
+        file("$outputDir/META-INF").mkdirs()
         // we use ant.java because Gradle is a bit "too smart" with JavaExec
         // as it will invalidate the task if classpath changes, which will
         // happen once Groovy files are compiled
         ant.java(classname:'org.codehaus.groovy.tools.DgmConverter', classpath: classpath.asPath) {
             arg(value: '--info')
-            arg(value: classesDir.absolutePath)
+            arg(value: "$outputDir.absolutePath")
         }
     }
     inputs.files fileTree('src').include('**/*GroovyMethods.java')
-    outputs.file file("${classesDir}/META-INF/dgminfo")
+    outputs.dir outputDir
 }
 
 compileJava {
@@ -416,26 +418,16 @@ compileJava {
     // Gradle classloading magic with Groovy will only work if it finds a *jar*
     // on classpath. This "bootstrap jar" contains the minimal compiler, without .groovy compiled files
 
-task bootstrapJar {
+task bootstrapJar(type:Jar ) {
     dependsOn compileJava, dgmConverter
 
-    def destinationDir = file("$buildDir/bootstrap")
-    def archiveName = "groovy-${version}-bootstrap.jar"
-    ext.archivePath = file("$destinationDir/$archiveName")
+    from compileJava.destinationDir
+    from dgmConverter.outputDir
 
-    doLast {
-        // we use ant.jar because Gradle is a bit "too smart" with JavaExec
-        // as it will invalidate the task if classpath changes, which will
-        // happen once Groovy files are compiled
-        destinationDir.mkdirs()
-        ant.jar(
-                destfile: archivePath,
-                basedir: file(sourceSets.main.java.outputDir)
-        )
-    }
     inputs.property('indy', useIndy())
-    inputs.files sourceSets.main.allJava
-    outputs.file archivePath
+
+    destinationDir = file("$buildDir/bootstrap")
+    classifier = 'bootstrap'
 }
 
 compileGroovy.dependsOn bootstrapJar

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 2c3d5ce..762b043 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -134,6 +134,7 @@ ext.subprojectOsgiManifest = {
 
 jar {
     dependsOn('dgmConverter')
+    from files(dgmConverter.outputDir)
     metaInf {
         from("$projectDir/licenses/LICENSE-JARJAR")
         from("$projectDir/licenses") {
@@ -209,6 +210,8 @@ allprojects {
                 symbolicName = gradleProject.name
                 instruction 'Import-Package', '*;resolution:=optional'
                 classesDir = targetTmp
+                def moduleName = "org.codehaus.${it.name.replace('-', '.')}"
+                attributes('Automatic-Module-Name': moduleName)
             }
             manifest(manifestSpec)
 
@@ -289,67 +292,6 @@ subprojects { sp ->
     }
 }
 
-def moduleJars() {
-    modules()*.jar.archivePath
-}
-
-def mergeModuleDescriptors() {
-    new File("$buildDir/tmp/").mkdirs()
-
-    def extensionClasses = []
-    def staticExtensionClasses = []
-
-    modules().collect {
-        new File("${it.buildDir}/resources/main/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule")
-    }.findAll { it.exists() }.each {
-        def props = new Properties()
-        props.load(it.newInputStream())
-        extensionClasses += props.get('extensionClasses').split(',').findAll { it }
-        staticExtensionClasses += props.get('staticExtensionClasses').split(',').findAll { it }
-    }
-
-    def descriptor = new File("$buildDir/tmp/org.codehaus.groovy.runtime.ExtensionModule")
-    descriptor.withWriter('UTF-8') {
-        it << '# This is a generated file, do not edit\n'
-        it << 'moduleName=groovy-all\n'
-        it << "moduleVersion=${project.version}\n"
-        it << "extensionClasses=${extensionClasses.join(',')}\n"
-        it << "staticExtensionClasses=${staticExtensionClasses.join(',')}\n"
-    }
-
-    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,80 +312,6 @@ allprojects {
     rootProject.replaceJarWithJarJar.mustRunAfter(test)
 }
 
-task jarAll(type: Jar, dependsOn: replaceJarWithJarJar) {
-
-    inputs.files(allprojects.jar.archivePath)
-
-    ext.metaInfDir = "$buildDir/tmp/groovy-all-metainf"
-    baseName = 'groovy-all'
-    includeEmptyDirs = false
-    if (rootProject.useIndy()) {
-        classifier = 'indy'
-    }
-    doLast {
-        def manifestPath = "$ext.metaInfDir/MANIFEST.MF"
-        manifest.writeTo(manifestPath)
-        copy {
-            from "$projectDir/notices/NOTICE-ALLJARJAR"
-            into owner.ext.metaInfDir
-            rename('NOTICE-ALLJARJAR', 'NOTICE')
-        }
-        copy {
-            from "$projectDir/licenses"
-            into "$owner.ext.metaInfDir/licenses"
-            include 'normalize-stylesheet-license.txt'
-            include 'jsr223-license.txt'
-            include 'jline2-license.txt'
-        }
-        copy {
-            from "$projectDir/licenses/LICENSE-ALLJARJAR"
-            into owner.ext.metaInfDir
-            rename('LICENSE-ALLJARJAR', 'LICENSE')
-        }
-        copy {
-            from(mergeModuleDescriptors())
-            into "$owner.ext.metaInfDir/services"
-        }
-        copy {
-            from(mergeGlobalTransforms())
-            into "$owner.ext.metaInfDir/services"
-        }
-        copy {
-            into "$owner.ext.metaInfDir"
-        }
-        logger.info 'Packaging with jarjar'
-
-        def archivePathTmp = new File("${archivePath}.1.tmp")
-        ant {
-            taskdef name: 'jarjar', classname: jarjarTaskClassName, classpath: configurations.tools.asPath
-            jarjar(jarfile: archivePathTmp, manifest: "$owner.ext.metaInfDir/MANIFEST.MF") {
-                zipfileset(dir: "$owner.ext.metaInfDir", prefix: 'META-INF')
-                zipfileset(src: jar.archivePath, excludes:'META-INF/NOTICE,META-INF/LICENSE')
-                moduleJars().each {
-                    zipfileset(src: it, excludes:'META-INF/NOTICE,META-INF/LICENSE')
-                }
-            }
-        }
-
-        manifest = osgiManifest {
-            symbolicName = 'groovy-all'
-            instruction 'Import-Package', '*;resolution:=optional'
-            classesDir = archivePathTmp
-        }
-        manifest groovyOsgiManifest
-        manifestPath = "${temporaryDir}/META-INF/MANIFEST.MF"
-        manifest.writeTo(manifestPath)
-
-        ant {
-            copy(file: archivePathTmp, tofile: archivePath)
-            jar(destfile: archivePath, update: true, index: true, manifest: manifestPath) {
-                zipfileset(src: jar.archivePath, excludes:'META-INF')
-            }
-            delete(file: archivePathTmp, quiet: true, deleteonexit: true)
-        }
-    }
-}
-
 allprojects {
     task jarWithIndy(type: GradleBuild) {
         onlyIf rootProject.indyCapable
@@ -455,32 +323,6 @@ allprojects {
     }
 }
 
-task jarAllWithIndy(type: GradleBuild) {
-    onlyIf rootProject.indyCapable
-    description = 'Triggers an external build generating the indy jarAll'
-    buildFile = 'build.gradle'
-    startParameter.projectProperties['indy'] = true
-    startParameter.projectCacheDir = file("$buildDir/indyAllCacheDir")
-    tasks = ['jarAll']
-}
-
-task jarAllAll(dependsOn: [jarAll, jarAllWithIndy]) {
-    description = 'Generates groovy-all and groovy-all-indy jars'
-    doFirst {
-        if (useIndy()) {
-            logger.lifecycle('InvokeDynamic support was activated but needs to be off for this pass. Disabling.')
-            ext.useIndy = false
-        }
-    }
-}
-
-allprojects {
-    tasks.withType(Test) { task ->
-        jarAll.mustRunAfter(task)
-        jarAllWithIndy.mustRunAfter(task)
-    }
-}
-
 task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar + rootProject.sourceJar }) {
     with sourceJar.rootSpec
     modules()*.sourceJar.each {
@@ -570,12 +412,14 @@ ext.distSpec = copySpec {
         include 'xstream-license.txt'
     }
     into('embeddable') {
-        from jarAll.archivePath
-        from { new File(jarAll.destinationDir, "${jarAll.baseName}-${jarAll.version}-indy.jar") }
+        subprojects.each {
+            from jar.archivePath
+            from { new File(jar.destinationDir, "${jar.baseName}-${jar.version}-indy.jar") }
+        }
     }
 }
 
-task distBin(type: Zip, dependsOn: [jar, jarAllAll, replaceJarWithJarJar]) {
+task distBin(type: Zip, dependsOn: [jar, replaceJarWithJarJar]) {
     baseName = 'apache-groovy'
     appendix = 'binary'
     into("groovy-$version") {
@@ -676,23 +520,18 @@ task updateLicenses {
     ext.licenseDocGeneratorFile = "${projectDir}/subprojects/groovy-docgenerator/LICENSE"
     ext.licenseGroovyDocFile = "${projectDir}/subprojects/groovy-groovydoc/LICENSE"
     ext.licenseJsr223File = "${projectDir}/subprojects/groovy-jsr223/LICENSE"
-    ext.licenseAllJarJarFile = "${licensesDir}/LICENSE-ALLJARJAR"
     ext.licenseBinZipFile = "${licensesDir}/LICENSE-BINZIP"
     ext.licenseDocFile = "${licensesDir}/LICENSE-DOC"
     ext.licenseJarJarFile = "${licensesDir}/LICENSE-JARJAR"
     ext.licenseSdkFile = "${licensesDir}/LICENSE-SDK"
     inputs.files(licenseBaseFile, fileTree(licensesDir).include('*.txt'))
-    outputs.files(licenseAllJarJarFile, licenseBinZipFile, licenseDocFile, licenseJarJarFile, licenseSrcFile,
+    outputs.files(licenseBinZipFile, licenseDocFile, licenseJarJarFile, licenseSrcFile,
             licenseDocGeneratorFile, licenseGroovyDocFile, licenseJsr223File, licenseSdkFile)
 
     doLast {
         def srcFiles = fileTree(licensesDir).include('*-SRC*.txt').sort { it.name }
         def docFiles = fileTree(licensesDir).include('*-DOC*.txt').sort { it.name }
         def jarjarFiles = fileTree(licensesDir).include('*-JARJAR*.txt').sort { it.name }
-        def allJarjarFiles = fileTree(licensesDir) {
-            include '*-JARJAR*.txt'
-            include '*-ALLJARJAR*.txt'
-        }.sort { it.name }
         def binzipFiles = fileTree(licensesDir) {
             include '*-JARJAR*.txt'
             include '*-ALLJARJAR*.txt'
@@ -703,7 +542,6 @@ task updateLicenses {
         def jsr223Files = fileTree(licensesDir).include('jsr223-ALLJARJAR-SRC.txt')
         def licenseHdr = '\n\n------------------------------------------------------------------------\n\n'
         [
-                (licenseAllJarJarFile)  : allJarjarFiles,
                 (licenseBinZipFile)     : binzipFiles,
                 (licenseDocFile)        : docFiles,
                 (licenseJarJarFile)     : jarjarFiles,
@@ -751,19 +589,14 @@ task updateNotices {
             include '*-JARJAR*.txt'
             include '*-GROOID*.txt'
         }.sort { it.name }
-        def allJarjarFiles = fileTree(noticesDir) {
-            include '*-JARJAR*.txt'
-            include '*-ALLJARJAR*.txt'
-        }.sort { it.name }
         def binzipFiles = fileTree(noticesDir) {
             include '*-JARJAR*.txt'
             include '*-ALLJARJAR*.txt'
             include '*-GROOID*.txt'
             include '*-BINZIP*.txt'
         }.sort { it.name }
-        def groovyconsoleFiles = fileTree(noticesDir).include('silkicons-ALLJARJAR-SRC.txt')
+        def groovyconsoleFiles = fileTree(noticesDir)
         [
-                (noticeAllJarJarFile): allJarjarFiles,
                 (noticeBinZipFile): binzipFiles,
                 (noticeGrooidFile): grooidFiles,
                 (noticeGrooidJarJarFile): grooidJarjarFiles,

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/gradle/backports.gradle
----------------------------------------------------------------------
diff --git a/gradle/backports.gradle b/gradle/backports.gradle
index 0d8e5ed..8d4c779 100644
--- a/gradle/backports.gradle
+++ b/gradle/backports.gradle
@@ -38,7 +38,7 @@ uploadArchives.dependsOn backportJars
 backports.each { pkg, classList ->
     def backportJar = task "backport${pkg}Jar"(type:Jar) {
         group = 'Backports'
-        dependsOn jarAll
+        dependsOn jar
 
         from zipTree(jar.archivePath)
         include classList
@@ -50,14 +50,14 @@ backports.each { pkg, classList ->
     // it's stupid in our case, because we don't have such, but we have no choice
     def javadocJar = task "backport${pkg}JavadocJar"(type:Jar) {
         group = 'Backports'
-        dependsOn jarAll
+        dependsOn jar
 
         baseName = "groovy-backports-$pkg"
         classifier = 'javadoc'
     }
     def sourcesJar = task "backport${pkg}SourcesJar"(type:Jar) {
         group = 'Backports'
-        dependsOn jarAll
+        dependsOn jar
 
         baseName = "groovy-backports-$pkg"
         classifier = 'sources'

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/gradle/binarycompatibility.gradle
----------------------------------------------------------------------
diff --git a/gradle/binarycompatibility.gradle b/gradle/binarycompatibility.gradle
index 96b1059..b822d11 100644
--- a/gradle/binarycompatibility.gradle
+++ b/gradle/binarycompatibility.gradle
@@ -140,37 +140,6 @@ templateConfiguration.with {
 }
 def engine = new MarkupTemplateEngine(this.class.classLoader, configDir, templateConfiguration)
 
-task japicmpAll(type: me.champeau.gradle.ArtifactJapicmpTask) {
-    dependsOn jarAll
-    baseline = "org.codehaus.groovy:groovy-all:${referenceMinorVersion}@jar"
-    to = jarAll.archivePath
-    accessModifier = 'protected'
-    onlyModified = true
-    failOnModification = false
-    txtOutputFile = file("$buildDir/reports/japi.txt")
-
-    doFirst {
-        classpath = allprojects.configurations.japicmp.files.flatten()
-    }
-
-    def htmlReportFile = file("${buildDir}/reports/binary-compat-${project.name}-all.html")
-    inputs.file file("$configDir/$templateFile")
-    inputs.file templateFile
-    outputs.file htmlReportFile
-
-    def model = [title   : "Binary compatibility report for ${project.name}",
-                 project : project,
-                 baseline: baseline,
-                 archive : to.name]
-    outputProcessor(reportGenerator.curry(model))
-
-    doLast {
-        htmlReportFile.withWriter('utf-8') { wrt ->
-            engine.createTemplateByPath(templateFile).make(model).writeTo(wrt)
-        }
-    }
-}
-
 allprojects {
     if (!(project.name in excludeModules)) {
         dependencies {

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index 01fd6e6..b59f1d7 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -54,12 +54,9 @@ allprojects {
 
     // don't fail build on CodeNarc tasks
     tasks.withType(CodeNarc) {
-        dependsOn jarAll
+        dependsOn jar
         ignoreFailures = true
         configFile = file("$rootProject.projectDir/config/codenarc/codenarc.groovy")
-        codenarcClasspath = files(rootProject.jarAll.archivePath) +
-                configurations.compile +
-                files { configurations.codenarc.findAll { !(it.name =~ /groovy|junit/)} }
     }
 
     tasks.withType(Checkstyle) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index be65fba..88f5ab6 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -101,9 +101,7 @@ allprojects {
         }
 
         [uploadArchives, install]*.with {
-            // dependency on jarAllAll should in theory be replaced with jar, jarWithIndy but
-            // in practice, it is faster
-            dependsOn([jarAllAll, sourceJar, javadocJar, groovydocJar])
+            dependsOn([jar, jarWithIndy, sourceJar, javadocJar, groovydocJar])
             doFirst {
                 if (rootProject.useIndy()) {
                     new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
@@ -145,24 +143,11 @@ allprojects {
 // we don't want them in the root project so add them as artifacts with a modified name
 // we'll exclude the original artifacts during publication with an exclude pattern
 [uploadArchives, install]*.with {
-    dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin, distDoc, dist, distBin])
+    dependsOn([sourceJar, javadocJar, groovydocJar, distBin, distDoc, dist, distBin])
     doFirst {
-        project.artifacts.add('archives', jarAll) {
-            name = 'groovy-all'
-        }
-        project.artifacts.add('archives', sourceAllJar) {
-            name = 'groovy-all'
-        }
-        project.artifacts.add('archives', javadocAllJar) {
-            name = 'groovy-all'
-        }
-        project.artifacts.add('archives', groovydocAllJar) {
-            name = 'groovy-all'
-        }
         project.artifacts.add('archives', distBin) {
             name = 'groovy-binary'
         }
-        signArchiveTask(jarAll)
         signArchiveTask(sourceAllJar)
         signArchiveTask(javadocAllJar)
         signArchiveTask(groovydocAllJar)
@@ -202,17 +187,6 @@ allprojects {
                 }
             }
         }
-
-        def indyJar = deriveFile(jarAll.archivePath, 'indy')
-        if (indyJar.exists()) {
-            project.artifacts.add('archives', indyJar)
-            signWithClassifier('indy', indyJar)
-        }
-        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
-        if (grooidJar.exists()) {
-            project.artifacts.add('archives', grooidJar)
-            signWithClassifier('grooid', grooidJar)
-        }
     }
 }
 
@@ -237,10 +211,6 @@ ext.pomAll = {
     // regular pom
     def groovypom = pom('groovy', pomConfigureClosure)
 
-    // pom for 'all'
-    def allpom = pom('all', pomConfigureClosure)
-    allpom.artifactId = 'groovy-all'
-
     // pom for binary zip
     def binarypom = pom('binary', pomConfigureClosureWithoutTweaks)
     binarypom.artifactId = 'groovy-binary'
@@ -255,20 +225,7 @@ ext.pomAll = {
         }
     }
 
-    modules().each { sp ->
-        sp.install.repositories.mavenInstaller.pom.whenConfigured { subpom ->
-            // add dependencies of other modules
-            allpom.dependencies.addAll(subpom.dependencies)
-        }
-        sp.uploadArchives.repositories.mavenDeployer.pom.whenConfigured { subpom ->
-            // add dependencies of other modules
-            allpom.dependencies.addAll(subpom.dependencies)
-        }
-    }
-
-
     groovypom.whenConfigured(removeJarjaredDependencies)
-    allpom.whenConfigured(removeJarjaredDependencies)
 
     binarypom.whenConfigured { p ->
         p.dependencies.clear()

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/src/main/org/codehaus/groovy/tools/DgmConverter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/DgmConverter.java b/src/main/org/codehaus/groovy/tools/DgmConverter.java
index 0965c92..ba714bb 100644
--- a/src/main/org/codehaus/groovy/tools/DgmConverter.java
+++ b/src/main/org/codehaus/groovy/tools/DgmConverter.java
@@ -29,6 +29,7 @@ import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 
+import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -92,7 +93,9 @@ public class DgmConverter implements Opcodes {
             cw.visitEnd();
 
             final byte[] bytes = cw.toByteArray();
-            final FileOutputStream fileOutputStream = new FileOutputStream(targetDirectory + className + ".class");
+            File targetFile = new File(targetDirectory + className + ".class").getCanonicalFile();
+            targetFile.getParentFile().mkdirs();
+            final FileOutputStream fileOutputStream = new FileOutputStream(targetFile);
             fileOutputStream.write(bytes);
             fileOutputStream.flush();
             fileOutputStream.close();

http://git-wip-us.apache.org/repos/asf/groovy/blob/9e39eed4/subprojects/performance/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/performance/build.gradle b/subprojects/performance/build.gradle
index 099f3ac..b4c089e 100644
--- a/subprojects/performance/build.gradle
+++ b/subprojects/performance/build.gradle
@@ -51,7 +51,7 @@ task performanceTests {
     ext.outputDir = file("$buildDir/compilation")
     ext.dataFile = file("$buildDir/compilation-stats.csv")
 
-    dependsOn rootProject.jarAll
+    dependsOn rootProject.jar
     doLast {
         ext.outputDir.deleteDir()
         def versions = []
@@ -80,7 +80,7 @@ task performanceTests {
         dependsOn compileTestJava
         def groovyConf = configurations.detachedConfiguration(
                 dependencies.create(
-                        'current' == version ? files(rootProject.jarAll.archivePath) : "org.codehaus.groovy:groovy-all:$version")
+                        'current' == version ? files(rootProject.jar.archivePath) : "org.codehaus.groovy:groovy:$version")
         )
         groovyConf.transitive = false
         main = 'org.apache.groovy.perf.CompilerPerformanceTest'


[06/13] groovy git commit: Re-introduce an `all` module, which is now using `pom` packaging

Posted by cc...@apache.org.
Re-introduce an `all` module, which is now using `pom` packaging

Unfortunately this doesn't seem to work unless we have at least one artifact.


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

Branch: refs/heads/master
Commit: af49c2e700641649ad344f9f500bd5ce16d92265
Parents: 9e39eed
Author: Cedric Champeau <cc...@apache.org>
Authored: Sun Dec 10 22:22:51 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/upload.gradle | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/af49c2e7/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 88f5ab6..6078d01 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -143,7 +143,7 @@ allprojects {
 // we don't want them in the root project so add them as artifacts with a modified name
 // we'll exclude the original artifacts during publication with an exclude pattern
 [uploadArchives, install]*.with {
-    dependsOn([sourceJar, javadocJar, groovydocJar, distBin, distDoc, dist, distBin])
+    dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin, distDoc, dist, distBin])
     doFirst {
         project.artifacts.add('archives', distBin) {
             name = 'groovy-binary'
@@ -197,7 +197,8 @@ ext.pomAll = {
                 !(artifact.name.contains('backport'))
     }
     addFilter('all') { artifact, file ->
-        artifact.name.contains('groovy-all')
+        // add an arbitrary artifact, so that the pom file is generated
+        artifact.name.contains('groovy-binary')
     }
     addFilter('binary') { artifact, file ->
         artifact.name.contains('groovy-binary')
@@ -231,6 +232,25 @@ ext.pomAll = {
         p.dependencies.clear()
     }
 
+    // pom for "all" dependencies
+    def allpom = pom('all', pomConfigureClosureWithoutTweaks)
+    allpom.artifactId = 'groovy-all'
+    allpom.packaging = 'pom'
+    allpom.whenConfigured { p ->
+        // this is the only way to get a handle on `maven.Dependency`
+        def dependencyClass = p.dependencies[0].getClass()
+        p.dependencies.clear()
+        allprojects {
+            if (it.name.startsWith('groovy')) {
+                def dep = dependencyClass.newInstance()
+                dep.groupId = 'org.codehaus.groovy'
+                dep.artifactId = it.name
+                dep.version = version
+                p.dependencies.add(dep)
+            }
+        }
+    }
+
     beforeDeployment { MavenDeployment deployment -> if (isReleaseVersion) signing.signPom(deployment) }
 }
 


[02/13] groovy git commit: Fix Groovy Sql indy tests missing sources

Posted by cc...@apache.org.
Fix Groovy Sql indy tests missing sources


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

Branch: refs/heads/master
Commit: fe90fdad74761d5bfcce2d256f1a6370f62b2919
Parents: 17459f4
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 13:54:40 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 subprojects/groovy-sql/build.gradle | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/fe90fdad/subprojects/groovy-sql/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/build.gradle b/subprojects/groovy-sql/build.gradle
index 6c911a5..b872f66 100644
--- a/subprojects/groovy-sql/build.gradle
+++ b/subprojects/groovy-sql/build.gradle
@@ -25,12 +25,11 @@ dependencies {
     testCompile project(':groovy-test')
 }
 
-// required for DataSet tests
-sourceSets.test.runtimeClasspath += files('src/test/groovy')
-
 // TODO move to parent build.gradle subprojects
 tasks.withType(Test) {
     excludes = ['**/*TestCase.class', '**/*$*.class']
+// required for DataSet tests
+    classpath = classpath + files('src/test/groovy')
 }
 
 task moduleDescriptor(type: org.codehaus.groovy.gradle.WriteExtensionDescriptorTask) {


[10/13] groovy git commit: Add a couple of missing jvm args when running tests

Posted by cc...@apache.org.
Add a couple of missing jvm args when running tests


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

Branch: refs/heads/master
Commit: 17459f47e654e0c3afc46c015761140c8c52f48e
Parents: a0fdf6a
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 13:51:08 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/jdk9.gradle                     | 2 +-
 subprojects/parser-antlr4/build.gradle | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/17459f47/gradle/jdk9.gradle
----------------------------------------------------------------------
diff --git a/gradle/jdk9.gradle b/gradle/jdk9.gradle
index eb8dfd3..3f4e6b9 100644
--- a/gradle/jdk9.gradle
+++ b/gradle/jdk9.gradle
@@ -21,7 +21,7 @@ if (JavaVersion.current().java9Compatible) {
         tasks.withType(GroovyCompile) {
             groovyOptions.forkOptions.jvmArgs.addAll(['--add-modules', 'java.xml.bind'])
         }
-        test {
+        tasks.withType(Test) {
             jvmArgs '--add-modules', 'java.xml.bind'
         }
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/17459f47/subprojects/parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/build.gradle b/subprojects/parser-antlr4/build.gradle
index 214d4d6..09a2adf 100644
--- a/subprojects/parser-antlr4/build.gradle
+++ b/subprojects/parser-antlr4/build.gradle
@@ -73,6 +73,6 @@ sourceSets.test.groovy.srcDirs += file("$srcTest/groovy");
 sourceSets.test.resources.srcDirs += file("$srcTest/resources");
 
 
-test {
+tasks.withType(Test) {
     jvmArgs "-Dgroovy.attach.groovydoc=true", "-Dgroovy.antlr4.cache.threshold=100"
 }
\ No newline at end of file


[07/13] groovy git commit: Rework how the "indy" jars are built

Posted by cc...@apache.org.
Rework how the "indy" jars are built

This gets rid of the ugly `GradleBuild` call which was extremely slow and causes cache misses. This still lacks
support for running tests with indy, it will be added in a subsequent commit.


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

Branch: refs/heads/master
Commit: e94d43ee410106c2d2bc7f165b844aa792515391
Parents: af49c2e
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 00:48:03 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 build.gradle                         |  33 ++---
 gradle.properties                    |   3 +
 gradle/assemble.gradle               | 233 ++++++++++++++----------------
 gradle/binarycompatibility.gradle    |   2 +-
 gradle/indy.gradle                   |  53 -------
 gradle/test.gradle                   |   8 -
 gradle/upload.gradle                 |  17 +--
 subprojects/performance/build.gradle |   1 -
 8 files changed, 128 insertions(+), 222 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 580fb0e..a50b24b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -79,7 +79,6 @@ apply plugin: "com.github.jk1.dependency-license-report"
 
 File javaHome = new File(System.getProperty('java.home'))
 logger.lifecycle "Using Java from $javaHome (version ${System.getProperty('java.version')})"
-indyBanner()
 
 allprojects {
     apply plugin: 'java'
@@ -424,8 +423,6 @@ task bootstrapJar(type:Jar ) {
     from compileJava.destinationDir
     from dgmConverter.outputDir
 
-    inputs.property('indy', useIndy())
-
     destinationDir = file("$buildDir/bootstrap")
     classifier = 'bootstrap'
 }
@@ -438,6 +435,15 @@ allprojects {
         options.encoding = 'UTF-8'
     }
 
+    task compileGroovyWithIndy(type:GroovyCompile) {
+        source = sourceSets.main.groovy
+        classpath = compileGroovy.classpath
+        sourceCompatibility = 1.8
+        targetCompatibility = 1.8
+        groovyOptions.optimizationOptions['indy'] = true
+        destinationDir = file("$buildDir/classes/indy")
+    }
+
     tasks.withType(GroovyCompile) {
         groovyOptions.fork(memoryMaximumSize: groovycMain_mx)
         groovyOptions.encoding = 'UTF-8'
@@ -449,27 +455,6 @@ allprojects {
         // TODO: this null check was required after adding JMH plugin to performance project
         classpath = (classpath != null) ? classpath + groovyClasspath : groovyClasspath
     }
-
-    if (useIndy()) {
-        tasks.withType(GroovyCompile) {
-            logger.info("Building ${project.name}:${name} with InvokeDynamic support activated")
-            groovyOptions.optimizationOptions.indy = true
-            sourceCompatibility = 1.8
-            targetCompatibility = 1.8
-        }
-        tasks.withType(JavaCompile) {
-            if (project.name=='performance') {
-                sourceCompatibility = 1.8
-                targetCompatibility = 1.8
-            } else {
-                sourceCompatibility = 1.8
-                targetCompatibility = 1.8
-            }
-        }
-        jar {
-            classifier = 'indy'
-        }
-    }
 }
 
 compileTestGroovy {

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index 058b5eb..54141a8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -34,3 +34,6 @@ javaDoc_mx=1g
 #org.gradle.jvmargs=-ea -Xmx1500m
 # jdk 6-8
 org.gradle.jvmargs=-Xms800m -Xmx1500m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
+
+# enable the Gradle build cache
+org.gradle.caching=true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 762b043..470c8aa 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -132,111 +132,121 @@ ext.subprojectOsgiManifest = {
     classpath = sourceSets.main.runtimeClasspath
 }
 
-jar {
-    dependsOn('dgmConverter')
-    from files(dgmConverter.outputDir)
-    metaInf {
-        from("$projectDir/licenses/LICENSE-JARJAR")
-        from("$projectDir/licenses") {
-            into('licenses')
-            include('asm-license.txt')
-            include('antlr2-license.txt')
-            include('antlr4-license.txt')
-        }
-        from("$projectDir/notices/NOTICE-JARJAR")
-        from('src/resources/META-INF/groovy-release-info.properties') {
-            filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
+allprojects {
+    jar {
+        appendix = 'raw'
+    }
+    task jarWithIndy(type: Jar) {
+        dependsOn compileGroovyWithIndy
+        classifier = 'indy'
+        appendix = 'raw'
+        from sourceSets.main.java.outputDir
+        from compileGroovyWithIndy.destinationDir
+    }
+    [jar, jarWithIndy].each { arch ->
+        arch.metaInf {
+            from("$projectDir/licenses/LICENSE-JARJAR")
+            from("$projectDir/licenses") {
+                into('licenses')
+                include('asm-license.txt')
+                include('antlr2-license.txt')
+                include('antlr4-license.txt')
+            }
+            from("$projectDir/notices/NOTICE-JARJAR")
+            from('src/resources/META-INF/groovy-release-info.properties') {
+                filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
+            }
+            rename { String filename -> filename == 'LICENSE-JARJAR' ? 'LICENSE' : filename == 'NOTICE-JARJAR' ? 'NOTICE' : filename }
         }
-        rename { String filename -> filename == 'LICENSE-JARJAR' ? 'LICENSE' : filename == 'NOTICE-JARJAR' ? 'NOTICE' : filename }
-    }
-    exclude '**/package-info.class'
-}
+        arch.exclude '**/package-info.class'
 
-allprojects {
-    task jarjar(type:Jar, dependsOn: jar) {
-        destinationDir = jar.destinationDir
-        baseName = jar.baseName
-        appendix = jar.appendix?"${jar.appendix}-jarjar":"jarjar"
-        classifier = jar.classifier
-        includeEmptyDirs = false
-        def target = new File("${archivePath}.tmp")
-        def targetTmp = new File("${archivePath}.tmp.1.tmp")
-
-        doFirst {
-            from zipTree(target)
-
-            def keepUntouched = [
-                    'org/codehaus/groovy/cli/GroovyPosixParser*.class',
-                    'groovy/util/CliBuilder*.class',
-                    'groovy/util/OptionAccessor*.class',
-                    'org/codehaus/groovy/tools/shell/util/HelpFormatter*.class'
-            ].join(',')
-            boolean isRoot = project == rootProject
-            def gradleProject = project
-            ant {
-                taskdef name: 'jarjar', classname: jarjarTaskClassName, classpath: rootProject.configurations.tools.asPath
-                jarjar(jarfile: targetTmp) {
-                    zipfileset(
-                            src: jar.archivePath,
-                            excludes: keepUntouched)
-
-                    // only groovy core will include the dependencies repackaged
-                    if (isRoot) {
-                        configurations.runtime.files.findAll { file ->
-                            ['antlr', 'asm', 'commons-cli'].any {
-                                file.name.startsWith(it)
-                            } && ['asm-attr', 'asm-util', 'asm-analysis'].every { !file.name.startsWith(it) }
-                        }.each { jarjarFile ->
-                            // explanation of excludes:
-                            // GROOVY-7386: stop copy of incorrect maven meta info
-                            // GROOVY-8332: stop copy of annotation processor which is for some reason included in antlr runtime artifact
-                            // GROOVY-8387: we don't want module-info.class from any dependencies
-                            zipfileset(src: jarjarFile,
-                                    excludes: 'META-INF/maven/commons-cli/commons-cli/*,META-INF/*,META-INF/services/javax.annotation.processing.Processor,module-info.class')
-                        }
+        task "jar${arch.name}"(type:Jar, dependsOn: arch) {
+            outputs.cacheIf {
+                // caching JarJar because it's quite expensive to create
+                true
+            }
+            destinationDir = arch.destinationDir
+            baseName = arch.baseName
+            classifier = arch.classifier
+            includeEmptyDirs = false
+            def target = new File("${archivePath}.tmp")
+            def targetTmp = new File("${archivePath}.tmp.1.tmp")
+            inputs.file(arch.archivePath)
+
+            doFirst {
+                from zipTree(target)
 
-                        zipfileset(src: configurations.runtime.files.find { file -> file.name.startsWith('asm-util') },
-                                includes: 'org/objectweb/asm/util/Printer.class,org/objectweb/asm/util/Textifier.class,org/objectweb/asm/util/ASMifier.class,org/objectweb/asm/util/Trace*')
+                def keepUntouched = [
+                        'org/codehaus/groovy/cli/GroovyPosixParser*.class',
+                        'groovy/util/CliBuilder*.class',
+                        'groovy/util/OptionAccessor*.class',
+                        'org/codehaus/groovy/tools/shell/util/HelpFormatter*.class'
+                ].join(',')
+                boolean isRoot = project == rootProject
+                def gradleProject = project
+                ant {
+                    taskdef name: 'jarjar', classname: jarjarTaskClassName, classpath: rootProject.configurations.tools.asPath
+                    jarjar(jarfile: targetTmp) {
+                        zipfileset(
+                                src: arch.archivePath,
+                                excludes: keepUntouched)
+
+                        // only groovy core will include the dependencies repackaged
+                        if (isRoot) {
+                            configurations.runtime.files.findAll { file ->
+                                ['antlr', 'asm', 'commons-cli'].any {
+                                    file.name.startsWith(it)
+                                } && ['asm-attr', 'asm-util', 'asm-analysis'].every { !file.name.startsWith(it) }
+                            }.each { jarjarFile ->
+                                // explanation of excludes:
+                                // GROOVY-7386: stop copy of incorrect maven meta info
+                                // GROOVY-8332: stop copy of annotation processor which is for some reason included in antlr runtime artifact
+                                // GROOVY-8387: we don't want module-info.class from any dependencies
+                                zipfileset(src: jarjarFile,
+                                        excludes: 'META-INF/maven/commons-cli/commons-cli/*,META-INF/*,META-INF/services/javax.annotation.processing.Processor,module-info.class')
+                            }
+
+                            zipfileset(src: configurations.runtime.files.find { file -> file.name.startsWith('asm-util') },
+                                    includes: 'org/objectweb/asm/util/Printer.class,org/objectweb/asm/util/Textifier.class,org/objectweb/asm/util/ASMifier.class,org/objectweb/asm/util/Trace*')
+                        }
+                        rule pattern: 'antlr.**', result: 'groovyjarjarantlr.@1' // antlr2
+                        rule pattern: 'org.antlr.**', result: 'groovyjarjarantlr4.@1' // antlr4
+                        rule pattern: 'org.objectweb.**', result: 'groovyjarjarasm.@1'
+                        rule pattern: 'org.apache.commons.cli.**', result: 'groovyjarjarcommonscli.@1'
                     }
-                    rule pattern: 'antlr.**', result: 'groovyjarjarantlr.@1' // antlr2
-                    rule pattern: 'org.antlr.**', result: 'groovyjarjarantlr4.@1' // antlr4
-                    rule pattern: 'org.objectweb.**', result: 'groovyjarjarasm.@1'
-                    rule pattern: 'org.apache.commons.cli.**', result: 'groovyjarjarcommonscli.@1'
                 }
-            }
 
-            def manifestSpec = isRoot ? groovyOsgiManifest : subprojectOsgiManifest
-            manifest = osgiManifest {
-                symbolicName = gradleProject.name
-                instruction 'Import-Package', '*;resolution:=optional'
-                classesDir = targetTmp
-                def moduleName = "org.codehaus.${it.name.replace('-', '.')}"
-                attributes('Automatic-Module-Name': moduleName)
-            }
-            manifest(manifestSpec)
+                def manifestSpec = isRoot ? groovyOsgiManifest : subprojectOsgiManifest
+                manifest = osgiManifest {
+                    symbolicName = gradleProject.name
+                    instruction 'Import-Package', '*;resolution:=optional'
+                    classesDir = targetTmp
+                    def moduleName = "org.codehaus.${it.name.replace('-', '.')}"
+                    attributes('Automatic-Module-Name': moduleName)
+                }
+                manifest(manifestSpec)
 
-            def manifestPath = "${temporaryDir}/META-INF/MANIFEST.MF"
-            manifest.writeTo(manifestPath)
+                def manifestPath = "${temporaryDir}/META-INF/MANIFEST.MF"
+                manifest.writeTo(manifestPath)
 
-            ant.copy(file: targetTmp, tofile: target)
-            ant.jar(destfile: target, update: true, manifest: manifestPath) {
-                zipfileset(
-                        src: jar.archivePath,
-                        includes: keepUntouched)
-            }
+                ant.copy(file: targetTmp, tofile: target)
+                ant.jar(destfile: target, update: true, manifest: manifestPath) {
+                    zipfileset(
+                            src: arch.archivePath,
+                            includes: keepUntouched)
+                }
 
+            }
+            doLast {
+                target.delete()
+                ant.delete(file: targetTmp, quiet: true, deleteonexit: true)
+            }
         }
-        doLast {
-            target.delete()
-            ant.delete(file: targetTmp, quiet: true, deleteonexit: true)
-        }
+
     }
 
     if (project.name in ['groovy', 'groovy-test']) {
         task grooidjar(type: Jar) {
-            onlyIf {
-                !rootProject.useIndy()
-            }
             destinationDir = jar.destinationDir
             baseName = jar.baseName
             appendix = jar.appendix
@@ -270,6 +280,11 @@ allprojects {
     }
 }
 
+[jar, jarWithIndy].each {
+    it.dependsOn('dgmConverter')
+    it.from files(dgmConverter.outputDir)
+}
+
 subprojects { sp ->
     jar {
         metaInf {
@@ -292,35 +307,8 @@ subprojects { sp ->
     }
 }
 
-task replaceJarWithJarJar(dependsOn: allprojects.jarjar ) {
-    description = "Overwrites normal JAR files with their JARJAR version"
-    doLast {
-        allprojects {
-            def jarjarFile = tasks.jarjar.archivePath
-            if (jarjarFile) {
-                file(jar.archivePath).delete()
-                ant.copy(file: jarjarFile, tofile: jar.archivePath)
-                jarjarFile.delete()
-            }
-        }
-    }
-    inputs.files(allprojects.jarjar.archivePath)
-    outputs.files(allprojects.jar.archivePath)
-}
-
 allprojects {
-    rootProject.replaceJarWithJarJar.mustRunAfter(test)
-}
-
-allprojects {
-    task jarWithIndy(type: GradleBuild) {
-        onlyIf rootProject.indyCapable
-        description = 'Triggers an external build generating the indy jar'
-        buildFile = 'build.gradle'
-        startParameter.projectProperties['indy'] = true
-        startParameter.projectCacheDir = file("$buildDir/indyCacheDir")
-        tasks = ['jar']
-    }
+    rootProject.jarjar.mustRunAfter(test)
 }
 
 task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar + rootProject.sourceJar }) {
@@ -329,29 +317,24 @@ task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar + rootProject.sou
         with it.rootSpec
     }
     baseName = 'groovy-all'
-    classifier = rootProject.useIndy() ? 'indy-sources' : 'sources'
 }
 
 allprojects {
     task javadocJar(type: Jar, dependsOn: javadoc) {
-        classifier = rootProject.useIndy() ? 'indy-javadoc' : 'javadoc'
         from javadoc.destinationDir
     }
     task groovydocJar(type: Jar, dependsOn: groovydoc) {
-        classifier = rootProject.useIndy() ? 'indy-groovydoc' : 'groovydoc'
         from groovydoc.destinationDir
     }
 }
 
 task javadocAllJar(type: Jar, dependsOn: javadocAll) {
     baseName = 'groovy-all'
-    classifier = rootProject.useIndy() ? 'indy-javadoc' : 'javadoc'
     from javadocAll.destinationDir
 }
 
 task groovydocAllJar(type: Jar, dependsOn: groovydocAll) {
     baseName = 'groovy-all'
-    classifier = rootProject.useIndy() ? 'indy-groovydoc' : 'groovydoc'
     from groovydocAll.destinationDir
 }
 
@@ -419,7 +402,7 @@ ext.distSpec = copySpec {
     }
 }
 
-task distBin(type: Zip, dependsOn: [jar, replaceJarWithJarJar]) {
+task distBin(type: Zip, dependsOn: [jarjar]) {
     baseName = 'apache-groovy'
     appendix = 'binary'
     into("groovy-$version") {

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle/binarycompatibility.gradle
----------------------------------------------------------------------
diff --git a/gradle/binarycompatibility.gradle b/gradle/binarycompatibility.gradle
index b822d11..7ed12df 100644
--- a/gradle/binarycompatibility.gradle
+++ b/gradle/binarycompatibility.gradle
@@ -147,7 +147,7 @@ allprojects {
         }
 
         task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask) {
-            dependsOn replaceJarWithJarJar
+            dependsOn jarjar
             baseline = "org.codehaus.groovy:${project.name}:${referenceMinorVersion}@jar"
             to = jar.archivePath
             accessModifier = 'protected'

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle/indy.gradle
----------------------------------------------------------------------
diff --git a/gradle/indy.gradle b/gradle/indy.gradle
index 75b7422..f2262c1 100644
--- a/gradle/indy.gradle
+++ b/gradle/indy.gradle
@@ -23,56 +23,3 @@
 rootProject.ext.indyCapable = {
     !rootProject.hasProperty('skipIndy')
 }
-
-rootProject.ext.useIndy = {
-    boolean indy = false
-
-    // first, check if a system property activates indy support
-    indy |= System.hasProperty('indy') && Boolean.valueOf(System.getProperty('indy'))
-
-    // ultimately, check if the main project has an extension property setting indy to true
-    // which is the case if the build is started with -Pindy=true or during install/dist tasks
-    indy |= rootProject.hasProperty('indy') && (Boolean.valueOf(rootProject.indy))
-
-    indy && rootProject.indyCapable()
-}
-rootProject.ext.indyBanner = {
-    if (project==rootProject && useIndy()) {
-        logger.lifecycle '''
-
-         DM .N$?
-          $I?7OM.
-        .7+?II77MZ       ,:~~
-        +I$7O$8?  .M..DMMNNMMNZ.
-         ONDOMI.     7MMMMMMOO$I.
-         DOM87=      ZMNM8NMI77$.
-    .MNDO?$8$?       8MMNMMMN7II.
-   MMMO. O$7Z.   OI8?MDNNM$$$$7OM
-    M8  ZZ7$.    MMMMMDD7I77I777MMMM.
-       ZZ$7$     DMM$N$ZNMZDMODNDM. DD
-     .Z$$I$$       .ZI777777II778     ?D.
-    8$$7I$I+         .$I7?I7II7D.       ?Z
-   .O$$7I$78         N77O+??I?$.          Z
-   =7$7777$7 .    .=7NZ?I$7I+$.             O
-  ~:7$$7$7D+$~:=Z:=~++77Z$?IIZ~.             N
-  $Z$7O8D8=Z8I7==I~I:+~OZ887$MOI$O           .7
-  :O$I+~=?:O8?I$=++=:===Z$77ZN++$+~.          Z.
-   :7$78ZZZZZ=ZZ$~?==~+DD$8O$OO$7+?:.         $
-    .=~=+Z7I7?7I$+~=:~+~O~???77?~+??~         O
-        +=IZ7$7OI$=Z:~:~=8I?I?+$Z8++:        N.
-          =$+8ZO$$==+=~=?=8$IIIIID$ZZ.      Z
-
-                   INDY ENABLED !
-'''
-
-    }
-}
-
-if (useIndy()) {
-    gradle.taskGraph.whenReady { graph ->
-        graph.allTasks.findAll { it instanceof org.gradle.process.JavaForkOptions }.unique().each { task ->
-            logger.debug "Adding indy target to project ${task.project.name} task ${task.name}"
-            task.systemProperties 'groovy.target.indy': true
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle/test.gradle
----------------------------------------------------------------------
diff --git a/gradle/test.gradle b/gradle/test.gradle
index a61d75f..e91a9a8 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -16,9 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-
-import org.apache.tools.ant.taskdefs.condition.Os
-
 allprojects {
     test {
         if (JavaVersion.current().isJava8Compatible()) {
@@ -89,11 +86,6 @@ tasks.addRule('Pattern: testSingle<Name> will test **/<Name>.class') { String ta
 def buildExcludeFilter() {
     def excludes = []
 
-    // if not compiled with indy support, disable indy tests
-    if (!rootProject.useIndy()) {
-        excludes += ['indy', 'Indy']
-    }
-
     // if no network available, disable Grapes
     if (!System.properties['junit.network']) {
         excludes  << 'groovy/grape/'

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 6078d01..683a6d3 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -94,23 +94,20 @@ allprojects {
         }
 
         artifacts {
-            archives jar
+            archives jarjar
             archives sourceJar
             archives javadocJar
             archives groovydocJar
         }
 
+        configurations.archives.with {
+            artifacts.removeAll(artifacts.find { it.name =~ 'raw' } )
+        }
+
         [uploadArchives, install]*.with {
-            dependsOn([jar, jarWithIndy, sourceJar, javadocJar, groovydocJar])
+            dependsOn([jar, jarjarWithIndy, sourceJar, javadocJar, groovydocJar])
             doFirst {
-                if (rootProject.useIndy()) {
-                    new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
-                            + ' on because the build handles indy artifacts by itself in that case.')
-                }
-                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-                if (indyJar.exists()) {
-                    project.artifacts.add('archives', indyJar)
-                }
+                project.artifacts.add('archives', jarjarWithIndy)
                 def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
                 if (grooidJar.exists()) {
                     project.artifacts.add('archives', grooidJar)

http://git-wip-us.apache.org/repos/asf/groovy/blob/e94d43ee/subprojects/performance/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/performance/build.gradle b/subprojects/performance/build.gradle
index b4c089e..d1f5ff4 100644
--- a/subprojects/performance/build.gradle
+++ b/subprojects/performance/build.gradle
@@ -40,7 +40,6 @@ jmh {
         include = ['.*' + project.benchInclude + '.*']
     }
     includeTests = true
-    resultsFile = project.file("target/results${useIndy() ? '_indy' : ''}.txt")
 }
 jmhClasses.dependsOn clean
 


[12/13] groovy git commit: Cache asciidoctor tasks

Posted by cc...@apache.org.
Cache asciidoctor tasks


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

Branch: refs/heads/master
Commit: a0fdf6aa3e932853a5d4c5a4e4043792f7bc4ccf
Parents: 51185f7
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 11:32:56 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 build.gradle | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a0fdf6aa/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 22aedeb..7d203b4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -104,6 +104,10 @@ allprojects {
         apply from: "${rootProject.projectDir}/gradle/asciidoctor.gradle"
     }
 
+    tasks.withType(org.asciidoctor.gradle.AsciidoctorTask) {
+        outputs.cacheIf { true }
+    }
+
     tasks.withType(GroovyCompile) {
         groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4.cache.threshold=100"]
     }


[03/13] groovy git commit: Introduce an indy specific test suite

Posted by cc...@apache.org.
Introduce an indy specific test suite

The build now integrates a `testWithIndy` test suite. It is possible to execute both the legacy
and the indy test suites by calling `testAll`.


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

Branch: refs/heads/master
Commit: 88fed129f7741259de5fc66fcc06148ba791a456
Parents: cb0be34
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 10:39:33 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/assemble.gradle              |  2 +-
 gradle/test.gradle                  | 46 +++++++++++++++++++++++++-------
 subprojects/groovy-sql/build.gradle |  2 +-
 3 files changed, 39 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/88fed129/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 0d6bd78..5f8e5af 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -208,7 +208,7 @@ allprojects {
                                 // GROOVY-8332: stop copy of annotation processor which is for some reason included in antlr runtime artifact
                                 // GROOVY-8387: we don't want module-info.class from any dependencies
                                 zipfileset(src: jarjarFile,
-                                        excludes: 'META-INF/maven/commons-cli/commons-cli/*,META-INF/*,META-INF/services/javax.annotation.processing.Processor,module-info.class')
+                                        excludes: 'META-INF/maven/*,META-INF/*,META-INF/services/javax.annotation.processing.Processor,module-info.class')
                             }
 
                             zipfileset(src: configurations.runtime.files.find { file -> file.name.startsWith('asm-util') },

http://git-wip-us.apache.org/repos/asf/groovy/blob/88fed129/gradle/test.gradle
----------------------------------------------------------------------
diff --git a/gradle/test.gradle b/gradle/test.gradle
index e91a9a8..176530d 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 allprojects {
-    test {
+    tasks.withType(Test) {
         if (JavaVersion.current().isJava8Compatible()) {
             jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}"
         } else {
@@ -39,6 +39,27 @@ allprojects {
         }
     }
 
+    // create an Indy test suite
+    if (rootProject.indyCapable()) {
+        def dependencies = configurations.testRuntime.incoming.dependencies.findAll {
+            it.name.startsWith('groovy')
+        }.collect {
+            it.name
+        }
+        task testWithIndy(type: Test) {
+            systemProperties 'groovy.target.indy': true
+            dependsOn 'jarWithIndy'
+            dependencies.each { dependsOn "${it}:jarWithIndy" }
+            classpath = classpath - files(jar.archivePath, *dependencies.collect { project(it).jar }) +
+                    files({ [jarWithIndy.archivePath, *dependencies.collect { project(it).jarWithIndy }] })
+        }
+        task testAll {
+            description = "Runs both the normal and indy test suites"
+            dependsOn test, testWithIndy
+        }
+        check.dependsOn testWithIndy
+    }
+
     sourceSets {
         test {
             groovy {
@@ -51,7 +72,7 @@ allprojects {
     }
 }
 
-test {
+tasks.withType(Test) {
     def testdb = System.properties['groovy.testdb.props']
     if (testdb) {
         systemProperties 'groovy.testdb.props': testdb
@@ -60,7 +81,7 @@ test {
     systemProperties 'gradle.home': gradle.gradleHomeDir // this is needed by the security.policy
 
     classpath = files('src/test') + classpath
-    exclude buildExcludeFilter()
+    exclude buildExcludeFilter(it.name == 'test')
     ext.resultText = ''
     doLast {
         ant.delete {
@@ -83,12 +104,17 @@ tasks.addRule('Pattern: testSingle<Name> will test **/<Name>.class') { String ta
     }
 }
 
-def buildExcludeFilter() {
+def buildExcludeFilter(boolean legacyTestSuite) {
     def excludes = []
 
     // if no network available, disable Grapes
     if (!System.properties['junit.network']) {
-        excludes  << 'groovy/grape/'
+        excludes << 'groovy/grape/'
+    }
+
+    if (legacyTestSuite) {
+        // indy tests will only be executed in indy test suite
+        excludes += ['indy', 'Indy']
     }
 
     return { f ->
@@ -104,7 +130,7 @@ ext.extModuleFixtureDir = file("$projectDir/src/test-fixtures/extmodule")
 ext.extModuleOutputDir = file("$buildDir/testFixtures/extmodule")
 ext.extModuleRepoDir = file("$extModuleOutputDir/repo")
 
-task compileTestExtensionModule(type:JavaCompile) {
+task compileTestExtensionModule(type: JavaCompile) {
     classpath = files(jar.archivePath)
     source fileTree("$extModuleFixtureDir/src/main/java")
     destinationDir = file("$extModuleOutputDir/classes")
@@ -112,7 +138,7 @@ task compileTestExtensionModule(type:JavaCompile) {
     targetCompatibility = 1.6
 }
 
-task testExtensionModuleJar(type:Jar) {
+task testExtensionModuleJar(type: Jar) {
     description = 'Builds a sample extension module used in tests'
     dependsOn compileTestExtensionModule
     baseName = 'module-test'
@@ -123,5 +149,7 @@ task testExtensionModuleJar(type:Jar) {
     destinationDir = file("$extModuleRepoDir/jars/module-test/module-test/${version}")
 }
 
-test.dependsOn(testExtensionModuleJar)
-test.classpath += files(extModuleRepoDir)
+tasks.withType(Test) {
+    dependsOn(testExtensionModuleJar)
+    classpath += files(extModuleRepoDir)
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/88fed129/subprojects/groovy-sql/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/build.gradle b/subprojects/groovy-sql/build.gradle
index 27498ae..6c911a5 100644
--- a/subprojects/groovy-sql/build.gradle
+++ b/subprojects/groovy-sql/build.gradle
@@ -29,7 +29,7 @@ dependencies {
 sourceSets.test.runtimeClasspath += files('src/test/groovy')
 
 // TODO move to parent build.gradle subprojects
-test {
+tasks.withType(Test) {
     excludes = ['**/*TestCase.class', '**/*$*.class']
 }
 


[08/13] groovy git commit: Use skipIndy to allow skipping build of indy jars

Posted by cc...@apache.org.
Use skipIndy to allow skipping build of indy jars


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

Branch: refs/heads/master
Commit: 7127f059d517ca6be4ccc217a6ca36c090d82689
Parents: e94d43e
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 08:33:42 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 build.gradle           | 16 +++++++++-------
 gradle/assemble.gradle | 25 +++++++++++++++++--------
 gradle/indy.gradle     |  2 +-
 gradle/upload.gradle   | 13 +++++++++++--
 4 files changed, 38 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7127f059/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a50b24b..22aedeb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -435,13 +435,15 @@ allprojects {
         options.encoding = 'UTF-8'
     }
 
-    task compileGroovyWithIndy(type:GroovyCompile) {
-        source = sourceSets.main.groovy
-        classpath = compileGroovy.classpath
-        sourceCompatibility = 1.8
-        targetCompatibility = 1.8
-        groovyOptions.optimizationOptions['indy'] = true
-        destinationDir = file("$buildDir/classes/indy")
+    if (rootProject.indyCapable()) {
+        task compileGroovyWithIndy(type: GroovyCompile) {
+            source = sourceSets.main.groovy
+            classpath = compileGroovy.classpath
+            sourceCompatibility = 1.8
+            targetCompatibility = 1.8
+            groovyOptions.optimizationOptions['indy'] = true
+            destinationDir = file("$buildDir/classes/indy")
+        }
     }
 
     tasks.withType(GroovyCompile) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/7127f059/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 470c8aa..836659a 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -133,17 +133,21 @@ ext.subprojectOsgiManifest = {
 }
 
 allprojects {
+    def producedJars = [jar]
     jar {
         appendix = 'raw'
     }
-    task jarWithIndy(type: Jar) {
-        dependsOn compileGroovyWithIndy
-        classifier = 'indy'
-        appendix = 'raw'
-        from sourceSets.main.java.outputDir
-        from compileGroovyWithIndy.destinationDir
+    if (rootProject.indyCapable()) {
+        task jarWithIndy(type: Jar) {
+            dependsOn compileGroovyWithIndy
+            classifier = 'indy'
+            appendix = 'raw'
+            from sourceSets.main.java.outputDir
+            from compileGroovyWithIndy.destinationDir
+        }
+        producedJars << jarWithIndy
     }
-    [jar, jarWithIndy].each { arch ->
+    producedJars.each { arch ->
         arch.metaInf {
             from("$projectDir/licenses/LICENSE-JARJAR")
             from("$projectDir/licenses") {
@@ -280,7 +284,12 @@ allprojects {
     }
 }
 
-[jar, jarWithIndy].each {
+def producedJars = [jar]
+if (rootProject.indyCapable()) {
+    producedJars << jarWithIndy
+}
+
+producedJars.each {
     it.dependsOn('dgmConverter')
     it.from files(dgmConverter.outputDir)
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/7127f059/gradle/indy.gradle
----------------------------------------------------------------------
diff --git a/gradle/indy.gradle b/gradle/indy.gradle
index f2262c1..70968ad 100644
--- a/gradle/indy.gradle
+++ b/gradle/indy.gradle
@@ -21,5 +21,5 @@
 // with regards to invoke dynamic support (indy)
 
 rootProject.ext.indyCapable = {
-    !rootProject.hasProperty('skipIndy')
+    !rootProject.hasProperty('skipIndy') && JavaVersion.current().java7Compatible
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/7127f059/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 683a6d3..8588346 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -105,9 +105,14 @@ allprojects {
         }
 
         [uploadArchives, install]*.with {
-            dependsOn([jar, jarjarWithIndy, sourceJar, javadocJar, groovydocJar])
+            dependsOn([jar, sourceJar, javadocJar, groovydocJar])
+            if (rootProject.indyCapable()) {
+                dependsOn jarjarWithIndy
+            }
             doFirst {
-                project.artifacts.add('archives', jarjarWithIndy)
+                if (rootProject.indyCapable()) {
+                    project.artifacts.add('archives', jarjarWithIndy)
+                }
                 def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
                 if (grooidJar.exists()) {
                     project.artifacts.add('archives', grooidJar)
@@ -142,6 +147,10 @@ allprojects {
 [uploadArchives, install]*.with {
     dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin, distDoc, dist, distBin])
     doFirst {
+        if (!rootProject.indyCapable()) {
+            throw new GradleException("You must run with JDK 7+ to upload archives")
+        }
+
         project.artifacts.add('archives', distBin) {
             name = 'groovy-binary'
         }


[11/13] groovy git commit: Fix generated resources missing from indy jar

Posted by cc...@apache.org.
Fix generated resources missing from indy jar


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

Branch: refs/heads/master
Commit: cb0be344a941059b009dc0761cbf5dc428e8e6e0
Parents: 7127f05
Author: Cedric Champeau <cc...@apache.org>
Authored: Mon Dec 11 10:24:12 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/assemble.gradle | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/cb0be344/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 836659a..0d6bd78 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -144,6 +144,7 @@ allprojects {
             appendix = 'raw'
             from sourceSets.main.java.outputDir
             from compileGroovyWithIndy.destinationDir
+            from "${project.buildDir}/resources/main"
         }
         producedJars << jarWithIndy
     }