Run Groovy in AntBuilder

This is a nonsense example of how to run groovy code with the groovy task in AntBuilder.

def antBuilder = new AntBuilder()
antBuilder.property(name: "testProp1", value: "TEST 1")
antBuilder.taskdef(name:"groovy", classname:"org.codehaus.groovy.ant.Groovy")
antBuilder.groovy("println 'Hello World'")
antBuilder.groovy("assert 1+1 == 2")

Which will print out:

Hello World