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 <blackd...@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()
+            }
         }
     }
 

Reply via email to