if (sourcePath != null) {
sourceDirs.addExisting(sourcePath);
}
parsePackages(packagesToDoc, sourceDirs);
GroovyDocTool htmlTool = new GroovyDocTool(
new ClasspathResourceManager(), // we're gonna get the default templates out of the dist jar file
sourcePath.toString(), // sourcepath - TODO multiple paths need to be handled here
new String[] { // top level templates
"org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/index.html",
"org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/overview-frame.html", // needs all package names
"org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/allclasses-frame.html", // needs all packages / class names
"org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/overview-summary.html", // needs all packages
"org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/stylesheet.css",
},
new String[] { // package level templates
"org/codehaus/groovy/tools/groovydoc/gstring-templates/package-level/package-frame.html",
"org/codehaus/groovy/tools/groovydoc/gstring-templates/package-level/package-summary.html"
},
new String[] { // class level templates
"org/codehaus/groovy/tools/groovydoc/gstring-templates/class-level/classDocName.html"
},
links
);
try {
Iterator itr = sourceFilesToDoc.iterator();
while (itr.hasNext()) {
htmlTool.add((String) itr.next());
}
FileOutputTool output = new FileOutputTool();
htmlTool.renderToOutput(output, destDir.getCanonicalPath()); // TODO push destDir through APIs?
} catch (Exception e) {
e.printStackTrace();
}
}