groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [1/3] groovy git commit: trim antlr4 runtime dependency to just antlr4-runtime
Date Thu, 14 Sep 2017 10:22:52 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X c92b9a751 -> 446a8ade1


trim antlr4 runtime dependency to just antlr4-runtime


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 2e0a78dc827df0a33e929eb1ffb04f126fec8377
Parents: c92b9a7
Author: paulk <paulk@asert.com.au>
Authored: Thu Sep 14 20:12:31 2017 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Thu Sep 14 20:14:25 2017 +1000

----------------------------------------------------------------------
 subprojects/parser-antlr4/build.gradle          |  8 ++-
 .../parser/antlr4/util/GroovyTestRig.groovy     | 74 --------------------
 2 files changed, 7 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2e0a78dc/subprojects/parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/build.gradle b/subprojects/parser-antlr4/build.gradle
index d1fd1d0..371e53a 100644
--- a/subprojects/parser-antlr4/build.gradle
+++ b/subprojects/parser-antlr4/build.gradle
@@ -53,12 +53,18 @@ generateGrammarSource {
 
 compileJava.dependsOn generateGrammarSource
 
+configurations {
+    compile {
+        extendsFrom = extendsFrom.findAll { it != configurations.antlr }
+    }
+}
+
 dependencies {
     antlr "com.tunnelvisionlabs:antlr4:$antlr4Version"
+    compile "com.tunnelvisionlabs:antlr4-runtime:$antlr4Version"
     testCompile project(':groovy-test')
 }
 
-
 sourceSets.main.java.srcDirs += file("$srcMain/java");
 sourceSets.main.groovy.srcDirs += file("$srcMain/groovy");
 sourceSets.main.resources.srcDirs += file("$srcMain/resources");

http://git-wip-us.apache.org/repos/asf/groovy/blob/2e0a78dc/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
b/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
deleted file mode 100644
index 798ed5f..0000000
--- a/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
+++ /dev/null
@@ -1,74 +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.
- */
-package org.apache.groovy.parser.antlr4.util
-
-import groovy.util.logging.Log
-import org.antlr.v4.gui.TestRig
-import org.antlr.v4.runtime.ANTLRInputStream
-import org.antlr.v4.runtime.CommonTokenStream
-import org.apache.groovy.parser.antlr4.GroovyLangLexer
-import org.apache.groovy.parser.antlr4.GroovyLangParser
-
-/**
- * A basic debug tool for investigating the parse trees and tokens of Groovy source code
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-@Log
-public class GroovyTestRig extends TestRig {
-    public GroovyTestRig(String[] args) throws Exception {
-        super(['Groovy', args.contains('-lexer') ? 'tokens' : 'compilationUnit', *args] as
String[]);
-    }
-
-    public void inspectParseTree() {
-        def inputFile = new File(this.inputFiles[0]);
-
-        if (!(inputFile.exists() && inputFile.isFile())) {
-            log.info "Input file[${inputFile.absolutePath}] does not exist."
-            return;
-        }
-
-        byte[] content = inputFile.bytes;
-        String text = new String(content, this.encoding ?: 'UTF-8');
-
-        GroovyLangLexer lexer = new GroovyLangLexer(new ANTLRInputStream(text));
-        CommonTokenStream tokens = new CommonTokenStream(lexer);
-        GroovyLangParser parser = new GroovyLangParser(tokens);
-
-        this.process(lexer, GroovyLangParser.class, parser, new ByteArrayInputStream(content),
new StringReader(text));
-    }
-
-    public static void main(String[] args) {
-        if (args.length == 0) {
-            log.info "Usage: [-tokens] [-lexer] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]
[-trace] [-diagnostics] [-SLL] input-filename";
-            return;
-        }
-
-        if (args.every { it.startsWith('-') }) {
-            log.info "input-filename is required!"
-            return;
-        }
-
-        GroovyTestRig groovyTestRig = new GroovyTestRig(args);
-
-        groovyTestRig.inspectParseTree();
-    }
-}
-


Mime
View raw message