antlr5 icon indicating copy to clipboard operation
antlr5 copied to clipboard

Migrate the build to Gradle

Open ericvergnaud opened this issue 11 months ago • 4 comments

Once #40 is merged, we will be aligned with our target architecture, which seems a good time to switch to Gradle so we can start generating WebAssembly using the Gradle plugin.

ericvergnaud avatar Feb 27 '24 12:02 ericvergnaud

@KvanTTT @lppedd this is the next task, one of you wanna do it or should I give it a go ?

ericvergnaud avatar Mar 08 '24 20:03 ericvergnaud

Hey! I can have a look at it next week, mid week. Been busy with work stuff.

I'll first check what's the required effort.

lppedd avatar Mar 08 '24 20:03 lppedd

@lppedd any progress ? Just let me know if you're too busy and I'll give it a try.

ericvergnaud avatar Mar 14 '24 09:03 ericvergnaud

I've started looking into this, see https://github.com/ericvergnaud/antlr5/tree/build-using-gradle. I'm able to build the Core, Java and Kotlin runtimes. The tool maven build is pretty complex. It:

  1. generates various parsers using antlr3 maven plugin
  2. transforms the generated code to antlr4 using com.google.code.maven-replacer-plugin/replacer
  3. generates a UnicodeData.java file from a string template using com.webguys/string-template-maven-plugin
    Gradle has a built-in antlr task, which seems to handle 1) properly For 2) and 3), I couldn't locate gradle plugins. I tried using MavenExec plugin but couldn't get it to work... I don't think either of these deserve a plugin, it should be possible to achieve things using custom Gradle tasks. What do you think ?

ericvergnaud avatar Mar 20 '24 15:03 ericvergnaud