I am using gradle8.8 with java21.Passing an option...
# community-support
r
I am using gradle8.8 with java21.Passing an option value to custom doclet .like this options.addStringOption('outputdir','output') but when I run the task doclet is giving an error.error: invalid flag: -d 1 error Usage: javadoc [options] [packagenames] [sourcefiles] [@files] Is this a known error? the same works when I execute the doclet from terminal.
v
Unfortunately it seems Gradle is sending some options that the standard doclet supports but a custom doclet might not support: https://github.com/gradle/gradle/issues/11898 For some of these options, you can make sure to configure the options so that they are not sent. But I did not find a way to make it not send the
-d
option with the destination directory. So as a work-around you need to make the custom doclet accept that option, or if the doclet is not under your control make a separate doclet that accepts the option and ignores it and otherwise forwards the actual custom doclet. Probably the latter is cleaner as it is a quite Gradle-specific work-around, unless the doclet is anyway ever only used in Gradle builds.
r
Thank you.I could handle it inside Doclet and solved the problem(I am sending it in thread but not sure why it is going as a comon message
👌 1
An add on to this.In java21 version Doclet expect all the default option values including -d in getSupportedOptions.This method return a set of all option values few with zero parameter value and few with parameter as one.If u are missing any of the option value in the set then doclet will give error .