melix / antlr4-gradle-plugin

Antlr4 plugin for Gradle
Apache License 2.0
41 stars 13 forks source link

change Antlr4Plugin to allow the user to specify alternate antlr versions #3

Closed stephengaito closed 10 years ago

stephengaito commented 10 years ago

Cédric,

Many thanks for making your project open-source. It is clean and simple.

However I need a clean way to override the ANTLR4 version so that I and/or users can use development and/or future releases without having to change the plugin.

I have done this as cleanly as I could.

I use a project.afterEvaluate in which I check the antlr4 configuration to see if the user has added a dependency... and if they have not, I add the current default 'org.antlr:antlr4:4.2.2' version.

I have also added two additional tests to ensure the default dependency is added if the user has not added their own dependency/version.

It would be very useful to the whole community if you could accept this pull request.

Let me know if you have any questions or changes.

Regards, Stephen Gaito (lead/only developer of FandianPF)

melix commented 10 years ago

Hi!

Thanks for the pull request! Are you sure this is necessary? As far as I know, this should be enough:

apply plugin: 'antlr4'

dependencies {
   antlr4 'org.antlr:antlr4:4.3.0' // override default version
}
stephengaito commented 10 years ago

Cédric,

Indeed you are correct. While this detour has taken me a couple of days, it has deepened my understanding and respect for Gradle, I am glad that I have (finally) switched to it.

So I have closed this pull request.

Regards, Stephen Gaito