I created my own ant task using the instructions here. In my ant script, I create the <taskdef>
like this:
<!-- myUploader.xml -->
<taskdef name="fileUpload" classname="com.awt.client.UploaderTask" classpath="lib/fileUploader.jar" />
<target name="setup" description="some required setup before taskdef!">
<!-- checking for required jars, etc... -->
</target>
And then I can import the script that invokes this as an ant task:
<!-- build.xml -->
<import file="myUploader.xml" />
<fileUpload server="${server}" username="${username}" password="${password}" appname="TestApp" appversion="13" />
This all works fine. Now, there is a bit of setup I would like to happen in myUploader.xml before the taskdef occurs. <taskdef>
does not like if
, unless
, or depends
. How can I ensure that my setup task is called before <taskdef>
is done?