AntBuilder (Gradle API 2.14.1)
Date: 2016-07-18

Package: org.gradle.api

## [Java] Class AntBuilder

- org.gradle.api.AntBuilder

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

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `enum` | `AntBuilder.AntMessagePriority` | Represents the normal Ant message priorities.

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `AntBuilder` | `getAnt()` Returns this AntBuilder.
    `AntBuilder.AntMessagePriority` | `getLifecycleLogLevel()` Returns the Ant message priority that corresponds to the Gradle "lifecycle" log level.
    `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.
    `void` | `setLifecycleLogLevel(AntBuilder.AntMessagePriority logLevel)` Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level.
    `void` | `setLifecycleLogLevel(String logLevel)` Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level.

  - ### 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), groovy.util.AntBuilder#invokeMethod(java.lang.String, java.lang.Object), groovy.util.AntBuilder#setProperty(java.lang.String, java.lang.Object), groovy.util.AntBuilder#getProperty(java.lang.String), groovy.util.AntBuilder#setMetaClass(groovy.lang.MetaClass), groovy.util.AntBuilder#getMetaClass(), 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), groovy.util.BuilderSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.util.BuilderSupport#setProperty(java.lang.String, java.lang.Object), groovy.util.BuilderSupport#getProperty(java.lang.String), groovy.util.BuilderSupport#setMetaClass(groovy.lang.MetaClass), groovy.util.BuilderSupport#getMetaClass(), 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 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

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

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

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