N
Nick
Hi All,
I'm creating a custom ant task and would like to have nested elements
inside this task that indicate a list of exporters that should be used
to export the results of the ant task.
Suffice to say there is an interface called
com.company.Exporter
and some classes:
com.company.FirstCustomExporter implements Exporter
com.company.SecondCustomExporter implements Exporter
....that export different things
According to the Ant manual I should be able to have an Ant task like
so:
class MyAntTask extends Task {
...
public void add( Exporter ex ) {
...
}
}
And then have in my build file
<taskdef name="myanttask" class="com.company.MyAntTask" />
<typedef name="firstcustomexporter"
class="com.company.FirstCustomExporter" />
<typedef name="secondcustomexporter"
class="com.company.SecondCustomExporter" />
<myanttask>
<firstcustomexporter />
<secondcustomexporter />
</myanttask>
However when I try to do things this way all I get is:
'myanttask' doesn't support the nested element 'firstcustomexporter'
What is wrong with my logic? I even copied and pasted the code from
the "Writing your own task" tutorial and it doesn't work.
This is not an issue with classpaths, I've run ant -debug and you can
see all the relevant classes being loaded from the right places....
This is truly frustrating and any help would be greatly appreciated...
Surely writing an ant task is not this difficult, what have I missed??
Kind Regards,
Nick
I'm creating a custom ant task and would like to have nested elements
inside this task that indicate a list of exporters that should be used
to export the results of the ant task.
Suffice to say there is an interface called
com.company.Exporter
and some classes:
com.company.FirstCustomExporter implements Exporter
com.company.SecondCustomExporter implements Exporter
....that export different things
According to the Ant manual I should be able to have an Ant task like
so:
class MyAntTask extends Task {
...
public void add( Exporter ex ) {
...
}
}
And then have in my build file
<taskdef name="myanttask" class="com.company.MyAntTask" />
<typedef name="firstcustomexporter"
class="com.company.FirstCustomExporter" />
<typedef name="secondcustomexporter"
class="com.company.SecondCustomExporter" />
<myanttask>
<firstcustomexporter />
<secondcustomexporter />
</myanttask>
However when I try to do things this way all I get is:
'myanttask' doesn't support the nested element 'firstcustomexporter'
What is wrong with my logic? I even copied and pasted the code from
the "Writing your own task" tutorial and it doesn't work.
This is not an issue with classpaths, I've run ant -debug and you can
see all the relevant classes being loaded from the right places....
This is truly frustrating and any help would be greatly appreciated...
Surely writing an ant task is not this difficult, what have I missed??
Kind Regards,
Nick