Using Ant build.xml and Antbuilder

This show how to combine the Ant build.xml and the groovy AntBuilder.

//load the ant build.xml
def antFile = new File("build.xml")
def project = new Project()
project.init()
ProjectHelper.projectHelper.parse(project, antFile)
// this will call the main target
project.executeTarget(project.defaultTarget);

This is the build.xml file.



	
 		
	

Which prints out:

Hello World