The Javadoc task always passes the -d, -doctitle, and -windowtitle options to javadoc even when using a custom doclet. These are standard doclet options only which are illegal (unless the custom doclet defines them as valid). The javadoc execution will fail like this:
javadoc: error - invalid flag: -d (or -doctitle or -windowtitle)
unless special handling is added to the doclet as a workaround, like this:
public static int optionLength(String option) {
if(option.equals(OUTPUT_FILE_OPTION)) {
return 2;
} else if (option.equals("-d")) {
return 2; // the -d option is ignored, and is here to deal with a gradle bug
// that always passes it to javadoc, even if a custom doclet is used
} else if (option.equals("-doctitle")) {
return 2; // the -d option is ignored, and is here to deal with a gradle bug
// that always passes it to javadoc, even if a custom doclet is used
} else if (option.equals("-windowtitle")) {
return 2; // the -windowtitle option is ignored, and is here to deal with a gradle bug
// that always passes it to javadoc, even if a custom doclet is used
}
return 0;
}