Package name.jurgenei.gradle.antlr
Class XmlAstTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
name.jurgenei.gradle.antlr.XmlAstTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault(because="XmlAstTask performs external parser loading and file-system driven conversion not yet declared for safe caching")
public abstract class XmlAstTask
extends org.gradle.api.DefaultTask
Legacy Gradle task model for converting source trees to XML AST output.
This type is kept for compatibility with existing builds. New build scripts should
prefer XmlAstGradleTask, which exposes a more idiomatic Gradle property model.
Parsing is executed through dynamically loaded ANTLR lexer/parser classes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionXmlAstTask(org.gradle.api.model.ObjectFactory objects) Creates a legacy xmlast task with default conventions. -
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes conversion for all configured source trees.org.gradle.api.file.RegularFilePropertyOptional XML catalog used to resolve grammar metadata.org.gradle.api.provider.Property<String> Grammar key to select fromgetCatalogFile().org.gradle.api.provider.Property<Boolean> Enables rule-chain compression for generated XML AST output.org.gradle.api.file.DirectoryPropertyDestination directory for generated XML AST files.org.gradle.api.provider.Property<String> Execution model for legacy converter mode.org.gradle.api.provider.Property<String> Runtime grammar key for legacy converter mode.org.gradle.api.provider.ListProperty<String> Include patterns evaluated relative to each source root.org.gradle.api.provider.Property<String> Optional lexer coordinate for dynamic ANTLR mode.org.gradle.api.provider.Property<Integer> Parallelism setting for legacy converter execution.org.gradle.api.provider.Property<String> Optional parser coordinate for dynamic ANTLR mode.org.gradle.api.file.ConfigurableFileCollectionRuntime classpath used to load converter/parser dependencies.org.gradle.api.file.ConfigurableFileCollectionSource tree roots scanned for input files.org.gradle.api.provider.Property<String> Parser entry rule used in dynamic ANTLR mode.org.gradle.api.provider.Property<String> Target extension used when mapping source files to output files.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
XmlAstTask
@Inject public XmlAstTask(org.gradle.api.model.ObjectFactory objects) Creates a legacy xmlast task with default conventions.- Parameters:
objects- Gradle object factory.
-
-
Method Details
-
getSourceTrees
@InputFiles @PathSensitive(RELATIVE) public org.gradle.api.file.ConfigurableFileCollection getSourceTrees()Source tree roots scanned for input files.- Returns:
- source tree file collection.
-
getDestinationDirectory
@OutputDirectory public org.gradle.api.file.DirectoryProperty getDestinationDirectory()Destination directory for generated XML AST files.- Returns:
- output directory property.
-
getGrammar
Runtime grammar key for legacy converter mode.- Returns:
- grammar property.
-
getTargetExtension
Target extension used when mapping source files to output files.- Returns:
- output extension property.
-
getParallelism
Parallelism setting for legacy converter execution.- Returns:
- parallel worker count property.
-
getExecutionModel
Execution model for legacy converter mode.- Returns:
- execution model property.
-
getIncludes
Include patterns evaluated relative to each source root.- Returns:
- include patterns property.
-
getCatalogFile
@Optional @InputFile @PathSensitive(RELATIVE) public org.gradle.api.file.RegularFileProperty getCatalogFile()Optional XML catalog used to resolve grammar metadata.- Returns:
- catalog file property.
-
getCatalogGrammar
Grammar key to select fromgetCatalogFile().- Returns:
- catalog grammar property.
-
getParserClassName
Optional parser coordinate for dynamic ANTLR mode.Supported values:
- fully-qualified parser class name
- grammar source coordinate (`.g4`) as local path, file URI, HTTP(S) URL, protocol-relative URL, or host/path without protocol
- Returns:
- parser class property.
-
getLexerClassName
Optional lexer coordinate for dynamic ANTLR mode.Supported values mirror
getParserClassName().- Returns:
- lexer class property.
-
getStartRule
Parser entry rule used in dynamic ANTLR mode.- Returns:
- parser entry rule property.
-
getCompression
Enables rule-chain compression for generated XML AST output.When enabled, single-child
<rule>chains of length>= 2are flattened, the chain head receives apathIdattribute, and a<pathIndex>section is appended to the AST root with `id -> path` mappings.- Returns:
- compression flag property.
-
getRuntimeClasspath
@Classpath public org.gradle.api.file.ConfigurableFileCollection getRuntimeClasspath()Runtime classpath used to load converter/parser dependencies.- Returns:
- runtime classpath file collection.
-
convertSqlTrees
public void convertSqlTrees()Executes conversion for all configured source trees.Each source root is scanned using include patterns and converted while preserving relative output paths.
-