A lot of Ant user think that to create a new Ant task you need to write some Java code and to extend Task (or MatchingTask). Well, since Ant 1.6 you write what is called macros. 2 new tasks can be used to do it: macrodef presetdef I would say that Presetdef is a simplified version of macrodef. Here is an example of macrodef: <macrodef name="xins"> <attribute name="api" default="" /> <attribute name="target" /> <attribute name="projectdir" default="${basedir}" /> <sequential> <property environment="env" /> <available property="xins.home" value="${env.XINS_HOME}" file="${env.XINS_HOME}" type="dir" /> <fail message="Please set the XINS_HOME variable correctly." unless="xins.home" /> <ant antfile="${xins.home}/src/ant/make-build.xml"> <property name="xins_home" value="${xins.home}" /> <property name="user.dir" value="@{projectdir}" /> </ant> <condition property="xins.target.@{target}-@{api}" value="@{target}"> <equals arg1="@{api}" arg2="" /> </condition> <property name="xins.target.@{target}-@{api}" value="@{target}-@{api}" /> <ant antfile="@{projectdir}/build/build.xml" target="${xins.target.@{target}-@{api}}"> <property name="user.dir" value="@{projectdir}" /> </ant> </sequential> </macrodef> and to use it: <xins api="allinone" target="opendoc" projectdir="src/tests" /> ...