Package groovy.util
Class AntBuilder
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
groovy.util.AntBuilder
- All Implemented Interfaces:
GroovyObject
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.
- Author:
- James Strachan, Dierk Koenig (dk), Marc Guillemot
-
Constructor Summary
ConstructorsConstructorDescriptionAntBuilder(org.apache.tools.ant.Project project) AntBuilder(org.apache.tools.ant.Project project, org.apache.tools.ant.Target owningTarget) AntBuilder(org.apache.tools.ant.Task parentTask) -
Method Summary
Modifier and TypeMethodDescriptionprotected static AttributesbuildAttributes(Map attributes) Builds anAttributesfrom aMapprotected ObjectcreateNode(Object tagName) protected ObjectcreateNode(Object name, Object value) protected ObjectcreateNode(Object name, Map attributes) protected ObjectcreateNode(Object name, Map attributes, Object value) protected static org.apache.tools.ant.Projectprotected ObjectdoInvokeMethod(String methodName, Object name, Object args) We don't want to return the node as created increateNode(Object, Map, Object)but the one made ready bynodeCompleted(Object, Object)org.apache.tools.ant.Projectorg.apache.tools.ant.helper.AntXMLContextGets the xml context of Ant used while creating tasksorg.apache.tools.ant.Project# Gets the Ant project in which the tasks are executedprotected voidnodeCompleted(Object parent, Object node) Determines, when the ANT Task that is represented by the "node" should perform.protected voidprotected voidMethods inherited from class groovy.util.BuilderSupport
getCurrent, getName, invokeMethod, invokeMethod, postNodeCompletion, setClosureDelegate, setCurrentMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, setMetaClass, setProperty
-
Constructor Details
-
AntBuilder
public AntBuilder() -
AntBuilder
public AntBuilder(org.apache.tools.ant.Project project) -
AntBuilder
public AntBuilder(org.apache.tools.ant.Project project, org.apache.tools.ant.Target owningTarget) -
AntBuilder
public AntBuilder(org.apache.tools.ant.Task parentTask)
-
-
Method Details
-
getProject
public org.apache.tools.ant.Project getProject()# Gets the Ant project in which the tasks are executed- Returns:
- the project
-
getAntXmlContext
public org.apache.tools.ant.helper.AntXMLContext getAntXmlContext()Gets the xml context of Ant used while creating tasks- Returns:
- the Ant xml context
-
createProject
protected static org.apache.tools.ant.Project createProject()- Returns:
- Factory method to create new Project instances
-
setParent
- Specified by:
setParentin classBuilderSupport
-
doInvokeMethod
We don't want to return the node as created increateNode(Object, Map, Object)but the one made ready bynodeCompleted(Object, Object)- Overrides:
doInvokeMethodin classBuilderSupport- See Also:
-
nodeCompleted
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.- Overrides:
nodeCompletedin classBuilderSupport- Parameters:
parent- note: null when node is rootnode- the node that now has all its children applied
-
createNode
- Specified by:
createNodein classBuilderSupport
-
createNode
- Specified by:
createNodein classBuilderSupport
-
createNode
- Specified by:
createNodein classBuilderSupport
-
buildAttributes
Builds anAttributesfrom aMap- Parameters:
attributes- the attributes to wrap- Returns:
- the wrapped attributes
-
createNode
- Specified by:
createNodein classBuilderSupport
-
setText
-
getAntProject
public org.apache.tools.ant.Project getAntProject()
-