AntlrTask (Gradle API 2.9)
Date: 2015-11-17

Package: org.gradle.api.plugins.antlr

## [Java] Class AntlrTask

- org.gradle.api.plugins.antlr.AntlrTask

- Generates parsers from Antlr grammars.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class SourceTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`
    `class org.gradle.api.internal.ConventionTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `execute(IncrementalTaskInputs inputs)`
    `FileCollection` | `getAntlrClasspath()` Returns the classpath containing the Ant ANTLR task implementation.
    `List<String>` | `getArguments()` List of command-line arguments passed to the antlr process
    `String` | `getMaxHeapSize()` The maximum heap size for the forked antlr process (ex: '1g').
    `File` | `getOutputDirectory()` Returns the directory to generate the parser source files into.
    `FileTree` | `getSource()` Returns the source for this task, after the include and exclude patterns have been applied.
    `protected org.gradle.internal.Factory<org.gradle.process.internal.WorkerProcessBuilder>` | `getWorkerProcessBuilderFactory()`
    `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`.
    `protected void` | `setAntlrClasspath(FileCollection antlrClasspath)` Specifies the classpath containing the Ant ANTLR task implementation.
    `void` | `setArguments(List<String> arguments)`
    `void` | `setMaxHeapSize(String maxHeapSize)`
    `void` | `setOutputDirectory(File outputDirectory)` Specifies the directory to generate the parser source files into.
    `void` | `setSource(Object source)` Sets the source for this task.
    `void` | `setTrace(boolean trace)`
    `void` | `setTraceLexer(boolean traceLexer)`
    `void` | `setTraceParser(boolean traceParser)`
    `void` | `setTraceTreeWalker(boolean traceTreeWalker)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SourceTask` | `source, getSource, getIncludes, getExcludes, setSource, include, include, include, include, include, include, include, include, setIncludes, setIncludes, exclude, exclude, exclude, exclude, exclude, exclude, exclude, exclude, setExcludes, setExcludes, conventionMapping, conventionMapping, getConventionMapping, setProperty, toString, compareTo, compareTo, getName, getActions, getState, getState, setName, getPath, getExtensions, getLogger, execute, configure, configure, getDescription, leftShift, isEnabled, property, setEnabled, getOutputs, getOutputs, getShouldRunAfter, getProject, getTaskDependencies, getTaskDependencies, setActions, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, deleteAllActions, getEnabled, getAnt, getLogging, getLogging, hasProperty, getConvention, setDescription, getGroup, setGroup, dependsOnTaskDidWork, getInputs, getTemporaryDir, mustRunAfter, setMustRunAfter, getMustRunAfter, finalizedBy, setFinalizedBy, getFinalizedBy, shouldRunAfter, setShouldRunAfter, getDependsOn, setDependsOn, dependsOn, onlyIf, onlyIf, getStandardOutputCapture, getAsDynamicObject, setProject, prependParallelSafeAction, injectIntoNewInstance, getTaskActions, getOnlyIf, getImpliesSubProjects, setImpliesSubProjects, getExecuter, setExecuter, getTemporaryDirFactory, addValidator, getValidators, appendParallelSafeAction, isHasCustomActions, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`
    `class org.gradle.api.internal.ConventionTask` | `org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, groovy.lang.Closure), org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#getConventionMapping(), 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#getState(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getExtensions(), 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#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getShouldRunAfter(), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), 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(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getMustRunAfter(), org.gradle.api.internal.ConventionTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getFinalizedBy(), org.gradle.api.internal.ConventionTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#getTaskActions(), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#getImpliesSubProjects(), org.gradle.api.internal.ConventionTask#setImpliesSubProjects(boolean), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getTemporaryDirFactory(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#isHasCustomActions(), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(long), 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

    - #### @TaskAction public void execute(IncrementalTaskInputs inputs)

    - #### @InputFiles public FileCollection getAntlrClasspath()

      Returns the classpath containing the Ant ANTLR task implementation.

      Returns:
        The Ant task implementation classpath.

    - #### @Input public List<String> getArguments()

      List of command-line arguments passed to the antlr process

      Returns:
        The antlr command-line arguments

    - #### public String getMaxHeapSize()

      The maximum heap size for the forked antlr process (ex: '1g').

    - #### @OutputDirectory public File getOutputDirectory()

      Returns the directory to generate the parser source files into.

      Returns:
        The output directory.

    - #### @InputFiles @SkipWhenEmpty public FileTree getSource()

      Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

      Returns:
        The source.

    - #### @javax.inject.Inject protected org.gradle.internal.Factory<org.gradle.process.internal.WorkerProcessBuilder> getWorkerProcessBuilderFactory()

    - #### public boolean isTrace()

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

    - #### public boolean isTraceLexer()

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

    - #### public boolean isTraceParser()

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

    - #### public boolean isTraceTreeWalker()

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

    - #### protected void setAntlrClasspath(FileCollection antlrClasspath)

      Specifies the classpath containing the Ant ANTLR task implementation.

      Parameters:
        `antlrClasspath` - The Ant task implementation classpath. Must not be null.

    - #### public void setArguments(List<String> arguments)

    - #### public void setMaxHeapSize(String maxHeapSize)

    - #### public void setOutputDirectory(File outputDirectory)

      Specifies the directory to generate the parser source files into.

      Parameters:
        `outputDirectory` - The output directory. Must not be null.

    - #### @Override public void setSource(Object source)

      Sets the source for this task. Delegates to SourceTask.setSource. If the source is of type SourceDirectorySet, then the relative path of each source grammar files is used to determine the relative output path of the generated source If the source is not of type SourceDirectorySet, then the generated source files end up flattened in the specified output directory.

      Parameters:
        `source` - The source.

    - #### public void setTrace(boolean trace)

    - #### public void setTraceLexer(boolean traceLexer)

    - #### public void setTraceParser(boolean traceParser)

    - #### public void setTraceTreeWalker(boolean traceTreeWalker)