Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.plugins.antlr
[Java] Class AntlrTask

    java.lang.Object
      org.gradle.api.internal.AbstractTask
          org.gradle.api.DefaultTask
              org.gradle.api.internal.ConventionTask
                  org.gradle.api.tasks.SourceTask
                      org.gradle.api.plugins.antlr.AntlrTask

    public class AntlrTask
    extends SourceTask

Generates parsers from Antlr grammars.

Most properties here are self-evident, but I wanted to highlight one in particular: setAntlrClasspath is used to define the classpath that should be passed along to the Ant org.apache.tools.ant.taskdefs.optional.ANTLR task as its classpath. That is the classpath it uses to perform generation execution. This should really only require the antlr jar. In AntlrPlugin usage, this would happen simply by adding your antlr jar into the 'antlr' dependency configuration created and exposed by the AntlrPlugin itself.

Authors:
  Steve Ebersole

Field Summary

Fields inherited from class org.gradle.api.internal.ConventionTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Method Summary
`void` | `generate()`
`FileCollection` | `getAntlrClasspath()` Returns the classpath containing the Ant ANTLR task implementation.
`java.io.File` | `getOutputDirectory()` Returns the directory to generate the parser source files into.
`boolean` | `isTrace()` Specifies that all rules call `traceIn`/`traceOut`.
`boolean` | `isTraceLexer()` Specifies that all lexer rules call `traceIn`/`traceOut`.
`boolean` | `isTraceParser()` Specifies that all parser rules call `traceIn`/`traceOut`.
`boolean` | `isTraceTreeWalker()` Specifies that all tree walker rules call `traceIn`/`traceOut`.
`void` | `setAntlrClasspath(FileCollection antlrClasspath)` Specifies the classpath containing the Ant ANTLR task implementation.
`void` | `setOutputDirectory(java.io.File outputDirectory)` Specifies the directory to generate the parser source files into.
`void` | `setTrace(boolean trace)`
`void` | `setTraceLexer(boolean traceLexer)`
`void` | `setTraceParser(boolean traceParser)`
`void` | `setTraceTreeWalker(boolean traceTreeWalker)`

Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getDefaultSource, getExcludes, getIncludes, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source

Methods inherited from class org.gradle.api.internal.ConventionTask
org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, org.gradle.api.tasks.ConventionValue), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setConventionMapping(org.gradle.api.internal.ConventionMapping), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.ConventionTask#disableStandardOutputCapture(), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAdditionalProperties(), org.gradle.api.internal.ConventionTask#getDynamicObjectHelper(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()

Method Detail

### generate

    @TaskAction
    public void generate()

### getAntlrClasspath

    @InputFiles
    public FileCollection getAntlrClasspath()

  Returns the classpath containing the Ant ANTLR task implementation.
  Returns:
    The Ant task implementation classpath.

### getOutputDirectory

    @OutputDirectory
    public java.io.File getOutputDirectory()

  Returns the directory to generate the parser source files into.
  Returns:
    The output directory.

### isTrace

    public boolean isTrace()

  Specifies that all rules call `traceIn`/`traceOut`.

### isTraceLexer

    public boolean isTraceLexer()

  Specifies that all lexer rules call `traceIn`/`traceOut`.

### isTraceParser

    public boolean isTraceParser()

  Specifies that all parser rules call `traceIn`/`traceOut`.

### isTraceTreeWalker

    public boolean isTraceTreeWalker()

  Specifies that all tree walker rules call `traceIn`/`traceOut`.

### setAntlrClasspath

    public void setAntlrClasspath(FileCollection antlrClasspath)

  Specifies the classpath containing the Ant ANTLR task implementation.
  Parameters:
    `antlrClasspath` - The Ant task implementation classpath. Must not be null.

### setOutputDirectory

    public void setOutputDirectory(java.io.File outputDirectory)

  Specifies the directory to generate the parser source files into.
  Parameters:
    `outputDirectory` - The output directory. Must not be null.

### setTrace

    public void setTrace(boolean trace)

### setTraceLexer

    public void setTraceLexer(boolean traceLexer)

### setTraceParser

    public void setTraceParser(boolean traceParser)

### setTraceTreeWalker

    public void setTraceTreeWalker(boolean traceTreeWalker)

Groovy Documentation