Class XmlAstGradleTask
- 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>
This task is intended as the primary Gradle-facing API. It supports include/exclude patterns, incremental conversion checks, configurable execution model, and explicit runtime classpath injection for configuration-cache-friendly execution. 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
ConstructorsConstructorDescriptionXmlAstGradleTask(org.gradle.api.model.ObjectFactory objects) Creates the task and configures default conventions. -
Method Summary
Modifier and TypeMethodDescriptionvoidconvert()Runs conversion for all selected files from source directory to destination directory.org.gradle.api.provider.Property<Boolean> Enables periodic forced GC during long parsing runs.org.gradle.api.file.RegularFilePropertyOptional XML catalog containing named grammars and parser/lexer coordinates.org.gradle.api.provider.Property<String> Grammar name to resolve fromgetCatalogFile().org.gradle.api.provider.Property<Boolean> Enables rule-chain compression for generated XML AST output.org.gradle.api.provider.Property<Boolean> Continue processing remaining files after per-file parse failures.org.gradle.api.file.DirectoryPropertyDestination directory receiving generated XML files.org.gradle.api.provider.Property<Boolean> Enables DFA memory monitoring and logging (requires --info or --debug).org.gradle.api.provider.ListProperty<String> Ant-style exclude patterns evaluated relative togetSourceDirectory().org.gradle.api.provider.Property<String> Execution model setting retained for compatibility.org.gradle.api.provider.Property<Boolean> Global fail-fast switch aligned with Ant task semantics.org.gradle.api.provider.Property<Boolean> Transformation-specific failure switch aligned with Ant task semantics.org.gradle.api.provider.Property<Boolean> getForce()Forces conversion even when output files are newer than inputs.org.gradle.api.provider.Property<Integer> Number of completed files between forced GC cycles when aggressive GC is enabled.org.gradle.api.provider.Property<Integer> Heap-used percent threshold for aggressive GC trigger.org.gradle.api.provider.Property<String> Grammar key used bySqlXmlConverter(e.g.org.gradle.api.provider.ListProperty<String> Ant-style include patterns evaluated relative togetSourceDirectory().org.gradle.api.provider.Property<String> Optional lexer coordinate used for dynamic ANTLR parsing.org.gradle.api.provider.Property<Integer> Max worker count setting retained for compatibility.org.gradle.api.provider.Property<String> Optional parser coordinate used for dynamic ANTLR parsing.org.gradle.api.file.ConfigurableFileCollectionRuntime classpath used to load converter classes and dependencies.org.gradle.api.file.DirectoryPropertySource directory scanned for input files.org.gradle.api.provider.Property<String> Parser entry rule method invoked during dynamic parsing.org.gradle.api.provider.Property<Boolean> Suppresses task failure stack traces and emits concise lifecycle diagnostics instead.org.gradle.api.provider.Property<String> Output file extension mapped from source 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
-
XmlAstGradleTask
@Inject public XmlAstGradleTask(org.gradle.api.model.ObjectFactory objects) Creates the task and configures default conventions.- Parameters:
objects- Gradle object factory.
-
-
Method Details
-
getSourceDirectory
@InputDirectory @PathSensitive(RELATIVE) public org.gradle.api.file.DirectoryProperty getSourceDirectory()Source directory scanned for input files.- Returns:
- directory property containing source files.
-
getDestinationDirectory
@OutputDirectory public org.gradle.api.file.DirectoryProperty getDestinationDirectory()Destination directory receiving generated XML files.- Returns:
- output directory property.
-
getGrammar
Grammar key used bySqlXmlConverter(e.g. oracle, sybase, java8, antlr4).Retained for compatibility with existing builds and catalog metadata.
- Returns:
- grammar property.
-
getTargetExtension
Output file extension mapped from source files.- Returns:
- target extension property.
-
getParallelism
Max worker count setting retained for compatibility.- Returns:
- parallelism property.
-
getExecutionModel
Execution model setting retained for compatibility.- Returns:
- execution model property.
-
getIncludes
Ant-style include patterns evaluated relative togetSourceDirectory().- Returns:
- include patterns property.
-
getExcludes
Ant-style exclude patterns evaluated relative togetSourceDirectory().- Returns:
- exclude patterns property.
-
getForce
Forces conversion even when output files are newer than inputs.- Returns:
- force flag property.
-
getFailOnError
Global fail-fast switch aligned with Ant task semantics.- Returns:
- fail-on-error property.
-
getFailOnTransformationError
Transformation-specific failure switch aligned with Ant task semantics.- Returns:
- fail-on-transformation-error property.
-
getContinueOnError
Continue processing remaining files after per-file parse failures.- Returns:
- continue-on-error property.
-
getSuppressStackTrace
Suppresses task failure stack traces and emits concise lifecycle diagnostics instead.- Returns:
- suppress-stack-trace property.
-
getCatalogFile
@Optional @InputFile @PathSensitive(RELATIVE) public org.gradle.api.file.RegularFileProperty getCatalogFile()Optional XML catalog containing named grammars and parser/lexer coordinates.- Returns:
- catalog file property.
-
getCatalogGrammar
Grammar name to resolve fromgetCatalogFile().- Returns:
- catalog grammar key property.
-
getParserClassName
Optional parser coordinate used for dynamic ANTLR parsing.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 used for dynamic ANTLR parsing.Supported values mirror
getParserClassName().- Returns:
- lexer class property.
-
getStartRule
Parser entry rule method invoked during dynamic parsing.- Returns:
- start 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 withid -> pathmappings.- Returns:
- compression flag property.
-
getEnableDFAMonitoring
Enables DFA memory monitoring and logging (requires --info or --debug).When enabled, logs DFA clearing operations and memory heap statistics after each file is parsed (both success and failure cases).
- Returns:
- DFA monitoring flag property.
-
getAggressiveGc
Enables periodic forced GC during long parsing runs.This is a pragmatic safety valve for extremely large conversion batches where parser memory pressure can exceed heap even in sequential mode.
- Returns:
- aggressive-GC flag property.
-
getGcEveryFiles
Number of completed files between forced GC cycles when aggressive GC is enabled.- Returns:
- files-per-gc property.
-
getGcHeapThresholdPercent
Heap-used percent threshold for aggressive GC trigger.When aggressive GC is enabled, forced GC runs only when heap usage is at or above this percentage at the configured file interval.
- Returns:
- heap threshold percent property.
-
getRuntimeClasspath
@Classpath public org.gradle.api.file.ConfigurableFileCollection getRuntimeClasspath()Runtime classpath used to load converter classes and dependencies.- Returns:
- classpath file collection.
-
convert
public void convert()Runs conversion for all selected files from source directory to destination directory.When
force=false, files are converted only if missing or out-of-date.
-