I have created a custom Ant task as per one of my previous posts which calls an existing target in another xml file.
It seems to be doing what I want in terms of calling the build xml that I want, however, it now throws a very curious error:
build.xml:4: Problem: failed to create task or type import
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:369)
at org.hardhat.task.HardHatTask.executeHardHat(HardHatTask.java:47)
at org.hardhat.task.HardHatTask.execute(HardHatTask.java:23)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
The build xml that my custom Ant task is calling looks something like this:
<project name="myproject" default="all" basedir=".">
<import file="includes.xml"/>
<target name="all" depends="doStuff" />
</project>
The error says the problem has to do with line 4 and the task 'import'. Any ideas as to why Ant doesn't seem to understand one of its own tasks?