This is an article I wrote that looks at how to add scripted behaviour to ant builds. It details the steps to write a custom Ant task in Jython, compile it and install it into Ant so it can be used as any other task in an ant build. The article also takes a quick look at an alternate implementation using Groovy.