markjfisher / antlr4-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle Plugin for antlr4 development
License: Apache License 2.0
Gradle Plugin for antlr4 development
License: Apache License 2.0
If the files generated from the grammar are not in the same package as the files using them, the build fails. In the example project here, move Calc to the another project - I tried example.subpackage, and the build fails. I've seen similar problems in my own project as well.
Hi there! I have been looking into getting antlr4 running within a Gradle build and I have come up with the following code which I think you will find useful.
task generateParser(type: JavaExec) {
def outputDir = "$buildDir/antlr"
def deps = ['org.antlr:antlr4:4.1']
def target = 'grammars/Template.g4'
classpath = configurations.detachedConfiguration(*deps.collect({
dependencies.create(it)
}))
args += [
'-o', outputDir,
target
]
main = 'org.antlr.v4.Tool'
}
Some of the stuff there I got from looking at your source. However I decided I simply needed the task without meddling around with plugins. Hope you find this code useful anyway (because now you don't need to have those dependencies in your user's buildscripts). Sorry a bit lazy to submit a pull request =)
This project's author forgot to specify under which license his source code is available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.