# Class AntBuilder

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
groovy.ant.AntBuilder
org.gradle.api.AntBuilder

All Implemented Interfaces:
  `GroovyObject`

public abstract class AntBuilder extends AntBuilder

An `AntBuilder` allows you to use Ant from your build script.

Since:
  0.7

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `AntBuilder.AntMessagePriority`
  Represents the normal Ant message priorities.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AntBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AntBuilder`
  `getAnt()`
  Returns this AntBuilder.
  `abstract AntBuilder.AntMessagePriority`
  `getLifecycleLogLevel()`
  Returns the Ant message priority that corresponds to the Gradle "lifecycle" log level.
  `abstract Map<String, @Nullable Object>`
  `getProperties()`
  Returns the properties of the Ant project.
  `abstract Map<String, @Nullable Object>`
  `getReferences()`
  Returns the references of the Ant project.
  `abstract void`
  `importBuild(Object antBuildFile)`
  Imports an Ant build into the associated Gradle project.
  `abstract void`
  `importBuild(Object antBuildFile, String baseDirectory)`
  Imports an Ant build into the associated Gradle project, specifying the base directory for Gradle tasks that correspond to Ant targets.
  `abstract void`
  `importBuild(Object antBuildFile, String baseDirectory, Transformer<? extends @NotNull String, ? super String> taskNamer)`
  Imports an Ant build into the associated Gradle project, specifying the base directory and potentially providing alternative names for Gradle tasks that correspond to Ant targets.
  `abstract void`
  `importBuild(Object antBuildFile, Transformer<? extends @NotNull 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.
  `void`
  `setLifecycleLogLevel(String logLevel)`
  Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level.
  `abstract void`
  `setLifecycleLogLevel(AntBuilder.AntMessagePriority logLevel)`
  Sets 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, setText`

  ### Methods inherited from class BuilderSupport

  `getCurrent, getName, invokeMethod, invokeMethod, postNodeCompletion, setClosureDelegate, setCurrent`

  ### Methods inherited from class GroovyObjectSupport

  `getMetaClass, setMetaClass`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface GroovyObject

  `getProperty, setProperty`

- ## Constructor Details

  - ### AntBuilder

    public AntBuilder()

- ## Method Details

  - ### getProperties

    public abstract Map<String, @Nullable Object> getProperties()
    Returns the properties of the Ant project. This is a live map, you that you can make changes to the map and these changes are reflected in the Ant project.
    Returns:
      The properties. Never returns null.
    Since:
      0.7

  - ### getReferences

    public abstract Map<String, @Nullable Object> getReferences()
    Returns the references of the Ant project. This is a live map, you that you can make changes to the map and these changes are reflected in the Ant project.
    Returns:
      The references. Never returns null.
    Since:
      0.7

  - ### importBuild

    public abstract void importBuild(Object antBuildFile)
    Imports an Ant build into the associated Gradle project.
    Parameters:
      `antBuildFile` - The build file. This is resolved as per `Project.file(Object)`.
    Since:
      0.7

  - ### importBuild

    public abstract void importBuild(Object antBuildFile, String baseDirectory)
    Imports an Ant build into the associated Gradle project, specifying the base directory for Gradle tasks that correspond to Ant targets.

    By default the base directory is the Ant build file parent directory. The relative paths are relative to `Project.getProjectDir()`.

    Parameters:
      `antBuildFile` - The build file. This is resolved as per `Project.file(Object)`.
      `baseDirectory` - The base directory. This is resolved as per `Project.file(Object)`.
    Since:
      7.1

  - ### importBuild

    public abstract void importBuild(Object antBuildFile, Transformer<? extends @NotNull 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 `taskNamer` receives 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 per `Project.file(Object)`.
      `taskNamer` - A transformer that calculates the name of the Gradle task for a corresponding Ant target.
    Since:
      2.2

  - ### importBuild

    public abstract void importBuild(Object antBuildFile, String baseDirectory, Transformer<? extends @NotNull String, ? super String> taskNamer)
    Imports an Ant build into the associated Gradle project, specifying the base directory and potentially providing alternative names for Gradle tasks that correspond to Ant targets.

    By default the base directory is the Ant build file parent directory. The relative paths are relative to `Project.getProjectDir()`.

    For each Ant target that is to be converted to a Gradle task, the given `taskNamer` receives 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 per `Project.file(Object)`.
      `baseDirectory` - The base directory. This is resolved as per `Project.file(Object)`.
      `taskNamer` - A transformer that calculates the name of the Gradle task for a corresponding Ant target.
    Since:
      7.1

  - ### getAnt

    public AntBuilder getAnt()
    Returns this AntBuilder. Useful when you need to pass this builder to methods from within closures.
    Returns:
      this
    Since:
      1.0

  - ### setLifecycleLogLevel

    public abstract void setLifecycleLogLevel(AntBuilder.AntMessagePriority logLevel)
    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
    Since:
      2.14

  - ### setLifecycleLogLevel

    public void setLifecycleLogLevel(String logLevel)
    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
    Since:
      2.14

  - ### getLifecycleLogLevel

    public abstract AntBuilder.AntMessagePriority 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
    Since:
      2.14