Package: org.gradle.api

## [Java] Class AntBuilder

- org.gradle.api.AntBuilder

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

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `AntBuilder` | `getAnt()` Returns this AntBuilder.
    `Map<String, Object>` | `getProperties()` Returns the properties of the Ant project.
    `Map<String, Object>` | `getReferences()` Returns the references of the Ant project.
    `void` | `importBuild(Object antBuildFile)` Imports an Ant build into the associated Gradle project.
    `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.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.util.AntBuilder` | `groovy.util.AntBuilder#getProject(), groovy.util.AntBuilder#getAntXmlContext(), groovy.util.AntBuilder#isSaveStreams(), groovy.util.AntBuilder#setSaveStreams(boolean), groovy.util.AntBuilder#getAntProject(), groovy.util.AntBuilder#invokeMethod(java.lang.String, java.lang.Object), groovy.util.AntBuilder#invokeMethod(java.lang.String), groovy.util.AntBuilder#setProperty(java.lang.String, java.lang.Object), groovy.util.AntBuilder#getProperty(java.lang.String), groovy.util.AntBuilder#getMetaClass(), groovy.util.AntBuilder#setMetaClass(groovy.lang.MetaClass), groovy.util.AntBuilder#wait(long, int), groovy.util.AntBuilder#wait(long), groovy.util.AntBuilder#wait(), groovy.util.AntBuilder#equals(java.lang.Object), groovy.util.AntBuilder#toString(), groovy.util.AntBuilder#hashCode(), groovy.util.AntBuilder#getClass(), groovy.util.AntBuilder#notify(), groovy.util.AntBuilder#notifyAll()`
    `class groovy.util.BuilderSupport` | `groovy.util.BuilderSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.util.BuilderSupport#invokeMethod(java.lang.String), groovy.util.BuilderSupport#setProperty(java.lang.String, java.lang.Object), groovy.util.BuilderSupport#getProperty(java.lang.String), groovy.util.BuilderSupport#getMetaClass(), groovy.util.BuilderSupport#setMetaClass(groovy.lang.MetaClass), groovy.util.BuilderSupport#wait(long, int), groovy.util.BuilderSupport#wait(long), groovy.util.BuilderSupport#wait(), groovy.util.BuilderSupport#equals(java.lang.Object), groovy.util.BuilderSupport#toString(), groovy.util.BuilderSupport#hashCode(), groovy.util.BuilderSupport#getClass(), groovy.util.BuilderSupport#notify(), groovy.util.BuilderSupport#notifyAll()`

- - ### Method Detail

    - #### public AntBuilder getAnt()

      Returns this AntBuilder. Useful when you need to pass this builder to methods from within closures.

      Returns:
        this

    - #### public Map<String, 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.

    - #### public Map<String, 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.

    - #### public 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.

    - #### @Incubating public 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 `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.
        `taskNamer` - A transformer that calculates the name of the Gradle task for a corresponding Ant target.