You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2016/06/03 04:58:24 UTC

[1/2] groovy git commit: GROOVY-7833: let grape ignore runner lines with hash to enable comments.

Repository: groovy
Updated Branches:
  refs/heads/master 0795f3eef -> 38439af66


GROOVY-7833: let grape ignore runner lines with hash to enable comments.

When getting a groovy jar via grab, there will be a TestNG runner configuration in the jar. This configuration contains the Apache License 2 text, as required by the foundation. The code expected the class only. With this change the comments will be ignored.


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

Branch: refs/heads/master
Commit: 7b68c848092586343ebc1c9a991b39aa8edc928e
Parents: 0795f3e
Author: Jochen Theodorou <bl...@gmx.org>
Authored: Sat May 7 10:44:22 2016 +0200
Committer: paulk <pa...@asert.com.au>
Committed: Fri Jun 3 14:28:18 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrapeIvy.groovy | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7b68c848/src/main/groovy/grape/GrapeIvy.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrapeIvy.groovy b/src/main/groovy/grape/GrapeIvy.groovy
index 3bdabe8..dc62ceb 100644
--- a/src/main/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/grape/GrapeIvy.groovy
@@ -339,7 +339,10 @@ class GrapeIvy implements GrapeEngine {
 
     void processRunners(InputStream is, String name, ClassLoader loader) {
         is.text.readLines().each {
-            GroovySystem.RUNNER_REGISTRY[name] = loader.loadClass(it.trim()).newInstance()
+            def line = it.trim()
+            if (!line.startsWith("#")) {
+                GroovySystem.RUNNER_REGISTRY[name] = loader.loadClass(line).newInstance()
+            }
         }
     }
 


[2/2] groovy git commit: GROOVY-7833: exception in phase 'conversion' (also ignore blank lines - closes #329)

Posted by pa...@apache.org.
GROOVY-7833: exception in phase 'conversion' (also ignore blank lines - closes #329)


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

Branch: refs/heads/master
Commit: 38439af6688f55b041a00a24a590a87df4fcea36
Parents: 7b68c84
Author: paulk <pa...@asert.com.au>
Authored: Fri Jun 3 14:57:45 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Fri Jun 3 14:57:45 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrapeIvy.groovy | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/38439af6/src/main/groovy/grape/GrapeIvy.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrapeIvy.groovy b/src/main/groovy/grape/GrapeIvy.groovy
index dc62ceb..3702c13 100644
--- a/src/main/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/grape/GrapeIvy.groovy
@@ -338,10 +338,11 @@ class GrapeIvy implements GrapeEngine {
     }
 
     void processRunners(InputStream is, String name, ClassLoader loader) {
-        is.text.readLines().each {
-            def line = it.trim()
-            if (!line.startsWith("#")) {
-                GroovySystem.RUNNER_REGISTRY[name] = loader.loadClass(line).newInstance()
+        is.text.readLines()*.trim().findAll{ !it.isEmpty() && it[0] != '#' }.each {
+            try {
+                GroovySystem.RUNNER_REGISTRY[name] = loader.loadClass(it).newInstance()
+            } catch (Exception ex) {
+                throw new IllegalStateException("Error registering runner class '" + it + "'", ex)
             }
         }
     }