Commit 9a8bbe8c authored by Fred Eisele's avatar Fred Eisele
Browse files

update to gradle 5.0

parent e35298bd
......@@ -20,3 +20,6 @@ buildSrc/build/
*.dvi
.gradle/
bin/
*.tokens
......@@ -91,9 +91,9 @@ task antlrGen (type: Antlr4Task) {
compileJava.dependsOn antlrGen
// ./gradlew wrapper --gradle-version 5.0
wrapper {
gradleVersion = '4.10.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
distributionType = Wrapper.DistributionType.ALL
}
......
......@@ -34,29 +34,32 @@ class Antlr4Task extends DefaultTask {
* _ force-atn bool "use the ATN simulator for all predictions"
* _ log bool "dump lots of logging info to antlr-timestamp.log"]
*/
@Input @Optional String maxHeapSize;
@InputFile String lexerGrammar;
@InputFile String parserGrammar;
@InputDirectory File sourceDir;
@OutputDirectory File targetDir;
@Input @Optional String encoding;
@Input @Optional String msgFormat;
@Input @Optional String module;
@Input @Optional String override;
@Input @Optional Boolean show;
@Input @Optional Boolean atn;
@Input @Optional Boolean longMsg;
@Input @Optional Boolean listener;
@Input @Optional Boolean visitor;
@Input @Optional Boolean depend;
@Input @Optional Boolean warnError;
@Input @Optional Boolean saveLexer;
@Input @Optional Boolean debugStrTempl;
@Input @Optional Boolean debugStrTemplWait;
@Input @Optional Boolean forceAtn;
@Input @Optional Boolean log;
@InputFile public String lexerGrammar;
@InputFile public String parserGrammar;
@InputDirectory public File sourceDir;
@OutputDirectory public File targetDir;
@Input @Optional public String maxHeapSize;
@Input @Optional public String encoding;
@Input @Optional public String msgFormat;
@Input @Optional public String module;
@Input @Optional public String override;
@Input @Optional public Boolean show;
@Input @Optional public Boolean atn;
@Input @Optional public Boolean longMsg;
@Input @Optional public Boolean listener;
@Input @Optional public Boolean visitor;
@Input @Optional public Boolean depend;
@Input @Optional public Boolean warnError;
@Input @Optional public Boolean saveLexer;
@Input @Optional public Boolean debugStrTempl;
@Input @Optional public Boolean debugStrTemplWait;
@Input @Optional public Boolean forceAtn;
@Input @Optional public Boolean log;
Antlr4Task() {
description = 'An antlr4 grammar generates a java parser'
......@@ -67,26 +70,28 @@ class Antlr4Task extends DefaultTask {
void start() {
ArrayList<String> args = new ArrayList<>();
args.push('-o');
args.push(targetDir.canonicalFile.toString())
args.add('-o');
args.add(targetDir.canonicalFile.toString())
logger.quiet 'target dir: ' + targetDir.canonicalFile
args.push('-lib');
args.push(sourceDir.canonicalFile.toString())
args.add('-lib');
args.add(sourceDir.canonicalFile.toString())
logger.quiet 'source dir: ' + sourceDir.canonicalFile
args.push('-package')
args.push(module)
args.add('-package')
args.add(module)
def lexerArgs = args.clone();
lexerArgs.push(lexerGrammar);
lexerArgs.add(lexerGrammar);
String[] lexerArgsArray = lexerArgs.toArray(new String[lexerArgs.size()]);
logger.quiet 'lexer: ' + lexerArgsArray;
try {
Tool lexerTool = new Tool(lexerArgsArray);
lexerTool.processGrammarsOnCommandLine();
}
catch (Exception ex) {
logger.quiet 'lexer: ' + lexerArgsArray;
logger.quiet 'cause: '+ ex.getLocalizedMessage();
throw new GradleException(ex.message)
}
......
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment