Browse Source

Bug 7552 auditing of <antstructure> - reset cache of visited elements

at the end of execute.

Add typedef to the child elements of project.

Fix some docs.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272334 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
1d7d78ea0d
3 changed files with 23 additions and 6 deletions
  1. +3
    -1
      docs/manual/CoreTasks/ant.html
  2. +5
    -4
      docs/manual/CoreTasks/antstructure.html
  3. +15
    -1
      src/main/org/apache/tools/ant/taskdefs/AntStructure.java

+ 3
- 1
docs/manual/CoreTasks/ant.html View File

@@ -67,7 +67,9 @@ project.</p>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">Filename to write the ant output to.
<td valign="top">Filename to write the ant output to. This is
relative to the value of the dir attribute if it has been set or
to the base directory of the current project otherwise.
</td>
<td align="center" valign="top">No</td>
</tr>


+ 5
- 4
docs/manual/CoreTasks/antstructure.html View File

@@ -13,9 +13,10 @@
about all tasks currently known to Ant.</p>
<p>Note that the DTD generated by this task is incomplete, you can
always add XML entities using <a
href="taskdef.html"><code>&lt;taskdef&gt;</code></a>. See <a
href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html" target="_top">here</a> for
a way to get around this problem.</p>
href="taskdef.html"><code>&lt;taskdef&gt;</code></a> or <a
href="typedef.html"><code>&lt;typedef&gt;</code></a>. See <a
href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html"
target="_top">here</a> for a way to get around this problem.</p>
<p>This task doesn't know about required attributes, all will be
listed as <code>#IMPLIED</code>.</p>
<h3>Parameters</h3>
@@ -35,7 +36,7 @@ listed as <code>#IMPLIED</code>.</p>
<blockquote><pre>
&lt;antstructure output=&quot;project.dtd&quot;/&gt;
</pre></blockquote>
<hr><p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
<hr><p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
Reserved.</p>

</body>


+ 15
- 1
src/main/org/apache/tools/ant/taskdefs/AntStructure.java View File

@@ -149,9 +149,16 @@ public class AntStructure extends Task {
if (out != null) {
out.close();
}
visited.clear();
}
}

/**
* Prints the header of the generated output.
*
* <p>Basically this prints the XML declaration, defines some
* entities and the project element.</p>
*/
private void printHead(PrintWriter out, Enumeration tasks,
Enumeration types) {
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
@@ -183,7 +190,8 @@ public class AntStructure extends Task {

out.println("");

out.print("<!ELEMENT project (target | property | taskdef | ");
out.print("<!ELEMENT project (target | property | taskdef");
out.print(" | typedef | ");
out.print(TYPES);
out.println(")*>");
out.println("<!ATTLIST project");
@@ -193,6 +201,9 @@ public class AntStructure extends Task {
out.println("");
}

/**
* Prints the definition for the target element.
*/
private void printTargetDecl(PrintWriter out) {
out.print("<!ELEMENT target (");
out.print(TASKS);
@@ -211,6 +222,9 @@ public class AntStructure extends Task {
out.println("");
}

/**
* Print the definition for a given element.
*/
private void printElementDecl(PrintWriter out, String name, Class element)
throws BuildException {



Loading…
Cancel
Save