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/01/13 15:58:14 UTC

[01/22] groovy git commit: expose checkCompatibility task

Repository: groovy
Updated Branches:
  refs/heads/parrot 68c8c5f45 -> 2f7e354a3


expose checkCompatibility task


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

Branch: refs/heads/parrot
Commit: 370df790d5b32468131b1572f46f3edbfa492d48
Parents: 7dbeb82
Author: paulk <pa...@asert.com.au>
Authored: Tue Dec 27 17:01:23 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Tue Dec 27 17:01:23 2016 +1000

----------------------------------------------------------------------
 build.gradle           | 5 +++++
 gradle/assemble.gradle | 4 ++--
 gradle/upload.gradle   | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/370df790/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2e3dbe3..9ed8d26 100644
--- a/build.gradle
+++ b/build.gradle
@@ -465,6 +465,11 @@ compileTestGroovy {
     groovyOptions.fork(memoryMaximumSize: groovycTest_mx)
 }
 
+// TODO superfluous to check for JDK7 for Gradle version 3.2+ but leave for future?
+task checkCompatibility {
+    assert JavaVersion.current().java7Compatible
+}
+
 apply from: 'gradle/test.gradle'
 apply from: 'gradle/groovydoc.gradle'
 apply from: 'gradle/docs.gradle'

http://git-wip-us.apache.org/repos/asf/groovy/blob/370df790/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 0a3d49e..8922eea 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -577,7 +577,7 @@ def installDir = {
         System.properties.installDirectory ?: "$buildDir/install"
 }
 
-task installGroovy(type: Sync, dependsOn: distBin) {
+task installGroovy(type: Sync, dependsOn: [checkCompatibility, distBin]) {
     description 'Generates a groovy distribution into an install directory'
     doLast {
         logger.lifecycle "Groovy installed under ${installDir()}"
@@ -588,7 +588,7 @@ task installGroovy(type: Sync, dependsOn: distBin) {
 
 import org.gradle.api.file.DuplicatesStrategy
 
-task dist(type: Zip, dependsOn: [distBin, distSrc, distDoc, syncDoc]) {
+task dist(type: Zip, dependsOn: [checkCompatibility, distBin, distSrc, distDoc, syncDoc]) {
     description = 'Generates the binary, sources, documentation and full distributions'
     baseName = 'apache-groovy'
     duplicatesStrategy = DuplicatesStrategy.EXCLUDE

http://git-wip-us.apache.org/repos/asf/groovy/blob/370df790/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index f74a32c..7659a1d 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -35,6 +35,7 @@ def removeJarjaredDependencies = { p ->
 allprojects {
     apply plugin: 'maven'
     apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
+    install.dependsOn checkCompatibility
 }
 
 apply from: 'gradle/backports.gradle'


[10/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (tweaks)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (tweaks)


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

Branch: refs/heads/parrot
Commit: 0b18edae3ee9f1d97a08b5f0f1a4b9eb7938067b
Parents: bd4e2c7
Author: paulk <pa...@asert.com.au>
Authored: Fri Jan 6 10:27:11 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:04:13 2017 +1000

----------------------------------------------------------------------
 build.gradle          |  1 +
 gradle/signing.gradle |  1 +
 gradle/upload.gradle  | 95 ++++++++++++++++++++++++----------------------
 3 files changed, 51 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/0b18edae/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 455edc2..79922b2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -73,6 +73,7 @@ indyBanner()
 //apply plugin: 'antlr'
 
 ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
+ext.shouldSign = isReleaseVersion
 
 allprojects {
     apply plugin: 'java'

http://git-wip-us.apache.org/repos/asf/groovy/blob/0b18edae/gradle/signing.gradle
----------------------------------------------------------------------
diff --git a/gradle/signing.gradle b/gradle/signing.gradle
index 89c3a01..2885163 100644
--- a/gradle/signing.gradle
+++ b/gradle/signing.gradle
@@ -32,6 +32,7 @@ allprojects {
 gradle.taskGraph.whenReady { taskGraph ->
     if (taskGraph.allTasks.any { it instanceof Sign } || project.hasProperty('forceSign')) {
         // Use Java 6's console or Swing to read input (not suitable for CI)
+        project.ext.shouldSign = true
         if (!project.hasProperty('signing.keyId') ||
                 !project.hasProperty('signing.secretKeyRingFile') ||
                 !project.hasProperty('signing.password')) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/0b18edae/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 633df89..5668454 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -31,7 +31,6 @@ def removeJarjaredDependencies = { p ->
     })
 }
 
-
 allprojects {
     apply plugin: 'maven'
     apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
@@ -60,16 +59,13 @@ allprojects {
         }
     }
 
-    configurations {
-        deployerJars
-    }
-
     uploadArchives {
         repositories {
             mavenDeployer {
-                configuration = configurations.deployerJars
                 pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                if (shouldSign) {
+                    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                }
             }
         }
     }
@@ -78,7 +74,9 @@ allprojects {
         repositories {
             mavenInstaller {
                 pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                if (shouldSign) {
+                    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                }
             }
         }
     }
@@ -112,17 +110,19 @@ allprojects {
 
     install {
         doFirst {
-            signArchiveTask(jar)
-            signArchiveTask(sourceJar)
-            signArchiveTask(javadocJar)
-            signArchiveTask(groovydocJar)
-            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-            if (indyJar.exists()) {
-                signWithClassifier('indy', indyJar)
-            }
-            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                signWithClassifier('grooid', grooidJar)
+            if (shouldSign) {
+                signArchiveTask(jar)
+                signArchiveTask(sourceJar)
+                signArchiveTask(javadocJar)
+                signArchiveTask(groovydocJar)
+                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+                if (indyJar.exists()) {
+                    signWithClassifier('indy', indyJar)
+                }
+                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+                if (grooidJar.exists()) {
+                    signWithClassifier('grooid', grooidJar)
+                }
             }
         }
     }
@@ -168,33 +168,35 @@ allprojects {
 
 install {
     doFirst {
-        signArchiveTask(jarAll)
-        signArchiveTask(sourceAllJar)
-        signArchiveTask(javadocAllJar)
-        signArchiveTask(groovydocAllJar)
-        signArchiveTask(distBin)
-
-        // next three are done as a side effect since it was the easiest approach
-        signing.sign(distSrc.archivePath)
-        signing.sign(distDoc.archivePath)
-        signing.sign(dist.archivePath)
-
-        tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
-            signing.sign(t.classifier, t.archivePath)
-            project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
-                name = t.baseName
-                classifier = t.classifier
-                type = t.extension + '.asc'
+        if (shouldSign) {
+            signArchiveTask(jarAll)
+            signArchiveTask(sourceAllJar)
+            signArchiveTask(javadocAllJar)
+            signArchiveTask(groovydocAllJar)
+            signArchiveTask(distBin)
+
+            // next three are done as a side effect since it was the easiest approach
+            signing.sign(distSrc.archivePath)
+            signing.sign(distDoc.archivePath)
+            signing.sign(dist.archivePath)
+
+            tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
+                signing.sign(t.classifier, t.archivePath)
+                project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
+                    name = t.baseName
+                    classifier = t.classifier
+                    type = t.extension + '.asc'
+                }
             }
-        }
 
-        def indyJar = deriveFile(jarAll.archivePath, 'indy')
-        if (indyJar.exists()) {
-            signWithClassifier('indy', indyJar)
-        }
-        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
-        if (grooidJar.exists()) {
-            signWithClassifier('grooid', grooidJar)
+            def indyJar = deriveFile(jarAll.archivePath, 'indy')
+            if (indyJar.exists()) {
+                signWithClassifier('indy', indyJar)
+            }
+            def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
+            if (grooidJar.exists()) {
+                signWithClassifier('grooid', grooidJar)
+            }
         }
     }
 }
@@ -257,7 +259,9 @@ ext.pomAll = {
         p.dependencies.clear()
     }
 
-    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+    if (shouldSign) {
+        beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+    }
 }
 
 install {
@@ -275,4 +279,3 @@ uploadArchives {
         mavenDeployer pomAll
     }
 }
-


[08/22] groovy git commit: Fixing broken bold style (closes #474)

Posted by su...@apache.org.
Fixing broken bold style (closes #474)


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

Branch: refs/heads/parrot
Commit: d32a39b1845653b357d9ff60673169d18e68dd16
Parents: 9ae8607
Author: Aleksei <eg...@gmail.com>
Authored: Mon Jan 2 05:52:54 2017 +0300
Committer: John Wagenleitner <jw...@apache.org>
Committed: Thu Jan 5 20:51:34 2017 -0800

----------------------------------------------------------------------
 src/spec/doc/core-operators.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d32a39b1/src/spec/doc/core-operators.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-operators.adoc b/src/spec/doc/core-operators.adoc
index 7794454..31f409d 100644
--- a/src/spec/doc/core-operators.adoc
+++ b/src/spec/doc/core-operators.adoc
@@ -514,7 +514,7 @@ The position of the spread map operator is relevant, like illustrated in the fol
 include::{projectdir}/src/spec/test/OperatorsTest.groovy[tags=spread_map_position,indent=0]
 ----
 <1> `m1` is the map that we want to inline
-<2> we use the `*:m1` notation to spread the contents of `m1` into `map`, but redefine the key `d` *after* spreading
+<2> we use the `*:m1` notation to spread the contents of `m1` into `map`, but redefine the key `d` **after** spreading
 <3> `map` contains all the expected keys, but `d` was redefined
 
 === Range operator


[15/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (master tweaks)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (master tweaks)


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

Branch: refs/heads/parrot
Commit: d4100459b5957bb8889cf5ef32fc8ed62a9fae3a
Parents: 36a55d1
Author: paulk <pa...@asert.com.au>
Authored: Sat Jan 7 20:04:04 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 20:04:04 2017 +1000

----------------------------------------------------------------------
 gradle/bintray.gradle                     | 2 +-
 subprojects/groovy-templates/build.gradle | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d4100459/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
index 20d4b5d..552934e 100644
--- a/gradle/bintray.gradle
+++ b/gradle/bintray.gradle
@@ -45,8 +45,8 @@ allprojects {
             }
         }
         publish {
+            excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
             repository {
-                excludePatterns = 'org/codehaus/groovy/groovy/*/groovy-all*,org/codehaus/groovy/groovy/*/groovy-backports*,org/codehaus/groovy/groovy/*/groovy-binary*'
                 repoKey = project.hasProperty('bintrayRepoKey') ? project.bintrayRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
                 //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
                 //~/.gradle/gradle.properties, otherwise to be set in the build server

http://git-wip-us.apache.org/repos/asf/groovy/blob/d4100459/subprojects/groovy-templates/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-templates/build.gradle b/subprojects/groovy-templates/build.gradle
index 906f37c..4805b1c 100644
--- a/subprojects/groovy-templates/build.gradle
+++ b/subprojects/groovy-templates/build.gradle
@@ -27,7 +27,7 @@ dependencies {
 }
 
 task backportJar(type:Jar) {
-    name = 'groovy-markup-backport'
+    appendix = 'markup-backport'
     dependsOn classes
     from sourceSets.main.output
     include 'groovy/text/markup/**'


[04/22] groovy git commit: remove checkstyle warnings

Posted by su...@apache.org.
remove checkstyle warnings


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

Branch: refs/heads/parrot
Commit: 3c7c8748a3e2d346a600f87a1941e1de49f8b15e
Parents: 0d5c0b8
Author: paulk <pa...@asert.com.au>
Authored: Thu Dec 29 22:30:38 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Dec 29 22:30:38 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/lang/GroovyClassLoader.java             |  2 +-
 src/main/groovy/lang/ObjectRange.java                   |  2 +-
 src/main/groovy/ui/GroovyMain.java                      |  6 +++---
 src/main/groovy/ui/GroovySocketServer.java              |  4 ++--
 src/main/groovy/util/ConfigObject.java                  |  2 +-
 src/main/org/apache/groovy/metaclass/Realm.java         |  2 +-
 src/main/org/codehaus/groovy/GroovyBugError.java        |  2 +-
 .../codehaus/groovy/ast/decompiled/AsmDecompiler.java   |  4 ++--
 .../codehaus/groovy/classgen/FinalVariableAnalyzer.java |  2 +-
 src/main/org/codehaus/groovy/classgen/Verifier.java     |  2 +-
 .../org/codehaus/groovy/classgen/asm/MopWriter.java     |  7 ++++---
 .../org/codehaus/groovy/classgen/asm/OperandStack.java  |  3 ++-
 .../classgen/asm/sc/StaticTypesClosureWriter.java       |  2 +-
 .../classgen/asm/sc/StaticTypesWriterController.java    |  2 +-
 .../groovy/control/ASTTransformationsContext.java       |  1 -
 .../org/codehaus/groovy/control/StaticVerifier.java     |  3 ++-
 .../groovy/control/customizers/ImportCustomizer.java    |  2 +-
 .../groovy/control/customizers/SecureASTCustomizer.java |  4 ++--
 .../customizers/builder/ImportCustomizerFactory.java    |  2 +-
 .../org/codehaus/groovy/reflection/CachedMethod.java    |  4 ++--
 src/main/org/codehaus/groovy/reflection/ClassInfo.java  |  2 +-
 .../codehaus/groovy/reflection/GroovyClassValue.java    |  2 +-
 .../groovy/reflection/GroovyClassValueFactory.java      |  2 +-
 .../codehaus/groovy/runtime/DefaultGroovyMethods.java   |  4 ++--
 .../org/codehaus/groovy/runtime/IOGroovyMethods.java    |  2 +-
 .../codehaus/groovy/runtime/ResourceGroovyMethods.java  |  4 ++--
 .../codehaus/groovy/runtime/SocketGroovyMethods.java    |  4 ++--
 .../codehaus/groovy/runtime/StringGroovyMethods.java    | 12 ++++++------
 .../groovy/runtime/metaclass/MetaMethodIndex.java       |  4 ++--
 .../groovy/transform/AbstractASTTransformation.java     |  1 -
 .../groovy/transform/stc/StaticTypeCheckingSupport.java |  2 +-
 src/main/org/codehaus/groovy/util/ListHashMap.java      |  7 ++++---
 32 files changed, 53 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/groovy/lang/GroovyClassLoader.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/lang/GroovyClassLoader.java b/src/main/groovy/lang/GroovyClassLoader.java
index c75bb2f..11dedfd 100644
--- a/src/main/groovy/lang/GroovyClassLoader.java
+++ b/src/main/groovy/lang/GroovyClassLoader.java
@@ -987,7 +987,7 @@ public class GroovyClassLoader extends URLClassLoader {
     }
 
     private static class TimestampAdder extends CompilationUnit.PrimaryClassNodeOperation implements Opcodes {
-        private final static TimestampAdder INSTANCE = new TimestampAdder();
+        private static final TimestampAdder INSTANCE = new TimestampAdder();
 
         private TimestampAdder() {}
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/groovy/lang/ObjectRange.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/lang/ObjectRange.java b/src/main/groovy/lang/ObjectRange.java
index 1cf392e..a7e2b05 100644
--- a/src/main/groovy/lang/ObjectRange.java
+++ b/src/main/groovy/lang/ObjectRange.java
@@ -414,7 +414,7 @@ public class ObjectRange extends AbstractList<Comparable> implements Range<Compa
     /**
      * Non-thread-safe iterator which lazily produces the next element only on calls of hasNext() or next()
      */
-    private static class StepIterator implements Iterator<Comparable> {
+    private static final class StepIterator implements Iterator<Comparable> {
         // actual step, can be +1 when desired step is -1 and direction is from high to low
         private final int step;
         private final ObjectRange range;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/groovy/ui/GroovyMain.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/ui/GroovyMain.java b/src/main/groovy/ui/GroovyMain.java
index 6f44e67..0fdd696 100644
--- a/src/main/groovy/ui/GroovyMain.java
+++ b/src/main/groovy/ui/GroovyMain.java
@@ -368,7 +368,7 @@ public class GroovyMain {
      */
     @Deprecated
     public String getText(String uriOrFilename) throws IOException {
-        if (uriPattern.matcher(uriOrFilename).matches()) {
+        if (URI_PATTERN.matcher(uriOrFilename).matches()) {
             try {
                 return ResourceGroovyMethods.getText(new URL(uriOrFilename));
             } catch (Exception e) {
@@ -394,7 +394,7 @@ public class GroovyMain {
         if (isScriptFile) {
             // search for the file and if it exists don't try to use URIs ...
             File scriptFile = huntForTheScriptFile(script);
-            if (!scriptFile.exists() && uriPattern.matcher(script).matches()) {
+            if (!scriptFile.exists() && URI_PATTERN.matcher(script).matches()) {
                 return new GroovyCodeSource(new URI(script));
             }
             return new GroovyCodeSource( scriptFile );
@@ -405,7 +405,7 @@ public class GroovyMain {
     // RFC2396
     // scheme        = alpha *( alpha | digit | "+" | "-" | "." )
     // match URIs but not Windows filenames, e.g.: http://cnn.com but not C:\xxx\file.ext
-    private static final Pattern uriPattern = Pattern.compile("\\p{Alpha}[-+.\\p{Alnum}]*:[^\\\\]*");
+    private static final Pattern URI_PATTERN = Pattern.compile("\\p{Alpha}[-+.\\p{Alnum}]*:[^\\\\]*");
 
     /**
      * Search for the script file, doesn't bother if it is named precisely.

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/groovy/ui/GroovySocketServer.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/ui/GroovySocketServer.java b/src/main/groovy/ui/GroovySocketServer.java
index 891e5d8..e5460da 100644
--- a/src/main/groovy/ui/GroovySocketServer.java
+++ b/src/main/groovy/ui/GroovySocketServer.java
@@ -93,7 +93,7 @@ public class GroovySocketServer implements Runnable {
     private static GroovyCodeSource getCodeSource(boolean scriptFile, String scriptFilenameOrText) {
         if (scriptFile) {
             try {
-                if (uriPattern.matcher(scriptFilenameOrText).matches()) {
+                if (URI_PATTERN.matcher(scriptFilenameOrText).matches()) {
                     return new GroovyCodeSource(new URI(scriptFilenameOrText));
                 } else {
                     return new GroovyCodeSource(GroovyMain.searchForGroovyScriptFile(scriptFilenameOrText));
@@ -118,7 +118,7 @@ public class GroovySocketServer implements Runnable {
 
     // RFC2396
     // scheme        = alpha *( alpha | digit | "+" | "-" | "." )
-    private static final Pattern uriPattern = Pattern.compile("\\p{Alpha}[-+.\\p{Alnum}]*:.*");
+    private static final Pattern URI_PATTERN = Pattern.compile("\\p{Alpha}[-+.\\p{Alnum}]*:.*");
 
     /**
     * This creates and starts the socket server on a new Thread. There is no need to call run or spawn

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/groovy/util/ConfigObject.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ConfigObject.java b/src/main/groovy/util/ConfigObject.java
index 8452455..6308d74 100644
--- a/src/main/groovy/util/ConfigObject.java
+++ b/src/main/groovy/util/ConfigObject.java
@@ -53,7 +53,7 @@ public class ConfigObject extends GroovyObjectSupport implements Writable, Map,
      */
     private URL configFile;
 
-    private LinkedHashMap delegateMap = new LinkedHashMap();
+    private HashMap delegateMap = new LinkedHashMap();
 
     public ConfigObject(URL file) {
         this.configFile = file;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/apache/groovy/metaclass/Realm.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/groovy/metaclass/Realm.java b/src/main/org/apache/groovy/metaclass/Realm.java
index d398c1c..a652dab 100644
--- a/src/main/org/apache/groovy/metaclass/Realm.java
+++ b/src/main/org/apache/groovy/metaclass/Realm.java
@@ -33,7 +33,7 @@ import java.util.Objects;
  */
 @Incubating
 public final class Realm {
-    private final static Realm ROOT = new Realm("ROOT", null);
+    private static final Realm ROOT = new Realm("ROOT", null);
 
     private final String name;
     private final Realm parent;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/GroovyBugError.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/GroovyBugError.java b/src/main/org/codehaus/groovy/GroovyBugError.java
index 040c137..30ed7de 100644
--- a/src/main/org/codehaus/groovy/GroovyBugError.java
+++ b/src/main/org/codehaus/groovy/GroovyBugError.java
@@ -21,7 +21,7 @@ package org.codehaus.groovy;
 /**
  * This class represents an error that is thrown when a bug is 
  * recognized inside the runtime. Basically it is thrown when
- * a constraint is not fullfilled that should be fullfiled. 
+ * a constraint is not fulfilled that should be fulfilled.
  * 
  * @author Jochen Theodorou
  */

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/ast/decompiled/AsmDecompiler.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/decompiled/AsmDecompiler.java b/src/main/org/codehaus/groovy/ast/decompiled/AsmDecompiler.java
index 32e5313..e17847a 100644
--- a/src/main/org/codehaus/groovy/ast/decompiled/AsmDecompiler.java
+++ b/src/main/org/codehaus/groovy/ast/decompiled/AsmDecompiler.java
@@ -157,7 +157,7 @@ public abstract class AsmDecompiler {
         return name.replace('/', '.');
     }
 
-    private static abstract class AnnotationReader extends AnnotationVisitor {
+    private abstract static class AnnotationReader extends AnnotationVisitor {
         public AnnotationReader() {
             super(Opcodes.ASM5);
         }
@@ -183,7 +183,7 @@ public abstract class AsmDecompiler {
 
         @Override
         public AnnotationVisitor visitArray(String name) {
-            final ArrayList<Object> list = new ArrayList<Object>();
+            final List<Object> list = new ArrayList<Object>();
             visitAttribute(name, list);
             return new AnnotationReader() {
                 @Override

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java b/src/main/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
index dc47387..8983489 100644
--- a/src/main/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
+++ b/src/main/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
@@ -332,7 +332,7 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
         }
     }
 
-    public static interface VariableNotFinalCallback {
+    public interface VariableNotFinalCallback {
         /**
          * Callback called whenever an assignment transforms an effectively final variable into a non final variable
          * (aka, breaks the "final" modifier contract)

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/Verifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/Verifier.java b/src/main/org/codehaus/groovy/classgen/Verifier.java
index 382c9a2..9f90dd0 100644
--- a/src/main/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/org/codehaus/groovy/classgen/Verifier.java
@@ -263,7 +263,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
     }
 
     private static void checkForDuplicateMethods(ClassNode cn) {
-        HashSet<String> descriptors = new HashSet<String>();
+        Set<String> descriptors = new HashSet<String>();
         for (MethodNode mn : cn.getMethods()) {
             if (mn.isSynthetic()) continue;
             String mySig = makeDescriptorWithoutReturnType(mn);

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java b/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
index af65c9d..416ce07 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.codehaus.groovy.ast.ClassHelper;
@@ -35,7 +36,7 @@ import org.objectweb.asm.MethodVisitor;
 import static org.objectweb.asm.Opcodes.*;
 
 public class MopWriter {
-    public static interface Factory {
+    public interface Factory {
         MopWriter create(WriterController controller);
     }
 
@@ -85,7 +86,7 @@ public class MopWriter {
 
     private static Set<MopKey> buildCurrentClassSignatureSet(List<MethodNode> methods) {
         if (methods.isEmpty()) return Collections.EMPTY_SET;
-        HashSet<MopKey> result = new HashSet<MopKey>(methods.size());
+        Set<MopKey> result = new HashSet<MopKey>(methods.size());
         for (MethodNode mn : methods) {
             MopKey key = new MopKey(mn.getName(), mn.getParameters());
             result.add(key);
@@ -105,7 +106,7 @@ public class MopWriter {
      * @see #generateMopCalls(LinkedList, boolean)
      */
     private void visitMopMethodList(List<MethodNode> methods, boolean isThis, Set<MopKey> useOnlyIfDeclaredHereToo, List<String> orNameMentionedHere) {
-        HashMap<MopKey, MethodNode> mops = new HashMap<MopKey, MethodNode>();
+        Map<MopKey, MethodNode> mops = new HashMap<MopKey, MethodNode>();
         LinkedList<MethodNode> mopCalls = new LinkedList<MethodNode>();
         for (MethodNode mn : methods) {
             // mop methods are helper for this and super calls and do direct calls

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/asm/OperandStack.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/OperandStack.java b/src/main/org/codehaus/groovy/classgen/asm/OperandStack.java
index e9c8652..3be622b 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/OperandStack.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/OperandStack.java
@@ -21,6 +21,7 @@ package org.codehaus.groovy.classgen.asm;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.ast.*;
@@ -37,7 +38,7 @@ import static org.objectweb.asm.Opcodes.*;
 public class OperandStack {
 
     private final WriterController controller;
-    private final ArrayList<ClassNode> stack = new ArrayList<ClassNode>();
+    private final List<ClassNode> stack = new ArrayList<ClassNode>();
 
     public OperandStack(WriterController wc) {
         this.controller = wc;        

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesClosureWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesClosureWriter.java b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesClosureWriter.java
index 48e3d87..fc26486 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesClosureWriter.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesClosureWriter.java
@@ -110,7 +110,7 @@ public class StaticTypesClosureWriter extends ClosureWriter {
                         new ReturnStatement(doCallNoArgs)));
     }
 
-    private static class MethodTargetCompletionVisitor extends ClassCodeVisitorSupport {
+    private static final class MethodTargetCompletionVisitor extends ClassCodeVisitorSupport {
 
         private final MethodNode doCallMethod;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java
index e8c84cc..577676f 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java
@@ -40,7 +40,7 @@ import java.lang.reflect.Constructor;
  */
 public class StaticTypesWriterController extends DelegatingController {
 
-    private final static Constructor indyBinHelper;
+    private static final Constructor indyBinHelper;
     static {
         Constructor ctor = null;
         try {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/control/ASTTransformationsContext.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/ASTTransformationsContext.java b/src/main/org/codehaus/groovy/control/ASTTransformationsContext.java
index 9cc0b10..ae95275 100644
--- a/src/main/org/codehaus/groovy/control/ASTTransformationsContext.java
+++ b/src/main/org/codehaus/groovy/control/ASTTransformationsContext.java
@@ -19,7 +19,6 @@
 package org.codehaus.groovy.control;
 
 import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.control.CompilationUnit;
 
 import java.util.HashSet;
 import java.util.Set;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/control/StaticVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/StaticVerifier.java b/src/main/org/codehaus/groovy/control/StaticVerifier.java
index 166f1b5..a1e6c1e 100644
--- a/src/main/org/codehaus/groovy/control/StaticVerifier.java
+++ b/src/main/org/codehaus/groovy/control/StaticVerifier.java
@@ -37,6 +37,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import static org.codehaus.groovy.ast.tools.ClassNodeUtils.isInnerClass;
 
@@ -85,7 +86,7 @@ public class StaticVerifier extends ClassCodeVisitorSupport {
         currentMethod = node;
         super.visitConstructorOrMethod(node, isConstructor);
         if (isConstructor) {
-            final HashSet<String> exceptions = new HashSet<String>();
+            final Set<String> exceptions = new HashSet<String>();
             for (final Parameter param : node.getParameters()) {
                 exceptions.add(param.getName());
                 if (param.hasInitialExpression()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/control/customizers/ImportCustomizer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/customizers/ImportCustomizer.java b/src/main/org/codehaus/groovy/control/customizers/ImportCustomizer.java
index 8d5cd91..a1069c0 100644
--- a/src/main/org/codehaus/groovy/control/customizers/ImportCustomizer.java
+++ b/src/main/org/codehaus/groovy/control/customizers/ImportCustomizer.java
@@ -127,7 +127,7 @@ public class ImportCustomizer extends CompilationCustomizer {
     /**
      * Represents imports which are possibly aliased.
      */
-    private static class Import {
+    private static final class Import {
         final ImportType type;
         final ClassNode classNode;
         final String alias;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java b/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
index a05d899..b3d39f7 100644
--- a/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
+++ b/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
@@ -1107,7 +1107,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * This interface allows the user to plugin custom expression checkers if expression blacklist or whitelist are not
      * sufficient
      */
-    public static interface ExpressionChecker {
+    public interface ExpressionChecker {
         boolean isAuthorized(Expression expression);
     }
 
@@ -1115,7 +1115,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * This interface allows the user to plugin custom statement checkers if statement blacklist or whitelist are not
      * sufficient
      */
-    public static interface StatementChecker {
+    public interface StatementChecker {
         boolean isAuthorized(Statement expression);
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/control/customizers/builder/ImportCustomizerFactory.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/customizers/builder/ImportCustomizerFactory.java b/src/main/org/codehaus/groovy/control/customizers/builder/ImportCustomizerFactory.java
index 4f129fe..e9e8b7e 100644
--- a/src/main/org/codehaus/groovy/control/customizers/builder/ImportCustomizerFactory.java
+++ b/src/main/org/codehaus/groovy/control/customizers/builder/ImportCustomizerFactory.java
@@ -86,7 +86,7 @@ public class ImportCustomizerFactory extends AbstractFactory {
         return false;
     }
 
-    private static class ImportHelper {
+    private static final class ImportHelper {
         private final ImportCustomizer customizer;
 
         private ImportHelper(final ImportCustomizer customizer) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/reflection/CachedMethod.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/CachedMethod.java b/src/main/org/codehaus/groovy/reflection/CachedMethod.java
index a482ebc..8c1c4a0 100644
--- a/src/main/org/codehaus/groovy/reflection/CachedMethod.java
+++ b/src/main/org/codehaus/groovy/reflection/CachedMethod.java
@@ -42,7 +42,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
     private final Method cachedMethod;
     private int hashCode;
 
-    private static final MyComparator comparator = new MyComparator();
+    private static final MyComparator COMPARATOR = new MyComparator();
 
     private SoftReference<Constructor> pogoCallSiteConstructor, pojoCallSiteConstructor, staticCallSiteConstructor;
 
@@ -65,7 +65,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
 //                return cachedMethod;
 //        }
 //        return null;
-        int i = Arrays.binarySearch(methods, method, comparator);
+        int i = Arrays.binarySearch(methods, method, COMPARATOR);
         if (i < 0)
           return null;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/reflection/ClassInfo.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/ClassInfo.java b/src/main/org/codehaus/groovy/reflection/ClassInfo.java
index 57956af..b240846 100644
--- a/src/main/org/codehaus/groovy/reflection/ClassInfo.java
+++ b/src/main/org/codehaus/groovy/reflection/ClassInfo.java
@@ -481,7 +481,7 @@ public class ClassInfo implements Finalizable {
 
     }
 
-    public static interface ClassInfoAction {
+    public interface ClassInfoAction {
         void onClassInfo(ClassInfo classInfo);
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/reflection/GroovyClassValue.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/GroovyClassValue.java b/src/main/org/codehaus/groovy/reflection/GroovyClassValue.java
index a15be3e..909f9b1 100644
--- a/src/main/org/codehaus/groovy/reflection/GroovyClassValue.java
+++ b/src/main/org/codehaus/groovy/reflection/GroovyClassValue.java
@@ -25,7 +25,7 @@ package org.codehaus.groovy.reflection;
  */
 public interface GroovyClassValue<T> {
 	
-	public static interface ComputeValue<T>{
+	interface ComputeValue<T>{
 		T computeValue(Class<?> type);
 	}
 	

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/reflection/GroovyClassValueFactory.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/GroovyClassValueFactory.java b/src/main/org/codehaus/groovy/reflection/GroovyClassValueFactory.java
index 3b00638..f3d55e1 100644
--- a/src/main/org/codehaus/groovy/reflection/GroovyClassValueFactory.java
+++ b/src/main/org/codehaus/groovy/reflection/GroovyClassValueFactory.java
@@ -29,7 +29,7 @@ class GroovyClassValueFactory {
 	 * See https://bugs.openjdk.java.net/browse/JDK-8136353
 	 * This issue does not exist on IBM Java (J9) so use ClassValue by default on that JVM. 
 	 */
-	private final static boolean USE_CLASSVALUE = Boolean.valueOf(System.getProperty("groovy.use.classvalue", "IBM J9 VM".equals(System.getProperty("java.vm.name"))?"true":"false"));
+	private static final boolean USE_CLASSVALUE = Boolean.valueOf(System.getProperty("groovy.use.classvalue", "IBM J9 VM".equals(System.getProperty("java.vm.name"))?"true":"false"));
 
 	private static final Constructor groovyClassValueConstructor;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index d23c1b5..96c99d9 100644
--- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -1351,7 +1351,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
         return uniqueItems(new IteratorIterableAdapter<T>(self), comparator).listIterator();
     }
 
-    private static class IteratorIterableAdapter<T> implements Iterable<T> {
+    private static final class IteratorIterableAdapter<T> implements Iterable<T> {
         private final Iterator<T> self;
 
         private IteratorIterableAdapter(Iterator<T> self) {
@@ -8172,7 +8172,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * @since 2.4.0
      */
     public static <E> Map<Integer, E> indexed(Iterable<E> self, int offset) {
-        LinkedHashMap<Integer, E> result = new LinkedHashMap<Integer, E>();
+        Map<Integer, E> result = new LinkedHashMap<Integer, E>();
         Iterator<Tuple2<Integer, E>> indexed = indexed(self.iterator(), offset);
         while (indexed.hasNext()) {
             Tuple2<Integer, E> next = indexed.next();

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java
index f8023a3..e7c26fd 100644
--- a/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java
@@ -1487,7 +1487,7 @@ public class IOGroovyMethods extends DefaultGroovyMethodsSupport {
      *         from the reader when the Writable#writeTo(Writer) is called.
      * @since 1.0
      */
-    public static Writable filterLine(Reader reader, final @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) {
+    public static Writable filterLine(Reader reader, @ClosureParams(value=SimpleType.class, options="java.lang.String") final Closure closure) {
         final BufferedReader br = new BufferedReader(reader);
         return new Writable() {
             public Writer writeTo(Writer out) throws IOException {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
index b41b072..55fe502 100644
--- a/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
@@ -1318,7 +1318,7 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see groovy.io.FileType
      * @since 1.7.1
      */
-    public static void traverse(final File self, final Map<String, Object> options, final @ClosureParams(value=SimpleType.class, options="java.io.File") Closure closure)
+    public static void traverse(final File self, final Map<String, Object> options, @ClosureParams(value=SimpleType.class, options="java.io.File") final Closure closure)
             throws FileNotFoundException, IllegalArgumentException {
         Number maxDepthNumber = DefaultGroovyMethods.asType(options.remove("maxDepth"), Number.class);
         int maxDepth = maxDepthNumber == null ? -1 : maxDepthNumber.intValue();
@@ -1396,7 +1396,7 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #traverse(java.io.File, java.util.Map, groovy.lang.Closure)
      * @since 1.7.1
      */
-    public static void traverse(final File self, final @ClosureParams(value=SimpleType.class, options="java.io.File") Closure closure)
+    public static void traverse(final File self, @ClosureParams(value=SimpleType.class, options="java.io.File") final Closure closure)
             throws FileNotFoundException, IllegalArgumentException {
         traverse(self, new HashMap<String, Object>(), closure);
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java
index 2162ceb..6582485 100644
--- a/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java
@@ -158,7 +158,7 @@ public class SocketGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see java.net.ServerSocket#accept()
      * @since 1.0
      */
-    public static Socket accept(ServerSocket serverSocket, final @ClosureParams(value=SimpleType.class, options="java.net.Socket") Closure closure) throws IOException {
+    public static Socket accept(ServerSocket serverSocket, @ClosureParams(value=SimpleType.class, options="java.net.Socket") final Closure closure) throws IOException {
         return accept(serverSocket, true, closure);
     }
 
@@ -175,7 +175,7 @@ public class SocketGroovyMethods extends DefaultGroovyMethodsSupport {
      * @since 1.7.6
      */
     public static Socket accept(ServerSocket serverSocket, final boolean runInANewThread,
-                                final @ClosureParams(value=SimpleType.class, options="java.net.Socket") Closure closure) throws IOException {
+                                @ClosureParams(value=SimpleType.class, options="java.net.Socket") final Closure closure) throws IOException {
         final Socket socket = serverSocket.accept();
         if (runInANewThread) {
             new Thread(new Runnable() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
index f6af14d..0c6f015 100644
--- a/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -2619,7 +2619,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #replaceAll(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
      */
     @Deprecated
-    public static String replaceAll(final String self, final Pattern pattern, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceAll(final String self, final Pattern pattern, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         return replaceAll((CharSequence) self, pattern, closure);
     }
 
@@ -2637,7 +2637,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #replaceAll(CharSequence, CharSequence, groovy.lang.Closure)
      */
     @Deprecated
-    public static String replaceAll(final String self, final String regex, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceAll(final String self, final String regex, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         return replaceAll((CharSequence) self, (CharSequence) regex, closure);
     }
 
@@ -2677,7 +2677,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #replaceFirst(String, String, groovy.lang.Closure)
      * @since 1.8.2
      */
-    public static String replaceFirst(final CharSequence self, final CharSequence regex, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceFirst(final CharSequence self, final CharSequence regex, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         return replaceFirst(self, Pattern.compile(regex.toString()), closure);
     }
 
@@ -2725,7 +2725,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return a CharSequence with replaced content
      * @since 1.8.2
      */
-    public static String replaceFirst(final CharSequence self, final Pattern pattern, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceFirst(final CharSequence self, final Pattern pattern, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         final String s = self.toString();
         final Matcher matcher = pattern.matcher(s);
         if (matcher.find()) {
@@ -2744,7 +2744,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #replaceFirst(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
      */
     @Deprecated
-    public static String replaceFirst(final String self, final Pattern pattern, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceFirst(final String self, final Pattern pattern, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         return replaceFirst((CharSequence) self, pattern, closure);
     }
 
@@ -2762,7 +2762,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @see #replaceFirst(CharSequence, CharSequence, groovy.lang.Closure)
      */
     @Deprecated
-    public static String replaceFirst(final String self, final String regex, final @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
+    public static String replaceFirst(final String self, final String regex, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) final Closure closure) {
         return replaceFirst((CharSequence) self, (CharSequence) regex, closure);
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java b/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
index fc32607..0598f9a 100644
--- a/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
+++ b/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
@@ -47,8 +47,8 @@ public class MetaMethodIndex {
     }
 
     public static class CacheEntry {
-        final public Class [] params;
-        final public MetaMethod method;
+        public final Class [] params;
+        public final MetaMethod method;
 
         public CacheEntry(final Class[] params, final MetaMethod method) {
             this.params = params;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
index 8379449..7a289ea 100644
--- a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
@@ -51,7 +51,6 @@ import java.util.Map;
 
 import static groovy.transform.Undefined.isUndefined;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.getInstanceNonPropertyFieldNames;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.getInstancePropertyNames;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.getSuperNonPropertyFields;
 
 public abstract class AbstractASTTransformation implements Opcodes, ASTTransformation, ErrorCollecting {

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index e2d5d29..622084b 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -2159,7 +2159,7 @@ public abstract class StaticTypeCheckingSupport {
      * @return a set of interfaces implemented by this class node
      */
     public static Set<ClassNode> collectAllInterfaces(ClassNode node) {
-        HashSet<ClassNode> result = new HashSet<ClassNode>();
+        Set<ClassNode> result = new HashSet<ClassNode>();
         collectAllInterfaces(node, result);
         return result;
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c7c8748/src/main/org/codehaus/groovy/util/ListHashMap.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/util/ListHashMap.java b/src/main/org/codehaus/groovy/util/ListHashMap.java
index 31cd251..b1a141b 100644
--- a/src/main/org/codehaus/groovy/util/ListHashMap.java
+++ b/src/main/org/codehaus/groovy/util/ListHashMap.java
@@ -21,6 +21,7 @@ package org.codehaus.groovy.util;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -205,9 +206,9 @@ public class ListHashMap<K,V> implements Map<K,V> {
     }
 
     public Collection<V> values() {
-        if (innerMap==null) {
-            ArrayList<V> list = new ArrayList(size);
-            for (int i=0; i<size; i++) {
+        if (innerMap == null) {
+            List<V> list = new ArrayList<V>(size);
+            for (int i = 0; i < size; i++) {
                 list.add((V) listValues[i]);
             }
             return list;


[07/22] groovy git commit: GROOVY-4636: AST Browser does not show object initializer statements (closes #473)

Posted by su...@apache.org.
GROOVY-4636: AST Browser does not show object initializer statements (closes #473)


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

Branch: refs/heads/parrot
Commit: 9ae860758ff19f01dbc0cc24c05d07907cc86607
Parents: 3e2d5fd
Author: John Wagenleitner <jw...@apache.org>
Authored: Sat Dec 31 10:47:32 2016 -0800
Committer: John Wagenleitner <jw...@apache.org>
Committed: Thu Jan 5 20:49:40 2017 -0800

----------------------------------------------------------------------
 .../swingui/AstNodeToScriptAdapter.groovy       | 15 +++++++++++
 .../swingui/ScriptToTreeNodeAdapter.groovy      | 22 +++++++++++++++++
 .../swingui/AstNodeToScriptAdapterTest.groovy   | 18 ++++++++++++++
 .../swingui/ScriptToTreeNodeAdapterTest.groovy  | 26 ++++++++++++++++++++
 4 files changed, 81 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9ae86075/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
index 083adcf..554b953 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
@@ -288,6 +288,8 @@ class AstNodeToScriptVisitor extends PrimaryClassNodeOperation implements Groovy
             printDoubleBreak()
             node?.declaredConstructors?.each { visitConstructor(it) }
             printLineBreak()
+            visitObjectInitializerBlocks(node)
+            printLineBreak()
             node?.methods?.each { visitMethod(it) }
         }
         print '}'
@@ -295,6 +297,19 @@ class AstNodeToScriptVisitor extends PrimaryClassNodeOperation implements Groovy
         classNameStack.pop()
     }
 
+    private void visitObjectInitializerBlocks(ClassNode node) {
+        for (Statement stmt : node.getObjectInitializerStatements()) {
+            print '{'
+            printLineBreak()
+            indented {
+                stmt.visit(this)
+            }
+            printLineBreak()
+            print '}'
+            printDoubleBreak()
+        }
+    }
+
     private void visitGenerics(GenericsType[] generics) {
 
         if (generics) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/9ae86075/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
index bafab26..be80a59 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
@@ -238,6 +238,7 @@ class TreeNodeBuildingNodeOperation extends PrimaryClassNodeOperation {
         root.add(child)
 
         collectConstructorData(child, 'Constructors', classNode)
+        collectObjectInitializers(child, 'Object Initializers', classNode)
         collectMethodData(child, 'Methods', classNode)
         collectFieldData(child, 'Fields', classNode)
         collectPropertyData(child, 'Properties', classNode)
@@ -261,6 +262,7 @@ class TreeNodeBuildingNodeOperation extends PrimaryClassNodeOperation {
             root.add(child)
 
             collectConstructorData(child, 'Constructors', innerClassNode)
+            collectObjectInitializers(child, 'Object Initializers', innerClassNode)
             collectMethodData(child, 'Methods', innerClassNode)
             collectFieldData(child, 'Fields', innerClassNode)
             collectPropertyData(child, 'Properties', innerClassNode)
@@ -360,6 +362,26 @@ class TreeNodeBuildingNodeOperation extends PrimaryClassNodeOperation {
         }
 
     }
+
+    private void collectObjectInitializers(parent, String name, ClassNode node) {
+        List<Statement> initStatements = node.getObjectInitializerStatements()
+        if (!initStatements) {
+            return
+        }
+        def allInitializers = nodeMaker.makeNode(name)
+        parent.add(allInitializers)
+        for (Statement stmt : initStatements) {
+            Statement initBlock = ((BlockStatement)stmt).statements.first()
+            def ggrandchild = adapter.make(initBlock)
+            allInitializers.add(ggrandchild)
+            TreeNodeBuildingVisitor visitor = new TreeNodeBuildingVisitor(adapter)
+            initBlock.visit(visitor)
+            if (visitor.currentNode) {
+                ggrandchild.add(visitor.currentNode)
+            }
+        }
+    }
+
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/9ae86075/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/AstNodeToScriptAdapterTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/AstNodeToScriptAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/AstNodeToScriptAdapterTest.groovy
index 48c0640..c526f17 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/AstNodeToScriptAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/AstNodeToScriptAdapterTest.groovy
@@ -869,4 +869,22 @@ class AstNodeToScriptAdapterTest extends GroovyTestCase {
         assert result.contains("assert this.f([*: ['a': 10, 'b': 20, 'c': 30], 'e': 50]) == 30 : null")
         assert result.contains("assert this.f(['e': 100, *: ['a': 10, 'b': 20, 'c': 30]], *[4, 5], 6) == [['e': 100, 'b': 20, 'c': 30, 'a': 10], 4, 5, 6] : null")
     }
+
+    // GROOVY-4636
+    void testObjectInitializers() {
+        String script = '''
+            class A {
+                def v
+                A() { v = 1 }
+                { v = 2 }
+            }
+        '''
+
+        String result = compileToScript(script)
+        assert result =~ /\{\s*v = 2\s*\}/
+
+        // During class gen the initializers should have been merged in with the ctors
+        result = compileToScript(script, CompilePhase.CLASS_GENERATION)
+        assert result =~ /(?s)public A\(\) \{.*?v = 2\s*v = 1\s*\}/
+    }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/9ae86075/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
index e796ec5..b3196cb 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
@@ -558,4 +558,30 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 ],
                 adapter)
     }
+
+    // GROOVY-4636
+    void testScriptWithObjectInitializers() {
+        ScriptToTreeNodeAdapter adapter = createAdapter(false, true, true)
+
+        def source = '''
+            class A {
+                int i = 0
+                A() {
+                    i = 5
+                }
+                {
+                    i *= 2
+                }
+            }
+            '''
+
+        assertTreeStructure(source, CompilePhase.CONVERSION,
+                [
+                        startsWith('ClassNode - A'),
+                        eq('Object Initializers')
+                ],
+                adapter)
+
+    }
+
 }


[03/22] groovy git commit: minor refactor

Posted by su...@apache.org.
minor refactor


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

Branch: refs/heads/parrot
Commit: 0d5c0b8eeefe9f4fdcbfd5a92ef28106d7bf0ccf
Parents: a19feb7
Author: paulk <pa...@asert.com.au>
Authored: Thu Dec 29 21:55:48 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Dec 29 21:55:48 2016 +1000

----------------------------------------------------------------------
 .../codehaus/groovy/transform/AutoImplementASTTransformation.java   | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/0d5c0b8e/src/main/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AutoImplementASTTransformation.java b/src/main/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
index 6366627..5ec874f 100644
--- a/src/main/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
@@ -34,7 +34,6 @@ import org.codehaus.groovy.ast.stmt.BlockStatement;
 import org.codehaus.groovy.ast.stmt.EmptyStatement;
 import org.codehaus.groovy.ast.tools.ParameterUtils;
 import org.codehaus.groovy.control.CompilePhase;
-import org.codehaus.groovy.control.GenericsVisitor;
 import org.codehaus.groovy.control.SourceUnit;
 import org.objectweb.asm.Opcodes;
 


[18/22] groovy git commit: GROOVY-8033: spread property calls on non-list collections fail STC in static methods (closes #476)

Posted by su...@apache.org.
GROOVY-8033: spread property calls on non-list collections fail STC in static methods (closes #476)


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

Branch: refs/heads/parrot
Commit: 1d68627120b15bed726f666912c784a30843e10c
Parents: d05ecc9
Author: Shil Sinha <sh...@gmail.com>
Authored: Wed Jan 4 12:26:37 2017 -0500
Committer: Shil Sinha <sh...@apache.org>
Committed: Mon Jan 9 18:58:02 2017 -0500

----------------------------------------------------------------------
 .../transform/stc/StaticTypeCheckingVisitor.java      |  1 +
 .../transform/stc/ArraysAndCollectionsSTCTest.groovy  | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/1d686271/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index f675526..bac9d7c 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -1373,6 +1373,7 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport {
     private ClassNode getTypeForSpreadExpression(ClassNode testClass, ClassNode objectExpressionType, PropertyExpression pexp) {
         if (!pexp.isSpreadSafe()) return null;
         MethodCallExpression mce = new MethodCallExpression(new VariableExpression("_", testClass), "iterator", ArgumentListExpression.EMPTY_ARGUMENTS);
+        mce.setImplicitThis(false);
         mce.visit(this);
         ClassNode callType = getType(mce);
         if (!implementsInterfaceOrIsSubclassOf(callType, Iterator_TYPE)) return null;

http://git-wip-us.apache.org/repos/asf/groovy/blob/1d686271/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy b/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
index a019f35..badff32 100644
--- a/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
@@ -557,5 +557,19 @@ class ArraysAndCollectionsSTCTest extends StaticTypeCheckingTestCase {
             countIt([1,2,3])==3
         '''
     }
+
+    // GROOVY-8033
+    void testSetSpreadPropertyInStaticContext() {
+        assertScript '''
+            class Foo {
+                String name
+            }
+            static List<String> meth() {
+                Set<Foo> foos = [new Foo(name: 'pls'), new Foo(name: 'bar')].toSet()
+                foos*.name
+            }
+            assert meth().toSet() == ['pls', 'bar'].toSet()            
+        '''
+    }
 }
 


[20/22] groovy git commit: rename a property to better reflect reality

Posted by su...@apache.org.
rename a property to better reflect reality


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

Branch: refs/heads/parrot
Commit: 86065a72b343b0eb965a884edfdd8242acb86880
Parents: f9a3c0e
Author: paulk <pa...@asert.com.au>
Authored: Tue Jan 10 18:41:40 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Jan 11 08:34:06 2017 +1000

----------------------------------------------------------------------
 build.gradle           |  2 +-
 gradle/assemble.gradle |  2 +-
 gradle/bintray.gradle  | 97 ---------------------------------------------
 gradle/publish.gradle  | 97 +++++++++++++++++++++++++++++++++++++++++++++
 gradle/upload.gradle   |  8 ++--
 5 files changed, 103 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 70f8732..9343891 100644
--- a/build.gradle
+++ b/build.gradle
@@ -61,7 +61,7 @@ buildScan {
 
 apply from: 'gradle/filter.gradle'
 apply from: 'gradle/indy.gradle'
-apply from: 'gradle/bintray.gradle'
+apply from: 'gradle/publish.gradle'
 apply plugin: 'javadocHotfix'
 apply plugin: "com.github.jk1.dependency-license-report"
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 12f2917..050a9ec 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -41,7 +41,7 @@ ext.srcSpec = copySpec {
                 'cobertura.ser',
                 'junitvmwatcher*.properties',
                 'out',
-                'bintray.properties', // generated by the CI server
+                'artifactory.properties', // generated by the CI server
                 'gradle.properties.gz', // generated by the CI server
                 '**/*.iml',         // used by Intellij IDEA
                 '**/*.ipr',         // used by Intellij IDEA

http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
deleted file mode 100644
index d52f89c..0000000
--- a/gradle/bintray.gradle
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *  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.
- */
-import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact
-
-ext.bintrayUser = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER')
-ext.bintrayPassword = project.hasProperty('bintrayPassword') ? project.bintrayPassword : System.getenv('BINTRAY_PASSWORD')
-
-if (!bintrayUser) {
-    // try to read from properties
-    def bintrayFile = file('bintray.properties')
-    if (bintrayFile.exists()) {
-        def props = new Properties()
-        props.load(bintrayFile.newReader())
-        ext.bintrayUser = props.getProperty('bintrayUser','')
-        ext.bintrayPassword = props.getProperty('bintrayPassword','')
-    }
-}
-
-logger.lifecycle "Bintray user: $bintrayUser"
-
-allprojects {
-    apply plugin: 'com.jfrog.artifactory-upload'
-
-    artifactory {
-        contextUrl = project.hasProperty('bintrayContext') ? project.bintrayContext : 'https://oss.jfrog.org'
-        resolve {
-            repository {
-                repoKey = 'libs-release'
-            }
-        }
-        publish {
-            excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
-            repository {
-                repoKey = project.hasProperty('bintrayRepoKey') ? project.bintrayRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
-                //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
-                //~/.gradle/gradle.properties, otherwise to be set in the build server
-                username = rootProject.bintrayUser
-                password = rootProject.bintrayPassword
-            }
-        }
-    }
-}
-
-artifactoryPublish {
-    def curDate = new Date()
-    def pomSource = { a -> "$projectDir/target/poms/pom-${a.name - 'groovy-'}.xml" }
-    def destBase = { a -> "org/codehaus/groovy/${a.name}/${version}/${a.name}-${version}${a.classifier ? '-' + a.classifier : ''}" }
-    def newDetails = { orig, newFile, newExt, newType -> gradleDeployDetails(new DefaultPublishArtifact(
-            orig.name, newExt, newType, orig.classifier, curDate, newFile), 'artifacts', destBase(orig) + '.' + newExt) }
-    def makeTransformedDetails = { orig -> newDetails(orig, orig.file, orig.extension, orig.extension) }
-    def makeTransformedPomDetails = { orig -> newDetails(orig, file(pomSource(orig)), 'pom', 'pom') }
-    def makeTransformedPomSigDetails = { orig -> newDetails(orig, file(pomSource(orig) + '.asc'), 'pom.asc', 'asc') }
-    mavenDescriptor = new File("$projectDir/target/poms/pom-groovy.xml")
-    doFirst{
-        configurations.archives.artifacts.findAll{ it.name != project.name }.each {
-            // the plugin we are using uses the project name rather than the artifact name
-            // as the artifactId, so we add the transformed one ourselves
-            // this also covers signatures which we already added during install
-            deployDetails.add(makeTransformedDetails(it))
-            if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
-                // add the pom and its signature
-                deployDetails.add(makeTransformedPomDetails(it))
-                if (isReleaseVersion) {
-                    deployDetails.add(makeTransformedPomSigDetails(it))
-                }
-            }
-        }
-
-        if (isReleaseVersion) {
-            allprojects {
-                configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
-                    // add pom signatures
-                    def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
-                    deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
-                }
-            }
-        }
-    }
-}
-
-artifactoryPublish.dependsOn('backportJars')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
new file mode 100644
index 0000000..b7f07de
--- /dev/null
+++ b/gradle/publish.gradle
@@ -0,0 +1,97 @@
+/*
+ *  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.
+ */
+import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact
+
+ext.artifactoryUser = project.hasProperty('artifactoryUser') ? project.artifactoryUser : System.getenv('ARTIFACTORY_USER')
+ext.artifactoryPassword = project.hasProperty('artifactoryPassword') ? project.artifactoryPassword : System.getenv('ARTIFACTORY_PASSWORD')
+
+if (!artifactoryUser) {
+    // try to read from properties
+    def artifactoryFile = file('artifactory.properties')
+    if (artifactoryFile.exists()) {
+        def props = new Properties()
+        props.load(artifactoryFile.newReader())
+        ext.artifactoryUser = props.getProperty('artifactoryUser','')
+        ext.artifactoryPassword = props.getProperty('artifactoryPassword','')
+    }
+}
+
+logger.lifecycle "Bintray user: $bintrayUser"
+
+allprojects {
+    apply plugin: 'com.jfrog.artifactory-upload'
+
+    artifactory {
+        contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
+        resolve {
+            repository {
+                repoKey = 'libs-release'
+            }
+        }
+        publish {
+            excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
+            repository {
+                repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
+                //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
+                //~/.gradle/gradle.properties, otherwise to be set in the build server
+                username = rootProject.artifactoryUser
+                password = rootProject.artifactoryPassword
+            }
+        }
+    }
+}
+
+artifactoryPublish {
+    def curDate = new Date()
+    def pomSource = { a -> "$projectDir/target/poms/pom-${a.name - 'groovy-'}.xml" }
+    def destBase = { a -> "org/codehaus/groovy/${a.name}/${version}/${a.name}-${version}${a.classifier ? '-' + a.classifier : ''}" }
+    def newDetails = { orig, newFile, newExt, newType -> gradleDeployDetails(new DefaultPublishArtifact(
+            orig.name, newExt, newType, orig.classifier, curDate, newFile), 'artifacts', destBase(orig) + '.' + newExt) }
+    def makeTransformedDetails = { orig -> newDetails(orig, orig.file, orig.extension, orig.extension) }
+    def makeTransformedPomDetails = { orig -> newDetails(orig, file(pomSource(orig)), 'pom', 'pom') }
+    def makeTransformedPomSigDetails = { orig -> newDetails(orig, file(pomSource(orig) + '.asc'), 'pom.asc', 'asc') }
+    mavenDescriptor = new File("$projectDir/target/poms/pom-groovy.xml")
+    doFirst{
+        configurations.archives.artifacts.findAll{ it.name != project.name }.each {
+            // the plugin we are using uses the project name rather than the artifact name
+            // as the artifactId, so we add the transformed one ourselves
+            // this also covers signatures which we already added during install
+            deployDetails.add(makeTransformedDetails(it))
+            if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
+                // add the pom and its signature
+                deployDetails.add(makeTransformedPomDetails(it))
+                if (isReleaseVersion) {
+                    deployDetails.add(makeTransformedPomSigDetails(it))
+                }
+            }
+        }
+
+        if (isReleaseVersion) {
+            allprojects {
+                configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
+                    // add pom signatures
+                    def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+                    deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                }
+            }
+        }
+    }
+}
+
+artifactoryPublish.dependsOn('backportJars')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 85ca9db..c6c1c01 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -17,11 +17,11 @@
  *  under the License.
  */
 
-boolean isUsingBintray = rootProject.hasProperty('bintrayUser') && rootProject.bintrayUser &&
-        rootProject.hasProperty('bintrayPassword') && rootProject.bintrayPassword
+boolean isUsingArtifactory = rootProject.hasProperty('artifactoryUser') && rootProject.artifactoryUser &&
+        rootProject.hasProperty('artifactoryPassword') && rootProject.artifactoryPassword
 
-if (isUsingBintray) {
-    logger.lifecycle 'Deployment environment set to Bintray'
+if (isUsingArtifactory) {
+    logger.lifecycle 'Deployment environment set to Artifactory'
 }
 
 def embedded = ['asm', 'asm-util', 'asm-analysis', 'asm-tree', 'asm-commons', 'antlr', 'commons-cli', 'openbeans']


[09/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo


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

Branch: refs/heads/parrot
Commit: bd4e2c7121a26ed9c1b2d16fdaed81e477e7a5f8
Parents: d32a39b
Author: paulk <pa...@asert.com.au>
Authored: Fri Jan 6 00:00:44 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:03:52 2017 +1000

----------------------------------------------------------------------
 build.gradle                              |  20 +++--
 gradle/assemble.gradle                    |  10 +--
 gradle/backports.gradle                   |   1 +
 gradle/signing.gradle                     |  92 +++++++++++++++++++++
 gradle/upload.gradle                      | 108 ++++++++++++++++++++++---
 subprojects/groovy-templates/build.gradle |   2 +-
 6 files changed, 207 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a23496b..455edc2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -72,6 +72,8 @@ indyBanner()
 // TODO use antlr plugin
 //apply plugin: 'antlr'
 
+ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
+
 allprojects {
     apply plugin: 'java'
 
@@ -472,6 +474,15 @@ task checkCompatibility {
     }
 }
 
+if (!JavaVersion.current().java7Compatible) {
+    logger.lifecycle '''
+    **************************************** WARNING ********************************************
+    ******   You are running the build with an older JDK. NEVER try to release with 1.6.   ******
+    ******   You must use a JDK 1.7+ in order to compile all features of the language.     ******
+    *********************************************************************************************
+'''
+}
+
 apply from: 'gradle/test.gradle'
 apply from: 'gradle/groovydoc.gradle'
 apply from: 'gradle/docs.gradle'
@@ -487,14 +498,7 @@ if (file('user.gradle').exists()) {
     apply from: 'user.gradle'
 }
 
-if (!JavaVersion.current().java7Compatible) {
-    logger.lifecycle '''
-    **************************************** WARNING **********************************************
-    ****** You are running the build with an older JDK. NEVER try to release with 1.6.       ******
-    ****** You must use a JDK 1.7+ in order to compile all features of the language.         ******
-    ***********************************************************************************************
-'''
-}
+apply from: 'gradle/signing.gradle'
 
 licenseReport {
     excludeGroups = [

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 8922eea..12f2917 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -340,7 +340,7 @@ task jarAll(type: Jar, dependsOn: replaceJarWithJarJar) {
     inputs.files(allprojects.jar.archivePath)
 
     ext.metaInfDir = "$buildDir/tmp/groovy-all-metainf"
-    appendix = 'all'
+    baseName = 'groovy-all'
     includeEmptyDirs = false
     if (rootProject.useIndy()) {
         classifier = 'indy'
@@ -447,7 +447,7 @@ task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar + rootProject.sou
     modules()*.sourceJar.each {
         with it.rootSpec
     }
-    appendix = 'all'
+    baseName = 'groovy-all'
     classifier = rootProject.useIndy() ? 'indy-sources' : 'sources'
 }
 
@@ -463,13 +463,13 @@ allprojects {
 }
 
 task javadocAllJar(type: Jar, dependsOn: javadocAll) {
-    appendix = 'all'
+    baseName = 'groovy-all'
     classifier = rootProject.useIndy() ? 'indy-javadoc' : 'javadoc'
     from javadocAll.destinationDir
 }
 
 task groovydocAllJar(type: Jar, dependsOn: groovydocAll) {
-    appendix = 'all'
+    baseName = 'groovy-all'
     classifier = rootProject.useIndy() ? 'indy-groovydoc' : 'groovydoc'
     from groovydocAll.destinationDir
 }
@@ -531,7 +531,7 @@ ext.distSpec = copySpec {
     }
     into('embeddable') {
         from jarAll.archivePath
-        from { new File(jarAll.archivePath.parent, "${jarAll.baseName}-${jarAll.appendix}-${jarAll.version}-indy.jar") }
+        from { new File(jarAll.destinationDir, "${jarAll.baseName}-${jarAll.version}-indy.jar") }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/gradle/backports.gradle
----------------------------------------------------------------------
diff --git a/gradle/backports.gradle b/gradle/backports.gradle
index d111c26..0d8e5ed 100644
--- a/gradle/backports.gradle
+++ b/gradle/backports.gradle
@@ -43,6 +43,7 @@ backports.each { pkg, classList ->
         from zipTree(jar.archivePath)
         include classList
         baseName = "groovy-backports-$pkg"
+        classifier = ''
     }
 
     // the following two jars are empty. No wonder, Maven Central *requires* a javadoc and sources classifier

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/gradle/signing.gradle
----------------------------------------------------------------------
diff --git a/gradle/signing.gradle b/gradle/signing.gradle
new file mode 100644
index 0000000..89c3a01
--- /dev/null
+++ b/gradle/signing.gradle
@@ -0,0 +1,92 @@
+/*
+ *  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.
+ */
+
+import org.gradle.plugins.signing.Sign
+
+allprojects {
+    apply plugin: 'signing'
+    signing {
+        required {
+            isReleaseVersion &&
+                    (gradle.taskGraph.hasTask('artifactoryPublish') || project.hasProperty('forceSign'))
+        }
+    }
+}
+
+gradle.taskGraph.whenReady { taskGraph ->
+    if (taskGraph.allTasks.any { it instanceof Sign } || project.hasProperty('forceSign')) {
+        // Use Java 6's console or Swing to read input (not suitable for CI)
+        if (!project.hasProperty('signing.keyId') ||
+                !project.hasProperty('signing.secretKeyRingFile') ||
+                !project.hasProperty('signing.password')) {
+            printf "\n\nWe have to sign some things in this build." +
+                    "\n\nPlease enter your signing details.\n\n"
+            System.out.flush()
+
+            if (!project.hasProperty('signing.keyId')) {
+                project.ext.'signing.keyId' = promptUser('PGP Key Id')
+            }
+            if (!project.hasProperty('signing.secretKeyRingFile')) {
+                project.ext.'signing.secretKeyRingFile' = promptUser('PGP Secret Key Ring File (absolute path)')
+            }
+            if (!project.hasProperty('signing.password')) {
+                project.ext.'signing.password' = promptUser('PGP Private Key Password')
+            }
+
+            printf "\nThanks.\n\n"
+            System.out.flush()
+        }
+        allprojects { ext.'signing.keyId' = project.getProperty('signing.keyId') }
+        allprojects { ext.'signing.secretKeyRingFile' = project.getProperty('signing.secretKeyRingFile') }
+        allprojects { ext.'signing.password' = project.getProperty('signing.password') }
+    }
+}
+
+def promptUser(String prompt) {
+    def response = ''
+    if (System.console() == null) {
+        new groovy.swing.SwingBuilder().edt {
+            dialog(modal: true, //Otherwise the build will continue running
+                    title: 'Reponse required', //Dialog title
+                    alwaysOnTop: true,
+                    resizable: false,
+                    locationRelativeTo: null, //Place dialog in center of the screen
+                    pack: true, //We need to pack the dialog (so it will take the size of its children)
+                    show: true
+            ){
+                vbox { //Put everything below each other
+                    label(text: "$prompt:")
+                    input = passwordField()
+                    button(defaultButton: true, text: 'OK', actionPerformed: {
+                        response = new String(input.password); //set pass variable to value of input field
+                        dispose(); //close dialog
+                    })
+                }
+            }
+        }
+    }
+    else{
+        response = new String(System.console().readPassword("\n$prompt: "))
+    }
+
+    if(response.size() <= 0){
+        throw new InvalidUserDataException("Null response detected!")
+    }
+    response
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 7659a1d..633df89 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -40,7 +40,25 @@ allprojects {
 
 apply from: 'gradle/backports.gradle'
 
+ext.basename = { String s -> s.take(s.lastIndexOf('.')) }
+ext.deriveFile = { File archive, String suffix -> new File(archive.parent, basename(archive.name) + "-${suffix}.jar") }
+
 allprojects {
+    ext.signWithClassifier = { String c, File f ->
+        signing.sign(c, f)
+        project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
+            classifier = c
+            type = 'jar.asc'
+        }
+    }
+
+    ext.signArchiveTask = { archiveTask ->
+        signing.sign(archiveTask.classifier, archiveTask.archivePath)
+        project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
+            classifier = archiveTask.classifier
+            type = archiveTask.extension + '.asc'
+        }
+    }
 
     configurations {
         deployerJars
@@ -51,6 +69,7 @@ allprojects {
             mavenDeployer {
                 configuration = configurations.deployerJars
                 pom pomConfigureClosure
+                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
             }
         }
     }
@@ -59,6 +78,7 @@ allprojects {
         repositories {
             mavenInstaller {
                 pom pomConfigureClosure
+                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
             }
         }
     }
@@ -79,49 +99,111 @@ allprojects {
                 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 archive = jar.archivePath
-            def indyJar = new File(archive.parent, archive.name[0..archive.name.lastIndexOf('.')-1]+'-indy.jar')
+            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
             if (indyJar.exists()) {
                 project.artifacts.add('archives', indyJar)
             }
-            def grooidJar = new File(archive.parent, archive.name[0..archive.name.lastIndexOf('.')-1]+'-grooid.jar')
+            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
             if (grooidJar.exists()) {
                 project.artifacts.add('archives', grooidJar)
             }
         }
     }
+
+    install {
+        doFirst {
+            signArchiveTask(jar)
+            signArchiveTask(sourceJar)
+            signArchiveTask(javadocJar)
+            signArchiveTask(groovydocJar)
+            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+            if (indyJar.exists()) {
+                signWithClassifier('indy', indyJar)
+            }
+            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+            if (grooidJar.exists()) {
+                signWithClassifier('grooid', grooidJar)
+            }
+        }
+    }
 }
 
 // the root project generates an alternate 'groovy-all' artifact
 [uploadArchives, install]*.with {
     dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin])
     doFirst {
-        project.artifacts.add('archives', jarAll)
-        project.artifacts.add('archives', sourceAllJar)
-        project.artifacts.add('archives', javadocAllJar)
-        project.artifacts.add('archives', groovydocAllJar)
-        project.artifacts.add('archives', distBin)
+        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'
+        }
         tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
             project.artifacts.add('archives', t.archivePath) {
                 name = t.baseName
                 type = 'jar'
+                classifier = t.classifier
             }
         }
 
-        def archive = jarAll.archivePath
-        def indyJar = new File(archive.parent, archive.name[0..archive.name.lastIndexOf('.')-1] + '-indy.jar')
+        def indyJar = deriveFile(jarAll.archivePath, 'indy')
         if (indyJar.exists()) {
             project.artifacts.add('archives', indyJar)
         }
-        def grooidJar = new File(archive.parent, archive.name[0..archive.name.lastIndexOf('.')-1]+'-grooid.jar')
+        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
         if (grooidJar.exists()) {
             project.artifacts.add('archives', grooidJar)
         }
     }
 }
+
+install {
+    doFirst {
+        signArchiveTask(jarAll)
+        signArchiveTask(sourceAllJar)
+        signArchiveTask(javadocAllJar)
+        signArchiveTask(groovydocAllJar)
+        signArchiveTask(distBin)
+
+        // next three are done as a side effect since it was the easiest approach
+        signing.sign(distSrc.archivePath)
+        signing.sign(distDoc.archivePath)
+        signing.sign(dist.archivePath)
+
+        tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
+            signing.sign(t.classifier, t.archivePath)
+            project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
+                name = t.baseName
+                classifier = t.classifier
+                type = t.extension + '.asc'
+            }
+        }
+
+        def indyJar = deriveFile(jarAll.archivePath, 'indy')
+        if (indyJar.exists()) {
+            signWithClassifier('indy', indyJar)
+        }
+        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
+        if (grooidJar.exists()) {
+            signWithClassifier('grooid', grooidJar)
+        }
+    }
+}
+
 ext.pomAll = {
     addFilter('groovy') { artifact, file ->
-        !(artifact.name.contains('groovy-all')) && !(artifact.name.contains('groovy-binary')) && !(artifact.name.contains('backport'))
+        !(artifact.name.contains('groovy-all')) &&
+                !(artifact.name.contains('groovy-binary')) &&
+                !(artifact.name.contains('backport'))
     }
     addFilter('all') { artifact, file ->
         artifact.name.contains('groovy-all')
@@ -174,6 +256,8 @@ ext.pomAll = {
     binarypom.whenConfigured { p ->
         p.dependencies.clear()
     }
+
+    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
 }
 
 install {

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd4e2c71/subprojects/groovy-templates/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-templates/build.gradle b/subprojects/groovy-templates/build.gradle
index 4805b1c..906f37c 100644
--- a/subprojects/groovy-templates/build.gradle
+++ b/subprojects/groovy-templates/build.gradle
@@ -27,7 +27,7 @@ dependencies {
 }
 
 task backportJar(type:Jar) {
-    appendix = 'markup-backport'
+    name = 'groovy-markup-backport'
     dependsOn classes
     from sourceSets.main.output
     include 'groovy/text/markup/**'


[05/22] groovy git commit: merge GROOVY-7472 to GROOVY_2_4_X

Posted by su...@apache.org.
merge GROOVY-7472 to GROOVY_2_4_X


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

Branch: refs/heads/parrot
Commit: 98fc12d7c295f9b11f66e332b0bd148cd5fbdfa6
Parents: 3c7c874
Author: paulk <pa...@asert.com.au>
Authored: Fri Dec 30 06:43:18 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Fri Dec 30 06:43:18 2016 +1000

----------------------------------------------------------------------
 src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/98fc12d7/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
index 0c6f015..2d41ac3 100644
--- a/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -224,7 +224,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * @param self The CharSequence to uncapitalize
      * @return A String containing the uncapitalized toString() of the CharSequence
-     * @since 2.5.0
+     * @since 2.4.8
      */
     public static String uncapitalize(CharSequence self) {
         if (self.length() == 0) return "";


[17/22] groovy git commit: ignore asc files during snapshot builds

Posted by su...@apache.org.
ignore asc files during snapshot builds


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

Branch: refs/heads/parrot
Commit: d05ecc9a0d12d9b48cf4669c943edf160d7eab7d
Parents: 81a07ed
Author: paulk <pa...@asert.com.au>
Authored: Sun Jan 8 09:06:39 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sun Jan 8 09:06:39 2017 +1000

----------------------------------------------------------------------
 gradle/bintray.gradle | 18 ++++++++-----
 gradle/upload.gradle  | 64 ++++++++++++++++++++++++++--------------------
 2 files changed, 47 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d05ecc9a/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
index 552934e..d52f89c 100644
--- a/gradle/bintray.gradle
+++ b/gradle/bintray.gradle
@@ -19,7 +19,7 @@
 import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact
 
 ext.bintrayUser = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER')
-ext.bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : System.getenv('BINTRAY_KEY')
+ext.bintrayPassword = project.hasProperty('bintrayPassword') ? project.bintrayPassword : System.getenv('BINTRAY_PASSWORD')
 
 if (!bintrayUser) {
     // try to read from properties
@@ -76,15 +76,19 @@ artifactoryPublish {
             if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
                 // add the pom and its signature
                 deployDetails.add(makeTransformedPomDetails(it))
-                deployDetails.add(makeTransformedPomSigDetails(it))
+                if (isReleaseVersion) {
+                    deployDetails.add(makeTransformedPomSigDetails(it))
+                }
             }
         }
 
-        allprojects {
-            configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
-                // add pom signatures
-                def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
-                deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+        if (isReleaseVersion) {
+            allprojects {
+                configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
+                    // add pom signatures
+                    def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+                    deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/d05ecc9a/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index d99ad18..9eaef25 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -44,21 +44,25 @@ ext.deriveFile = { File archive, String suffix -> new File(archive.parent, basen
 
 allprojects {
     ext.signWithClassifier = { String c, File f ->
-        signing.sign(c, f)
-        project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
-            classifier = c
-            type = 'asc'
-            extension = 'jar.asc'
+        if (rootProject.isReleaseVersion) {
+            signing.sign(c, f)
+            project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
+                classifier = c
+                type = 'asc'
+                extension = 'jar.asc'
+            }
         }
     }
 
     ext.signArchiveTask = { archiveTask ->
-        signing.sign(archiveTask.classifier, archiveTask.archivePath)
-        project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
-            name = archiveTask.baseName
-            classifier = archiveTask.classifier
-            type = 'asc'
-            extension = archiveTask.extension + '.asc'
+        if (rootProject.isReleaseVersion) {
+            signing.sign(archiveTask.classifier, archiveTask.archivePath)
+            project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
+                name = archiveTask.baseName
+                classifier = archiveTask.classifier
+                type = 'asc'
+                extension = archiveTask.extension + '.asc'
+            }
         }
     }
 
@@ -66,7 +70,7 @@ allprojects {
         repositories {
             mavenDeployer {
                 pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
             }
         }
     }
@@ -75,7 +79,7 @@ allprojects {
         repositories {
             mavenInstaller {
                 pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
             }
         }
     }
@@ -154,15 +158,17 @@ allprojects {
         signArchiveTask(groovydocAllJar)
 
         // TODO rework these?
-        signing.sign(distBin.archivePath)
-        project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName + '.asc')) {
-            name = 'groovy-binary'
-            type = 'asc'
-            extension = 'zip.asc'
+        if (isReleaseVersion) {
+            signing.sign(distBin.archivePath)
+            project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName + '.asc')) {
+                name = 'groovy-binary'
+                type = 'asc'
+                extension = 'zip.asc'
+            }
+            signing.sign(distSrc.archivePath)
+            signing.sign(distDoc.archivePath)
+            signing.sign(dist.archivePath)
         }
-        signing.sign(distSrc.archivePath)
-        signing.sign(distDoc.archivePath)
-        signing.sign(dist.archivePath)
 
         tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
             project.artifacts.add('archives', t.archivePath) {
@@ -170,12 +176,14 @@ allprojects {
                 type = 'jar'
                 classifier = t.classifier
             }
-            signing.sign(t.classifier, t.archivePath)
-            project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
-                name = t.baseName
-                classifier = t.classifier
-                type = 'asc'
-                extension = t.extension + '.asc'
+            if (isReleaseVersion) {
+                signing.sign(t.classifier, t.archivePath)
+                project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
+                    name = t.baseName
+                    classifier = t.classifier
+                    type = 'asc'
+                    extension = t.extension + '.asc'
+                }
             }
         }
 
@@ -250,7 +258,7 @@ ext.pomAll = {
         p.dependencies.clear()
     }
 
-    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+    beforeDeployment { MavenDeployment deployment -> if (isReleaseVersion) signing.signPom(deployment) }
 }
 
 install {


[12/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (still more tweaks)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (still more tweaks)


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

Branch: refs/heads/parrot
Commit: adab2200db7c8855242c979aa15856de00d84a75
Parents: e79fcdb
Author: paulk <pa...@asert.com.au>
Authored: Sat Jan 7 01:14:05 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:07:21 2017 +1000

----------------------------------------------------------------------
 gradle/bintray.gradle | 59 +++++++++++++++++++++++++++++++++++++---------
 gradle/upload.gradle  | 42 ++++++++++++---------------------
 2 files changed, 63 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/adab2200/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
index 2477659..01142ce 100644
--- a/gradle/bintray.gradle
+++ b/gradle/bintray.gradle
@@ -62,33 +62,70 @@ artifactoryPublish {
         def curDate = new Date()
         def additionalFiles = [
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", null,
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}.jar")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.jar"),
+                        curDate, file("$projectDir/target/libs/groovy-all-${version}.jar")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.jar"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'sources',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-sources.jar")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-sources.jar"),
+                        curDate, file("$projectDir/target/libs/groovy-all-${version}-sources.jar")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-sources.jar"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'javadoc',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-javadoc.jar")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-javadoc.jar"),
+                        curDate, file("$projectDir/target/libs/groovy-all-${version}-javadoc.jar")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-javadoc.jar"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'groovydoc',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-groovydoc.jar")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-groovydoc.jar"),
+                        curDate, file("$projectDir/target/libs/groovy-all-${version}-groovydoc.jar")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-groovydoc.jar"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'indy',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-indy.jar")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-indy.jar"),
+                        curDate, file("$projectDir/target/libs/groovy-all-${version}-indy.jar")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-indy.jar"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "pom", "pom", null,
-                        curDate, file("$projectDir/target/poms/pom-all.xml")), 'artifacts', "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.pom"),
+                        curDate, file("$projectDir/target/poms/pom-all.xml")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.pom"),
+                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "pom.asc", "pom.asc", null,
+                        curDate, file("$projectDir/target/poms/pom-all.xml.asc")), 'artifacts',
+                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.pom.asc"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "zip", "zip", null,
-                        curDate, distBin.archivePath), 'artifacts', "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.zip"),
+                        curDate, distBin.archivePath), 'artifacts',
+                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.zip"),
+                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "zip.asc", "zip.asc", null,
+                        curDate, new File(distBin.destinationDir, distBin.archiveName + '.asc')), 'artifacts',
+                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.zip.asc"),
                 gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "pom", "pom", null,
-                        curDate, file("$projectDir/target/poms/pom-binary.xml")), 'artifacts', "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.pom"),
+                        curDate, file("$projectDir/target/poms/pom-binary.xml")), 'artifacts',
+                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.pom"),
+                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "pom.asc", "pom.asc", null,
+                        curDate, file("$projectDir/target/poms/pom-binary.xml.asc")), 'artifacts',
+                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.pom.asc"),
 
         ]
         tasks.withType(Jar).matching { it.name.startsWith('backport') }.all {
+            String baseDir = "org/codehaus/groovy/${baseName}/${version}"
             additionalFiles << gradleDeployDetails(
                     new DefaultPublishArtifact(baseName, "jar", "jar", classifier, curDate, archivePath),
                     'artifacts',
-                    "org/codehaus/groovy/${baseName}/${version}/${archiveName}")
+                    "$baseDir/${archiveName}")
+            additionalFiles << gradleDeployDetails(
+                    new DefaultPublishArtifact(baseName, "jar.asc", "jar.asc", classifier, curDate, new File(destinationDir, archiveName + '.asc')),
+                    'artifacts',
+                    "$baseDir/${archiveName}.asc")
             if (!classifier) {
+                def pomLocation = "$projectDir/target/poms/pom-${baseName - 'groovy-'}.xml"
+                additionalFiles << gradleDeployDetails(
+                        new DefaultPublishArtifact(baseName, "pom", "pom", null, curDate, file(pomLocation)),
+                        'artifacts',
+                        "$baseDir/${baseName}-${version}.pom")
+                additionalFiles << gradleDeployDetails(
+                        new DefaultPublishArtifact(baseName, "pom.asc", "pom.asc", null, curDate, file(pomLocation + '.asc')),
+                        'artifacts',
+                        "$baseDir/${baseName}-${version}.pom.asc")
+            }
+        }
+        allprojects {
+            configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' }.each {
+                def pomLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml"
+                String baseDir = "org/codehaus/groovy/${it.name}/${version}"
                 additionalFiles << gradleDeployDetails(
-                        new DefaultPublishArtifact(baseName, "pom", "pom", null, curDate, file("$projectDir/target/poms/pom-${baseName - 'groovy-'}.xml")),
+                        new DefaultPublishArtifact(it.name, "pom.asc", "pom.asc", null, curDate, file(pomLocation + '.asc')),
                         'artifacts',
-                        "org/codehaus/groovy/${baseName}/${version}/${baseName}-${version}.pom")
+                        "$baseDir/${it.name}-${version}.pom.asc")
             }
         }
         additionalFiles.each { deployDetails.add(it) }

http://git-wip-us.apache.org/repos/asf/groovy/blob/adab2200/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 419b6f8..8515d07 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -24,10 +24,10 @@ if (isUsingBintray) {
     logger.lifecycle 'Deployment environment set to Bintray'
 }
 
+def embedded = ['asm', 'asm-util', 'asm-analysis', 'asm-tree', 'asm-commons', 'antlr', 'commons-cli', 'openbeans']
 def removeJarjaredDependencies = { p ->
     p.dependencies.removeAll(p.dependencies.findAll {
-        it.groupId == 'org.codehaus.groovy' ||
-                (['asm', 'asm-util', 'asm-analysis', 'asm-tree', 'asm-commons', 'antlr', 'commons-cli', 'openbeans'].contains(it.artifactId))
+        it.groupId == 'org.codehaus.groovy' || embedded.contains(it.artifactId)
     })
 }
 
@@ -48,14 +48,17 @@ allprojects {
         project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
             classifier = c
             type = 'jar.asc'
+            extension = 'jar.asc'
         }
     }
 
     ext.signArchiveTask = { archiveTask ->
         signing.sign(archiveTask.classifier, archiveTask.archivePath)
         project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
+            name = archiveTask.baseName
             classifier = archiveTask.classifier
             type = archiveTask.extension + '.asc'
+            extension = archiveTask.extension + '.asc'
         }
     }
 
@@ -124,7 +127,7 @@ allprojects {
 
 // the root project generates an alternate 'groovy-all' artifact
 [uploadArchives, install]*.with {
-    dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin])
+    dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin, distDoc, dist, distBin])
     doFirst {
         project.artifacts.add('archives', jarAll) {
             name = 'groovy-all'
@@ -141,40 +144,23 @@ allprojects {
         project.artifacts.add('archives', distBin) {
             name = 'groovy-binary'
         }
-        tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
-            project.artifacts.add('archives', t.archivePath) {
-                name = t.baseName
-                type = 'jar'
-                classifier = t.classifier
-            }
-        }
-
-        def indyJar = deriveFile(jarAll.archivePath, 'indy')
-        if (indyJar.exists()) {
-            project.artifacts.add('archives', indyJar)
-        }
-        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
-        if (grooidJar.exists()) {
-            project.artifacts.add('archives', grooidJar)
-        }
-    }
-}
-
-install {
-    dependsOn([distDoc, dist, distBin])
-    doFirst {
         signArchiveTask(jarAll)
         signArchiveTask(sourceAllJar)
         signArchiveTask(javadocAllJar)
         signArchiveTask(groovydocAllJar)
-        signArchiveTask(distBin)
 
-        // next three are done as a side effect since it was the easiest approach
+        // TODO rework these?
+        signing.sign(distBin)
         signing.sign(distSrc.archivePath)
         signing.sign(distDoc.archivePath)
         signing.sign(dist.archivePath)
 
         tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
+            project.artifacts.add('archives', t.archivePath) {
+                name = t.baseName
+                type = 'jar'
+                classifier = t.classifier
+            }
             signing.sign(t.classifier, t.archivePath)
             project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
                 name = t.baseName
@@ -185,10 +171,12 @@ install {
 
         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)
         }
     }


[16/22] groovy git commit: remove unused import - try to kick start github sync

Posted by su...@apache.org.
remove unused import - try to kick start github sync


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

Branch: refs/heads/parrot
Commit: 81a07ed65b5d9f1661fbad147c18bdb660e338c1
Parents: d410045
Author: paulk <pa...@asert.com.au>
Authored: Sun Jan 8 05:53:18 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sun Jan 8 05:53:18 2017 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrapeIvy.groovy | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/81a07ed6/src/main/groovy/grape/GrapeIvy.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrapeIvy.groovy b/src/main/groovy/grape/GrapeIvy.groovy
index 3702c13..c7f7b45 100644
--- a/src/main/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/grape/GrapeIvy.groovy
@@ -18,8 +18,6 @@
  */
 package groovy.grape
 
-import org.codehaus.groovy.reflection.ReflectionCache
-
 import java.util.regex.Pattern
 import org.apache.ivy.Ivy
 import org.apache.ivy.core.cache.ResolutionCacheManager


[22/22] groovy git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/groovy into parrot

Posted by su...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/groovy into parrot


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

Branch: refs/heads/parrot
Commit: 2f7e354a3d9869a5ffc3b771faf8c3caf7191a29
Parents: 68c8c5f 465b4c0
Author: sunlan <su...@apache.org>
Authored: Fri Jan 13 23:57:54 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Fri Jan 13 23:57:54 2017 +0800

----------------------------------------------------------------------
 NOTICE                                          |   2 +-
 build.gradle                                    |  46 +++---
 gradle/assemble.gradle                          |  16 +-
 gradle/backports.gradle                         |   1 +
 gradle/bintray.gradle                           |  98 -------------
 gradle/docs.gradle                              |   2 +-
 gradle/publish.gradle                           |  97 ++++++++++++
 gradle/signing.gradle                           |  90 ++++++++++++
 gradle/upload.gradle                            | 147 +++++++++++++++----
 notices/NOTICE-ALLJARJAR                        |   2 +-
 notices/NOTICE-BASE                             |   2 +-
 notices/NOTICE-BINZIP                           |   2 +-
 notices/NOTICE-GROOID                           |   2 +-
 notices/NOTICE-GROOIDJARJAR                     |   2 +-
 notices/NOTICE-JARJAR                           |   2 +-
 notices/NOTICE-SDK                              |   2 +-
 src/main/groovy/grape/GrapeIvy.groovy           |   2 -
 src/main/groovy/lang/GroovyClassLoader.java     |   2 +-
 src/main/groovy/lang/ObjectRange.java           |   2 +-
 src/main/groovy/ui/GroovyMain.java              |   6 +-
 src/main/groovy/ui/GroovySocketServer.java      |   4 +-
 src/main/groovy/util/ConfigObject.java          |   2 +-
 src/main/org/apache/groovy/metaclass/Realm.java |   2 +-
 .../org/codehaus/groovy/GroovyBugError.java     |   2 +-
 .../groovy/ast/decompiled/AsmDecompiler.java    |   4 +-
 .../groovy/classgen/FinalVariableAnalyzer.java  |   2 +-
 .../org/codehaus/groovy/classgen/Verifier.java  |   2 +-
 .../codehaus/groovy/classgen/asm/MopWriter.java |   7 +-
 .../groovy/classgen/asm/OperandStack.java       |   3 +-
 .../asm/sc/StaticTypesClosureWriter.java        |   2 +-
 .../asm/sc/StaticTypesWriterController.java     |   2 +-
 .../control/ASTTransformationsContext.java      |   1 -
 .../codehaus/groovy/control/StaticVerifier.java |   3 +-
 .../control/customizers/ImportCustomizer.java   |   2 +-
 .../customizers/SecureASTCustomizer.java        |   4 +-
 .../builder/ImportCustomizerFactory.java        |   2 +-
 .../groovy/reflection/CachedMethod.java         |   4 +-
 .../codehaus/groovy/reflection/ClassInfo.java   |   2 +-
 .../groovy/reflection/GroovyClassValue.java     |   2 +-
 .../reflection/GroovyClassValueFactory.java     |   2 +-
 .../groovy/runtime/DefaultGroovyMethods.java    |   4 +-
 .../groovy/runtime/IOGroovyMethods.java         |   2 +-
 .../groovy/runtime/ResourceGroovyMethods.java   |   4 +-
 .../groovy/runtime/SocketGroovyMethods.java     |   4 +-
 .../groovy/runtime/StringGroovyMethods.java     |  14 +-
 .../runtime/metaclass/MetaMethodIndex.java      |   4 +-
 .../groovy/tools/FileSystemCompiler.java        |   2 +-
 .../transform/AbstractASTTransformation.java    |   1 -
 .../AutoImplementASTTransformation.java         |   1 -
 .../stc/StaticTypeCheckingSupport.java          |   2 +-
 .../stc/StaticTypeCheckingVisitor.java          |   1 +
 .../org/codehaus/groovy/util/ListHashMap.java   |   7 +-
 src/spec/doc/core-operators.adoc                |   2 +-
 .../stc/ArraysAndCollectionsSTCTest.groovy      |  14 ++
 subprojects/groovy-console/NOTICE               |   2 +-
 .../swingui/AstNodeToScriptAdapter.groovy       |  15 ++
 .../swingui/ScriptToTreeNodeAdapter.groovy      |  22 +++
 .../swingui/AstNodeToScriptAdapterTest.groovy   |  18 +++
 .../swingui/ScriptToTreeNodeAdapterTest.groovy  |  26 ++++
 59 files changed, 505 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/gradle/assemble.gradle
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/gradle/docs.gradle
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/src/main/groovy/ui/GroovyMain.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/groovy/blob/2f7e354a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
----------------------------------------------------------------------


[21/22] groovy git commit: rename a property to better reflect reality (missed one instance in manual fixup of merge conflict)

Posted by su...@apache.org.
rename a property to better reflect reality (missed one instance in manual fixup of merge conflict)


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

Branch: refs/heads/parrot
Commit: 465b4c05bb199952d237975788aa18df715b974b
Parents: 86065a7
Author: paulk <pa...@asert.com.au>
Authored: Fri Jan 13 10:23:42 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Fri Jan 13 10:23:42 2017 +1000

----------------------------------------------------------------------
 gradle/publish.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/465b4c05/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index b7f07de..a5647d1 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -32,7 +32,7 @@ if (!artifactoryUser) {
     }
 }
 
-logger.lifecycle "Bintray user: $bintrayUser"
+logger.lifecycle "ArtifactoryUser user: $artifactoryUser"
 
 allprojects {
     apply plugin: 'com.jfrog.artifactory-upload'


[06/22] groovy git commit: Change end year in various notices (using updateNotices task)

Posted by su...@apache.org.
Change end year in various notices (using updateNotices task)


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

Branch: refs/heads/parrot
Commit: 3e2d5fde5d0b3cfb27bd35f8c85fdc1e779a7fb5
Parents: 98fc12d
Author: paulk <pa...@asert.com.au>
Authored: Tue Jan 3 19:33:34 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Tue Jan 3 19:33:34 2017 +1000

----------------------------------------------------------------------
 NOTICE                                                     | 2 +-
 gradle/docs.gradle                                         | 2 +-
 notices/NOTICE-ALLJARJAR                                   | 2 +-
 notices/NOTICE-BASE                                        | 2 +-
 notices/NOTICE-BINZIP                                      | 2 +-
 notices/NOTICE-GROOID                                      | 2 +-
 notices/NOTICE-GROOIDJARJAR                                | 2 +-
 notices/NOTICE-JARJAR                                      | 2 +-
 notices/NOTICE-SDK                                         | 2 +-
 src/main/org/codehaus/groovy/tools/FileSystemCompiler.java | 2 +-
 subprojects/groovy-console/NOTICE                          | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 72511db..1b76d0d 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/gradle/docs.gradle
----------------------------------------------------------------------
diff --git a/gradle/docs.gradle b/gradle/docs.gradle
index 03eef94..8d9c001 100644
--- a/gradle/docs.gradle
+++ b/gradle/docs.gradle
@@ -21,7 +21,7 @@ task doc(dependsOn: ['javadocAll', 'groovydocAll', 'docGDK']) {
     if (JavaVersion.current().java7Compatible) {
         dependsOn 'asciidocAll', 'assembleAsciidoc'
     }
-    ext.footer = 'Copyright &copy; 2003-2016 The Apache Software Foundation. All rights reserved.'
+    ext.footer = 'Copyright &copy; 2003-2017 The Apache Software Foundation. All rights reserved.'
     ext.title = "Groovy ${groovyVersion}"
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-ALLJARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-ALLJARJAR b/notices/NOTICE-ALLJARJAR
index 5462935..23fcbe3 100644
--- a/notices/NOTICE-ALLJARJAR
+++ b/notices/NOTICE-ALLJARJAR
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-BASE
----------------------------------------------------------------------
diff --git a/notices/NOTICE-BASE b/notices/NOTICE-BASE
index b863c49..8389b07 100644
--- a/notices/NOTICE-BASE
+++ b/notices/NOTICE-BASE
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-BINZIP
----------------------------------------------------------------------
diff --git a/notices/NOTICE-BINZIP b/notices/NOTICE-BINZIP
index 1a4b9bc..843691c 100644
--- a/notices/NOTICE-BINZIP
+++ b/notices/NOTICE-BINZIP
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-GROOID
----------------------------------------------------------------------
diff --git a/notices/NOTICE-GROOID b/notices/NOTICE-GROOID
index 3b6f704..032e0b8 100644
--- a/notices/NOTICE-GROOID
+++ b/notices/NOTICE-GROOID
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-GROOIDJARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-GROOIDJARJAR b/notices/NOTICE-GROOIDJARJAR
index 127a70c..58a255b 100644
--- a/notices/NOTICE-GROOIDJARJAR
+++ b/notices/NOTICE-GROOIDJARJAR
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-JARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-JARJAR b/notices/NOTICE-JARJAR
index 19bb83c..ecb27f2 100644
--- a/notices/NOTICE-JARJAR
+++ b/notices/NOTICE-JARJAR
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/notices/NOTICE-SDK
----------------------------------------------------------------------
diff --git a/notices/NOTICE-SDK b/notices/NOTICE-SDK
index c7ac460..f9f2573 100644
--- a/notices/NOTICE-SDK
+++ b/notices/NOTICE-SDK
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
index 902cc64..f254a24 100644
--- a/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -85,7 +85,7 @@ public class FileSystemCompiler {
     public static void displayVersion() {
         String version = GroovySystem.getVersion();
         System.err.println("Groovy compiler version " + version);
-        System.err.println("Copyright 2003-2016 The Apache Software Foundation. http://groovy-lang.org/");
+        System.err.println("Copyright 2003-2017 The Apache Software Foundation. http://groovy-lang.org/");
         System.err.println("");
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/3e2d5fde/subprojects/groovy-console/NOTICE
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/NOTICE b/subprojects/groovy-console/NOTICE
index 72511db..1b76d0d 100644
--- a/subprojects/groovy-console/NOTICE
+++ b/subprojects/groovy-console/NOTICE
@@ -1,5 +1,5 @@
 Apache Groovy
-Copyright 2003-2016 The Apache Software Foundation
+Copyright 2003-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).


[19/22] groovy git commit: fault tolerance if signing properties not set

Posted by su...@apache.org.
fault tolerance if signing properties not set


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

Branch: refs/heads/parrot
Commit: f9a3c0e2443c6e5f8404029193e13ca2e4c87ed2
Parents: 1d68627
Author: paulk <pa...@asert.com.au>
Authored: Tue Jan 10 18:18:50 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Jan 11 08:32:30 2017 +1000

----------------------------------------------------------------------
 gradle/upload.gradle | 48 +++++++++++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/f9a3c0e2/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 9eaef25..85ca9db 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -46,10 +46,13 @@ allprojects {
     ext.signWithClassifier = { String c, File f ->
         if (rootProject.isReleaseVersion) {
             signing.sign(c, f)
-            project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
-                classifier = c
-                type = 'asc'
-                extension = 'jar.asc'
+            def ascFile = new File(f.parent, f.name + '.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    classifier = c
+                    type = 'asc'
+                    extension = 'jar.asc'
+                }
             }
         }
     }
@@ -57,11 +60,14 @@ allprojects {
     ext.signArchiveTask = { archiveTask ->
         if (rootProject.isReleaseVersion) {
             signing.sign(archiveTask.classifier, archiveTask.archivePath)
-            project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
-                name = archiveTask.baseName
-                classifier = archiveTask.classifier
-                type = 'asc'
-                extension = archiveTask.extension + '.asc'
+            def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    name = archiveTask.baseName
+                    classifier = archiveTask.classifier
+                    type = 'asc'
+                    extension = archiveTask.extension + '.asc'
+                }
             }
         }
     }
@@ -160,10 +166,13 @@ allprojects {
         // TODO rework these?
         if (isReleaseVersion) {
             signing.sign(distBin.archivePath)
-            project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName + '.asc')) {
-                name = 'groovy-binary'
-                type = 'asc'
-                extension = 'zip.asc'
+            def ascFile = new File(distBin.destinationDir, distBin.archiveName + '.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    name = 'groovy-binary'
+                    type = 'asc'
+                    extension = 'zip.asc'
+                }
             }
             signing.sign(distSrc.archivePath)
             signing.sign(distDoc.archivePath)
@@ -178,11 +187,14 @@ allprojects {
             }
             if (isReleaseVersion) {
                 signing.sign(t.classifier, t.archivePath)
-                project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
-                    name = t.baseName
-                    classifier = t.classifier
-                    type = 'asc'
-                    extension = t.extension + '.asc'
+                def ascFile = new File(t.destinationDir, t.archiveName + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        name = t.baseName
+                        classifier = t.classifier
+                        type = 'asc'
+                        extension = t.extension + '.asc'
+                    }
                 }
             }
         }


[13/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (more tweaks - exclude extra artifacts from root project publication)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (more tweaks - exclude extra artifacts from root project publication)


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

Branch: refs/heads/parrot
Commit: cf07fc0a4840a1df56cf1a74047b278bd3fa7328
Parents: adab220
Author: paulk <pa...@asert.com.au>
Authored: Sat Jan 7 13:22:36 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:07:42 2017 +1000

----------------------------------------------------------------------
 gradle/bintray.gradle | 88 ++++++++++++----------------------------------
 gradle/upload.gradle  | 20 ++++++++---
 2 files changed, 38 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/cf07fc0a/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
index 01142ce..ee3a50b 100644
--- a/gradle/bintray.gradle
+++ b/gradle/bintray.gradle
@@ -46,6 +46,7 @@ allprojects {
         }
         publish {
             repository {
+                excludePatterns = 'org/codehaus/groovy/groovy/*/groovy-all*,org/codehaus/groovy/groovy/*/groovy-backports*,org/codehaus/groovy/groovy/*/groovy-binary*'
                 repoKey = project.hasProperty('bintrayRepoKey') ? project.bintrayRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
                 //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
                 //~/.gradle/gradle.properties, otherwise to be set in the build server
@@ -57,78 +58,35 @@ allprojects {
 }
 
 artifactoryPublish {
+    def curDate = new Date()
+    def pomSource = { a -> "$projectDir/target/poms/pom-${a.name - 'groovy-'}.xml" }
+    def destBase = { a -> "org/codehaus/groovy/${a.name}/${version}/${a.name}-${version}${a.classifier ? '-' + a.classifier : ''}" }
+    def newDetails = { orig, newFile, newExt, newType -> gradleDeployDetails(new DefaultPublishArtifact(
+            orig.name, newExt, newType, orig.classifier, curDate, newFile), 'artifacts', destBase(orig) + '.' + newExt) }
+    def makeTransformedDetails = { orig -> newDetails(orig, orig.file, orig.extension, orig.extension) }
+    def makeTransformedPomDetails = { orig -> newDetails(orig, file(pomSource(orig)), 'pom', 'pom') }
+    def makeTransformedPomSigDetails = { orig -> newDetails(orig, file(pomSource(orig) + '.asc'), 'pom.asc', 'asc') }
     mavenDescriptor = new File("$projectDir/target/poms/pom-groovy.xml")
     doFirst{
-        def curDate = new Date()
-        def additionalFiles = [
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", null,
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}.jar")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.jar"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'sources',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-sources.jar")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-sources.jar"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'javadoc',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-javadoc.jar")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-javadoc.jar"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'groovydoc',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-groovydoc.jar")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-groovydoc.jar"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "jar", "jar", 'indy',
-                        curDate, file("$projectDir/target/libs/groovy-all-${version}-indy.jar")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}-indy.jar"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "pom", "pom", null,
-                        curDate, file("$projectDir/target/poms/pom-all.xml")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.pom"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-all", "pom.asc", "pom.asc", null,
-                        curDate, file("$projectDir/target/poms/pom-all.xml.asc")), 'artifacts',
-                        "org/codehaus/groovy/groovy-all/${version}/groovy-all-${version}.pom.asc"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "zip", "zip", null,
-                        curDate, distBin.archivePath), 'artifacts',
-                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.zip"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "zip.asc", "zip.asc", null,
-                        curDate, new File(distBin.destinationDir, distBin.archiveName + '.asc')), 'artifacts',
-                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.zip.asc"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "pom", "pom", null,
-                        curDate, file("$projectDir/target/poms/pom-binary.xml")), 'artifacts',
-                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.pom"),
-                gradleDeployDetails(new DefaultPublishArtifact("groovy-binary", "pom.asc", "pom.asc", null,
-                        curDate, file("$projectDir/target/poms/pom-binary.xml.asc")), 'artifacts',
-                        "org/codehaus/groovy/groovy-binary/${version}/groovy-binary-${version}.pom.asc"),
-
-        ]
-        tasks.withType(Jar).matching { it.name.startsWith('backport') }.all {
-            String baseDir = "org/codehaus/groovy/${baseName}/${version}"
-            additionalFiles << gradleDeployDetails(
-                    new DefaultPublishArtifact(baseName, "jar", "jar", classifier, curDate, archivePath),
-                    'artifacts',
-                    "$baseDir/${archiveName}")
-            additionalFiles << gradleDeployDetails(
-                    new DefaultPublishArtifact(baseName, "jar.asc", "jar.asc", classifier, curDate, new File(destinationDir, archiveName + '.asc')),
-                    'artifacts',
-                    "$baseDir/${archiveName}.asc")
-            if (!classifier) {
-                def pomLocation = "$projectDir/target/poms/pom-${baseName - 'groovy-'}.xml"
-                additionalFiles << gradleDeployDetails(
-                        new DefaultPublishArtifact(baseName, "pom", "pom", null, curDate, file(pomLocation)),
-                        'artifacts',
-                        "$baseDir/${baseName}-${version}.pom")
-                additionalFiles << gradleDeployDetails(
-                        new DefaultPublishArtifact(baseName, "pom.asc", "pom.asc", null, curDate, file(pomLocation + '.asc')),
-                        'artifacts',
-                        "$baseDir/${baseName}-${version}.pom.asc")
+        configurations.archives.artifacts.findAll{ it.name != project.name }.each {
+            // the plugin we are using uses the project name rather than the artifact name
+            // as the artifactId, so we add the transformed one ourselves
+            // this also covers signatures which we already added during install
+            deployDetails.add(makeTransformedDetails(it))
+            if (it.type == 'jar' && it.extension == 'jar' && !it.classifier) {
+                // and the pom and its signature
+                deployDetails.add(makeTransformedPomDetails(it))
+                deployDetails.add(makeTransformedPomSigDetails(it))
             }
         }
+
         allprojects {
-            configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' }.each {
-                def pomLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml"
-                String baseDir = "org/codehaus/groovy/${it.name}/${version}"
-                additionalFiles << gradleDeployDetails(
-                        new DefaultPublishArtifact(it.name, "pom.asc", "pom.asc", null, curDate, file(pomLocation + '.asc')),
-                        'artifacts',
-                        "$baseDir/${it.name}-${version}.pom.asc")
+            configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
+                // add pom signatures
+                def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+                deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
             }
         }
-        additionalFiles.each { deployDetails.add(it) }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/cf07fc0a/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 8515d07..d99ad18 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -47,7 +47,7 @@ allprojects {
         signing.sign(c, f)
         project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
             classifier = c
-            type = 'jar.asc'
+            type = 'asc'
             extension = 'jar.asc'
         }
     }
@@ -57,7 +57,7 @@ allprojects {
         project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
             name = archiveTask.baseName
             classifier = archiveTask.classifier
-            type = archiveTask.extension + '.asc'
+            type = 'asc'
             extension = archiveTask.extension + '.asc'
         }
     }
@@ -109,6 +109,8 @@ allprojects {
 
     install {
         doFirst {
+            // gradle doesn't expect us to mutate configurations like we do here
+            // so signing the configuration won't work and we do it manually here
             signArchiveTask(jar)
             signArchiveTask(sourceJar)
             signArchiveTask(javadocJar)
@@ -125,7 +127,9 @@ allprojects {
     }
 }
 
-// the root project generates an alternate 'groovy-all' artifact
+// the root project generates several alternate artifacts, e.g. 'groovy-all'
+// 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])
     doFirst {
@@ -150,7 +154,12 @@ allprojects {
         signArchiveTask(groovydocAllJar)
 
         // TODO rework these?
-        signing.sign(distBin)
+        signing.sign(distBin.archivePath)
+        project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName + '.asc')) {
+            name = 'groovy-binary'
+            type = 'asc'
+            extension = 'zip.asc'
+        }
         signing.sign(distSrc.archivePath)
         signing.sign(distDoc.archivePath)
         signing.sign(dist.archivePath)
@@ -165,7 +174,8 @@ allprojects {
             project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
                 name = t.baseName
                 classifier = t.classifier
-                type = t.extension + '.asc'
+                type = 'asc'
+                extension = t.extension + '.asc'
             }
         }
 


[11/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (more tweaks)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (more tweaks)


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

Branch: refs/heads/parrot
Commit: e79fcdbd5ac6cce3677dd7270f028d5feff985af
Parents: 0b18eda
Author: paulk <pa...@asert.com.au>
Authored: Fri Jan 6 15:11:01 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:05:52 2017 +1000

----------------------------------------------------------------------
 build.gradle          |  4 +--
 gradle/signing.gradle | 31 ++++++++---------
 gradle/upload.gradle  | 85 +++++++++++++++++++++-------------------------
 3 files changed, 53 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e79fcdbd/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 79922b2..70f8732 100644
--- a/build.gradle
+++ b/build.gradle
@@ -72,9 +72,6 @@ indyBanner()
 // TODO use antlr plugin
 //apply plugin: 'antlr'
 
-ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
-ext.shouldSign = isReleaseVersion
-
 allprojects {
     apply plugin: 'java'
 
@@ -173,6 +170,7 @@ ext {
     xmlunitVersion = '1.6'
     xstreamVersion = '1.4.9'
     spockVersion = '1.0-groovy-2.4'
+    isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
 }
 
 dependencies {

http://git-wip-us.apache.org/repos/asf/groovy/blob/e79fcdbd/gradle/signing.gradle
----------------------------------------------------------------------
diff --git a/gradle/signing.gradle b/gradle/signing.gradle
index 2885163..544c533 100644
--- a/gradle/signing.gradle
+++ b/gradle/signing.gradle
@@ -17,22 +17,20 @@
  *  under the License.
  */
 
-import org.gradle.plugins.signing.Sign
-
 allprojects {
     apply plugin: 'signing'
     signing {
         required {
-            isReleaseVersion &&
-                    (gradle.taskGraph.hasTask('artifactoryPublish') || project.hasProperty('forceSign'))
+            rootProject.ext.isReleaseVersion &&
+                    (gradle.taskGraph.hasTask(':artifactoryPublish') || rootProject.hasProperty('forceSign'))
         }
     }
 }
 
 gradle.taskGraph.whenReady { taskGraph ->
-    if (taskGraph.allTasks.any { it instanceof Sign } || project.hasProperty('forceSign')) {
+    if (project.ext.isReleaseVersion &&
+            (taskGraph.hasTask(':artifactoryPublish') || project.hasProperty('forceSign'))) {
         // Use Java 6's console or Swing to read input (not suitable for CI)
-        project.ext.shouldSign = true
         if (!project.hasProperty('signing.keyId') ||
                 !project.hasProperty('signing.secretKeyRingFile') ||
                 !project.hasProperty('signing.password')) {
@@ -63,30 +61,29 @@ def promptUser(String prompt) {
     def response = ''
     if (System.console() == null) {
         new groovy.swing.SwingBuilder().edt {
-            dialog(modal: true, //Otherwise the build will continue running
-                    title: 'Reponse required', //Dialog title
+            dialog(modal: true, // pause build
+                    title: 'Reponse required', // dialog title
                     alwaysOnTop: true,
                     resizable: false,
-                    locationRelativeTo: null, //Place dialog in center of the screen
-                    pack: true, //We need to pack the dialog (so it will take the size of its children)
+                    locationRelativeTo: null, // centered on screen
+                    pack: true,
                     show: true
-            ){
-                vbox { //Put everything below each other
+            ) {
+                vbox {
                     label(text: "$prompt:")
                     input = passwordField()
                     button(defaultButton: true, text: 'OK', actionPerformed: {
-                        response = new String(input.password); //set pass variable to value of input field
-                        dispose(); //close dialog
+                        response = new String(input.password)
+                        dispose()
                     })
                 }
             }
         }
-    }
-    else{
+    } else {
         response = new String(System.console().readPassword("\n$prompt: "))
     }
 
-    if(response.size() <= 0){
+    if (!response) {
         throw new InvalidUserDataException("Null response detected!")
     }
     response

http://git-wip-us.apache.org/repos/asf/groovy/blob/e79fcdbd/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 5668454..419b6f8 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -63,9 +63,7 @@ allprojects {
         repositories {
             mavenDeployer {
                 pom pomConfigureClosure
-                if (shouldSign) {
-                    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-                }
+                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
             }
         }
     }
@@ -74,9 +72,7 @@ allprojects {
         repositories {
             mavenInstaller {
                 pom pomConfigureClosure
-                if (shouldSign) {
-                    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-                }
+                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
             }
         }
     }
@@ -110,19 +106,17 @@ allprojects {
 
     install {
         doFirst {
-            if (shouldSign) {
-                signArchiveTask(jar)
-                signArchiveTask(sourceJar)
-                signArchiveTask(javadocJar)
-                signArchiveTask(groovydocJar)
-                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-                if (indyJar.exists()) {
-                    signWithClassifier('indy', indyJar)
-                }
-                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-                if (grooidJar.exists()) {
-                    signWithClassifier('grooid', grooidJar)
-                }
+            signArchiveTask(jar)
+            signArchiveTask(sourceJar)
+            signArchiveTask(javadocJar)
+            signArchiveTask(groovydocJar)
+            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+            if (indyJar.exists()) {
+                signWithClassifier('indy', indyJar)
+            }
+            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+            if (grooidJar.exists()) {
+                signWithClassifier('grooid', grooidJar)
             }
         }
     }
@@ -167,36 +161,35 @@ allprojects {
 }
 
 install {
+    dependsOn([distDoc, dist, distBin])
     doFirst {
-        if (shouldSign) {
-            signArchiveTask(jarAll)
-            signArchiveTask(sourceAllJar)
-            signArchiveTask(javadocAllJar)
-            signArchiveTask(groovydocAllJar)
-            signArchiveTask(distBin)
+        signArchiveTask(jarAll)
+        signArchiveTask(sourceAllJar)
+        signArchiveTask(javadocAllJar)
+        signArchiveTask(groovydocAllJar)
+        signArchiveTask(distBin)
 
-            // next three are done as a side effect since it was the easiest approach
-            signing.sign(distSrc.archivePath)
-            signing.sign(distDoc.archivePath)
-            signing.sign(dist.archivePath)
+        // next three are done as a side effect since it was the easiest approach
+        signing.sign(distSrc.archivePath)
+        signing.sign(distDoc.archivePath)
+        signing.sign(dist.archivePath)
 
-            tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
-                signing.sign(t.classifier, t.archivePath)
-                project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
-                    name = t.baseName
-                    classifier = t.classifier
-                    type = t.extension + '.asc'
-                }
+        tasks.withType(Jar).matching { it.name.startsWith('backport') }.each { t ->
+            signing.sign(t.classifier, t.archivePath)
+            project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
+                name = t.baseName
+                classifier = t.classifier
+                type = t.extension + '.asc'
             }
+        }
 
-            def indyJar = deriveFile(jarAll.archivePath, 'indy')
-            if (indyJar.exists()) {
-                signWithClassifier('indy', indyJar)
-            }
-            def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                signWithClassifier('grooid', grooidJar)
-            }
+        def indyJar = deriveFile(jarAll.archivePath, 'indy')
+        if (indyJar.exists()) {
+            signWithClassifier('indy', indyJar)
+        }
+        def grooidJar = deriveFile(jarAll.archivePath, 'grooid')
+        if (grooidJar.exists()) {
+            signWithClassifier('grooid', grooidJar)
         }
     }
 }
@@ -259,9 +252,7 @@ ext.pomAll = {
         p.dependencies.clear()
     }
 
-    if (shouldSign) {
-        beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-    }
+    beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
 }
 
 install {


[14/22] groovy git commit: push signing of artifacts into the main build instead of the groovy-release repo (more tweaks - fix zip sigs)

Posted by su...@apache.org.
push signing of artifacts into the main build instead of the groovy-release repo (more tweaks - fix zip sigs)


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

Branch: refs/heads/parrot
Commit: 36a55d11b78234eb4e73d66678087701793c4f90
Parents: cf07fc0
Author: paulk <pa...@asert.com.au>
Authored: Sat Jan 7 13:59:15 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jan 7 14:07:54 2017 +1000

----------------------------------------------------------------------
 gradle/bintray.gradle | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/36a55d11/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
index ee3a50b..20d4b5d 100644
--- a/gradle/bintray.gradle
+++ b/gradle/bintray.gradle
@@ -73,8 +73,8 @@ artifactoryPublish {
             // as the artifactId, so we add the transformed one ourselves
             // this also covers signatures which we already added during install
             deployDetails.add(makeTransformedDetails(it))
-            if (it.type == 'jar' && it.extension == 'jar' && !it.classifier) {
-                // and the pom and its signature
+            if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
+                // add the pom and its signature
                 deployDetails.add(makeTransformedPomDetails(it))
                 deployDetails.add(makeTransformedPomSigDetails(it))
             }


[02/22] groovy git commit: minor refactor

Posted by su...@apache.org.
minor refactor


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

Branch: refs/heads/parrot
Commit: a19feb7d310bb86b925e1d092af28ad00dceee6c
Parents: 370df79
Author: paulk <pa...@asert.com.au>
Authored: Thu Dec 29 18:29:45 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Dec 29 18:29:45 2016 +1000

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


http://git-wip-us.apache.org/repos/asf/groovy/blob/a19feb7d/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 9ed8d26..a23496b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -467,7 +467,9 @@ compileTestGroovy {
 
 // TODO superfluous to check for JDK7 for Gradle version 3.2+ but leave for future?
 task checkCompatibility {
-    assert JavaVersion.current().java7Compatible
+    doLast {
+        assert JavaVersion.current().java7Compatible
+    }
 }
 
 apply from: 'gradle/test.gradle'