Apache Ant AntStructure Task
This task is used to generate a DTD for Ant buildfiles. It contains information about all tasks currently known to Ant.
We can always add XML entities using <taskdef> or <typedef> elements. This task doesn't know about required attributes.
AntStructure Task Attributes
Attribute | Description | Required |
---|---|---|
output | A output file to write the DTD. | Yes |
AntStructure Task Example
We can simply use it using <antstructure> element by specifying output file. See the example below.
<antstructure output="project.dtd"/>
If we want to specify a structure other than a DTD, first we need to implement the interface AntStructure.
package org.example;
import org.apache.tools.ant.taskdefs.AntStructure;
public class MyPrinter implements AntStructure.StructurePrinter {
...
}
and then we can use it via typedef element.
<typedef name="myprinter" classname="org.example.MyPrinter"/>
<antstructure output="project.my">
<myprinter/>
0 comments:
Post a Comment