I'm attempting to use a custom taglet when generating JavaDoc.
I'm specifying the taglet, the FQCN of my Taglet class:
task aggregateJavadoc(type: Javadoc) {
description = "Build the aggregated JavaDocs for all modules"
maxMemory = '512m'
destinationDir = javadocBuildDir.dir
configure(options) {
// overview = new File( projectDir, 'src/javadoc/package.html' )
// stylesheetFile = new File( projectDir, 'src/javadoc/stylesheet.css' )
windowTitle = 'Tapestry API Documentation'
docTitle = "Tapestry JavaDoc ($project.version)"
bottom = "Copyright © 2003-2011 <a
href=\"http://tapestry.apache.org\">The Apache Software
Foundation</a>."
use = true
links = [ 'http://download.oracle.com/javase/6/docs/api/',
'http://download.oracle.com/javaee/6/api/' ]
// classpath = configurations.javadoc
verbose = true
taglets "org.apache.tapestry5.javadoc.TapestryDocTaglet"
}
subprojects.each { subProject->
subProject.sourceSets.each { set ->
if ("test" != set.name) {
source set.java
if (classpath) {
classpath += set.classes + set.compileClasspath
}
else {
classpath = set.classes + set.compileClasspath
}
}
}
}
}
The generated arguments file shows something odd:
-link 'http://download.oracle.com/javase/6/docs/api/'
-link 'http://download.oracle.com/javaee/6/api/'
-use
-doctitle 'Tapestry JavaDoc (unspecified)'
-tags 'org.apache.tapestry5.javadoc.TapestryDocTaglet'
-d '/Users/hlship/workspaces/tapestry/tapestry5/build/documentation/javadocs'
It should not be "-tags", it should be "-taglet". Even "-tags" is
wrong (from javadoc --help):
-tag <name>:<locations>:<header> Specify single argument custom tags
-taglet The fully qualified name of Taglet to register
-tagletpath The path to Taglets
In StandardJavadocDocletOptions.java:
public void setTags(List<String> tags) {
this.tags.setValue(tags);
}
public StandardJavadocDocletOptions tags(List<String> tags) {
this.tags.getValue().addAll(tags);
return this;
}
public StandardJavadocDocletOptions tags(String... tags) {
return tags(Arrays.asList(tags));
}
public StandardJavadocDocletOptions taglets(String... taglets) {
return tags(Arrays.asList(taglets));
}
public StandardJavadocDocletOptions tagsFile(File tagsFile) {
return (StandardJavadocDocletOptions) optionFiles(tagsFile);
}
See also:
http://download.oracle.com/javase/1.5.0/docs/tooldocs/solaris/javadoc.html#standard
StandardJavadocDocletOptions is treating tags and taglets like they
were the same thing, they are not.
My workaround is to replace the taglets configuration with:
addStringOption "taglet",
"org.apache.tapestry5.javadoc.TapestryDocTaglet"
I believe this is a bug. In fact, I think I see several:
1. tags and taglets are not the same, they should be tracked seperately
2. Each tag should be written as its own "-tag xxx:y:z" command line
option (currently, all tags are concatinated and emitted as a single
-tags command line option)
3. Each taglet should be written as its own "-taglet foo.bar.Baz"
command line option
I'll be happy to add this to issue tracking if a Gradle committer will
verify that this is a likely bug.
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email