Writing my first Ant task: what am I missing?

Zhiva

New Member
I have read this article and used it to write my first Ant task called \[code\]AutoTestTask\[/code\]:\[code\]public class AutoTestTask extends org.apache.tools.ant.Task { // ...}\[/code\]I have also compiled and packaged this object into \[code\]auto-test.jar\[/code\].If my understanding of Ant is correct, then to include it as part of another project's build, I use the following XML:\[code\]<project name="SomeProject" basedir="." default="deploy" xmlns:at="antlib:org.me.auto-test"> <!-- Task definitions. --> <taskdef name="at-autotest" classname="org.me.auto-test.AutoTestTask"/> <!-- Use the task. --> <at:autotest/></project>\[/code\]I believe I also need to copy \[code\]auto-test.jar\[/code\] into my ${ANT_HOME}/lib directory - can someone please confirm? What's confusing me is the \[code\]xmlns:at="antlib:org.me.auto-test"\[/code\] attribute at the top of the XML, and specifically, the \[code\]antlib:<whatever>\[/code\] portion. Is this some kind of Ant-specific protocol that says "*anything qualified by the \[code\]at\[/code\] namespace will be found inside ${ANT_HOME}/lib with a root package of \[code\]org.me.auto-test\[/code\]*"? If not could someone explain what it means?Also, if I'm missing anything obvious or have anything configured incorrectly, please let me know. Thanks in advance!
 
Back
Top