groovy git commit: allow antlr4 parser to be turned off

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: allow antlr4 parser to be turned off

paulk
Repository: groovy
Updated Branches:
  refs/heads/parrot f42c8b86e -> 9d2f6f193


allow antlr4 parser to be turned off


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

Branch: refs/heads/parrot
Commit: 9d2f6f1939f49eea301fbe17e928d5f4a9a4b60d
Parents: f42c8b8
Author: paulk <[hidden email]>
Authored: Fri May 12 12:39:27 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri May 12 12:39:27 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/groovy/blob/9d2f6f19/subprojects/parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/build.gradle b/subprojects/parser-antlr4/build.gradle
index 56c9c11..78e5c74 100644
--- a/subprojects/parser-antlr4/build.gradle
+++ b/subprojects/parser-antlr4/build.gradle
@@ -17,6 +17,18 @@
  *  under the License.
  */
 
+if (rootProject.hasProperty('useAntlr4') && !Boolean.valueOf(rootProject.getProperty('useAntlr4'))) {
+    allprojects {
+        tasks.withType(GroovyCompile) {
+            groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=false"]
+        }
+    }
+    test {
+        jvmArgs "-Dgroovy.antlr4=false"
+    }
+    return
+}
+
 apply plugin: 'me.champeau.gradle.antlr4'
 
 def srcBase = "subprojects/parser-antlr4/src"