Hi!
I am using gradle with javadoc-doclets, and I run always into the next error:
I have the next tasks in the build.gradle:
task myJavadocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = configurations.compile
destinationDir = file("./doc/")
}
task myDoclet(type: Javadoc, dependsOn: myJavadocs) {
source = sourceSets.main.allJava
options.doclet = 'Doclet2'
classpath = configurations.compile
List pathList = new ArrayList();
pathList.add(sourceSets.main.classesDir);
options.docletpath = pathList
}
The thing is that, when I run the task “myJavaDocs”, it just runs perfectly, without problems. But when I run the one to generate my the documentation with my own doclets, I receive an error that says that javadoc can not find the flag doctitle. It is like that:
C:\myproject>gradle myDoclet
...
:myDoclet
javadoc: error - invalid flag: -doctitle
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
-overview <file>
Read overview documentation from HTML file
-public
Show only public classes and members
-protected
Show protected/public classes and members (default)
-package
Show package/protected/public classes and members
-private
Show all classes and members
-help
Display command line options and exit
-doclet <class>
Generate output via alternate doclet
-docletpath <path>
Specify where to find doclet class files
-sourcepath <pathlist>
Specify where to find source files
-classpath <pathlist>
Specify where to find user class files
-exclude <pkglist>
Specify a list of packages to exclude
-subpackages <subpkglist> Specify subpackages to recursively load
-breakiterator
Compute 1st sentence with BreakIterator
-bootclasspath <pathlist> Override location of class files loaded
by the bootstrap class loader
-source <release>
Provide source compatibility with specified release
-extdirs <dirlist>
Override location of installed extensions
-verbose
Output messages about what Javadoc is doing
-locale <name>
Locale to be used, e.g. en_US or en_US_WIN
-encoding <name>
Source file encoding name
-quiet
Do not display status messages
-J<flag>
Pass <flag> directly to the runtime system
1 error
The point is that “doctitle” is an option from the Standard Doclet, and I am using my own Dolcet that does not include it. So, when gradle puts that “doctitle” option there (I assume it is gradle, because I have not seen anything that sets that option), it creates that error.
Is there any way to “dissable” that automatic “doctitle” from Gradle? Or is there any way to add the standard doclet options to my Doclet?
Thank you very much for your time!