Class AntBuilder
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
groovy.util.AntBuilder
org.gradle.api.AntBuilder
- All Implemented Interfaces:
GroovyObject
An AntBuilder allows you to use Ant from your build script.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the normal Ant message priorities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAnt()Returns this AntBuilder.abstract AntBuilder.AntMessagePriorityReturns the Ant message priority that corresponds to the Gradle "lifecycle" log level.Returns the properties of the Ant project.Returns the references of the Ant project.abstract voidimportBuild(Object antBuildFile) Imports an Ant build into the associated Gradle project.abstract voidimportBuild(Object antBuildFile, Transformer<? extends String, ? super String> taskNamer) Imports an Ant build into the associated Gradle project, potentially providing alternative names for Gradle tasks that correspond to Ant targets.voidsetLifecycleLogLevel(String logLevel) Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level.abstract voidSets the Ant message priority that should correspond to the Gradle "lifecycle" log level.Methods inherited from class AntBuilder
buildAttributes, createNode, createNode, createNode, createNode, createProject, doInvokeMethod, getAntProject, getAntXmlContext, getProject, isSaveStreams, nodeCompleted, setParent, setSaveStreams, setTextMethods inherited from class BuilderSupport
getCurrent, getName, invokeMethod, invokeMethod, postNodeCompletion, setClosureDelegate, setCurrentMethods inherited from class GroovyObjectSupport
getMetaClass, getProperty, setMetaClass, setProperty
-
Constructor Details
-
AntBuilder
public AntBuilder()
-
-
Method Details
-
getProperties
-
getReferences
-
importBuild
Imports an Ant build into the associated Gradle project.- Parameters:
antBuildFile- The build file. This is resolved as perProject.file(Object).
-
importBuild
@Incubating public abstract void importBuild(Object antBuildFile, Transformer<? extends String, ? super String> taskNamer) Imports an Ant build into the associated Gradle project, potentially providing alternative names for Gradle tasks that correspond to Ant targets.For each Ant target that is to be converted to a Gradle task, the given
taskNamerreceives the Ant target name as input and is expected to return the desired name for the corresponding Gradle task. The transformer may be called multiple times with the same input. Implementations should ensure uniqueness of the return value for a distinct input. That is, no two inputs should yield the same return value.- Parameters:
antBuildFile- The build file. This is resolved as perProject.file(Object).taskNamer- A transformer that calculates the name of the Gradle task for a corresponding Ant target.
-
getAnt
Returns this AntBuilder. Useful when you need to pass this builder to methods from within closures.- Returns:
- this
-
setLifecycleLogLevel
Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level. Any messages logged at this priority (or more critical priority) will be logged at least at lifecycle in Gradle's logger. If the Ant priority already maps to a higher Gradle log level, it will continue to be logged at that level.- Parameters:
logLevel- The Ant log level to map to the Gradle lifecycle log level
-
setLifecycleLogLevel
Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level. Any messages logged at this priority (or more critical priority) will be logged at least at lifecycle in Gradle's logger. If the Ant priority already maps to a higher Gradle log level, it will continue to be logged at that level. Acceptable values are "VERBOSE", "DEBUG", "INFO", "WARN", and "ERROR".- Parameters:
logLevel- The Ant log level to map to the Gradle lifecycle log level
-
getLifecycleLogLevel
Returns the Ant message priority that corresponds to the Gradle "lifecycle" log level.- Returns:
- logLevel The Ant log level that maps to the Gradle lifecycle log level
-