Plugin to work around include-files issue with AntlrTask


License

License

Categories

Categories

Gradle Build Tools Ant ANTLR Compiler-compiler
GroupId

GroupId

org.caffinitas.gradle.antlr
ArtifactId

ArtifactId

gradle-antlr
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Plugin to work around include-files issue with AntlrTask
Plugin to work around include-files issue with AntlrTask
Project URL

Project URL

https://github.com/snazy/gradle-antlr/
Source Code Management

Source Code Management

https://github.com/snazy/gradle-antlr/

Download gradle-antlr

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Plugin to work around these issues in the built-in AntlrTask in Gradle. The code works with Gradle 6.4.x and newer, it might work with earlier Gradle versions.

See these Gradle issues:

Usage:

plugins {
    id("org.caffinitas.gradle.antlr") version "0.1"
}

The plugin disables all existing AntlrTasks. You need to register new tasks of the type CAntlrTask like this:

import org.caffinitas.gradle.antlr.CAntlrTask

val generateGrammarSourceCassandra by tasks.registering(CAntlrTask::class) {
    // find the "original" task and copy the configuration from that one
    val antlrTask = tasks.getByName("generateGrammarSource", AntlrTask::class)
    configureFrom(antlrTask)

    // add custom configurations (same as for the original AntlrTask)

    // specify the include files
    includeFiles = setOf("Lexer.g", "Parser.g")
}

Note: you cannot reuse a task name created by Gradle's built-in antlr-plugin.

Versions

Version
0.1.1
0.1