Package groovy.util

Class AntBuilder

  • All Implemented Interfaces:

    public class AntBuilder
    extends BuilderSupport
    Allows Ant tasks to be used with a Groovy builder-style markup. Requires that {{ant.jar}} is on your classpath which will happen automatically if you are using the Groovy distribution but will be up to you to organize if you are embedding Groovy. If you wish to use the optional tasks you will need to add one or more additional jars from the ant distribution to your classpath - see the library dependencies for more details.
    • Constructor Detail

      • AntBuilder

        public AntBuilder()
      • AntBuilder

        public AntBuilder​( project)
      • AntBuilder

        public AntBuilder​( project,
      • AntBuilder

        public AntBuilder​( parentTask)
    • Method Detail

      • getProject

        public getProject()
        # Gets the Ant project in which the tasks are executed
        the project
      • getAntXmlContext

        public getAntXmlContext()
        Gets the xml context of Ant used while creating tasks
        the Ant xml context
      • isSaveStreams

        public boolean isSaveStreams()
        Whether stdin, stdout, stderr streams are saved.
        true if we are saving streams
        See Also:
      • setSaveStreams

        public void setSaveStreams​(boolean saveStreams)
        Indicates that we save stdin, stdout, stderr and replace them while AntBuilder is executing tasks with streams that funnel the normal streams into Ant's logs.
        saveStreams - set to false to disable this behavior
      • createProject

        protected static createProject()
        Factory method to create new Project instances
      • nodeCompleted

        protected void nodeCompleted​(Object parent,
                                     Object node)
        Determines, when the ANT Task that is represented by the "node" should perform. Node must be an ANT Task or no "perform" is called. If node is an ANT Task, it performs right after complete construction. If node is nested in a TaskContainer, calling "perform" is delegated to that TaskContainer.
        nodeCompleted in class BuilderSupport
        parent - note: null when node is root
        node - the node that now has all its children applied
      • buildAttributes

        protected static Attributes buildAttributes​(Map attributes)
        Builds an Attributes from a Map
        attributes - the attributes to wrap
        the wrapped attributes
      • setText

        protected void setText​(Object task,
                               String text)
      • getAntProject

        public getAntProject()