diff --git a/proposal/xdocs/build.xml b/proposal/xdocs/build.xml
index f380acd6a..a5a0aafbc 100644
--- a/proposal/xdocs/build.xml
+++ b/proposal/xdocs/build.xml
@@ -451,7 +451,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/proposal/xdocs/src/org/apache/tools/ant/xdoclet/IndexGen.java b/proposal/xdocs/src/org/apache/tools/ant/xdoclet/IndexGen.java
new file mode 100644
index 000000000..1c5f678a4
--- /dev/null
+++ b/proposal/xdocs/src/org/apache/tools/ant/xdoclet/IndexGen.java
@@ -0,0 +1,68 @@
+package org.apache.tools.ant.xdoclet;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.BuildException;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class IndexGen extends Task {
+ private File destDir;
+ private File rootDir;
+
+ public void setDestDir(File destDir) {
+ this.destDir = destDir;
+ }
+
+
+ public void setRootDir(File rootDir) {
+ this.rootDir = rootDir;
+ }
+
+
+
+ public void execute() throws BuildException {
+ String[] categories = rootDir.list();
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("
xdocs index");
+ sb.append("");
+
+ for (int i=0; i < categories.length; i++) {
+ String category = categories[i];
+ File catDir = new File(rootDir, category);
+
+ if (!catDir.isDirectory()) {
+ continue;
+ }
+
+ sb.append("" + category + "
");
+
+ sb.append("");
+
+ String[] tasks = catDir.list();
+
+ for (int j=0; j < tasks.length; j++) {
+ String task = tasks[j];
+ sb.append("- ");
+ sb.append("" + task + "");
+ sb.append("
");
+ }
+
+ sb.append("
");
+
+ }
+
+ sb.append("");
+
+ FileWriter fw = null;
+ try {
+ fw = new FileWriter(new File(destDir,"index.html"));
+ fw.write(sb.toString());
+ fw.close();
+ } catch (IOException e) {
+ throw new BuildException(e);
+ }
+ }
+}