Generates HTML API documentation for Java classes.
If you create your own Javadoc tasks remember to specify the 'source' property! Without source the Javadoc task will not create any documentation. Example:
apply plugin: 'java' task myJavadocs(type: Javadoc) { source = sourceSets.main.allJava }
An example how to create a task that runs a custom doclet implementation:
apply plugin: 'java' configurations { jaxDoclet } dependencies { //jaxDoclet "some.interesting:Dependency:1.0" } task generateRestApiDocs(type: Javadoc) { source = sourceSets.main.allJava destinationDir = reporting.file("rest-api-docs") options.docletpath = configurations.jaxDoclet.files.asType(List) options.doclet = "com.lunatech.doclets.jax.jaxrs.JAXRSDoclet" options.addStringOption("jaxrscontext", "http://localhost:8080/myapp") }
Type | Name and description |
---|---|
protected void |
generate() |
FileCollection |
getClasspath() Returns the classpath to use to resolve type references in the source code. |
File |
getDestinationDir() |
String |
getExecutable() Returns the Javadoc executable to use to generate the Javadoc. |
String |
getMaxMemory() Returns the amount of memory allocated to this task. |
MinimalJavadocOptions |
getOptions() Returns the Javadoc generation options. |
File |
getOptionsFile() |
String |
getTitle() |
boolean |
isFailOnError() Specifies whether this task should fail when errors are encountered during Javadoc generation. |
boolean |
isVerbose() Returns whether Javadoc generation is accompanied by verbose output. |
void |
options(Closure block) Convenience method for configuring Javadoc generation options. |
void |
setClasspath(FileCollection classpath) Sets the classpath to use to resolve type references in this source code. |
void |
setDestinationDir(File destinationDir) |
void |
setExecutable(String executable) |
void |
setFailOnError(boolean failOnError) |
void |
setMaxMemory(String maxMemory) Sets the amount of memory allocated to this task. |
void |
setOptions(MinimalJavadocOptions options) Sets the Javadoc generation options. |
void |
setTitle(String title) |
void |
setVerbose(boolean verbose) Sets whether Javadoc generation is accompanied by verbose output or not. |
Returns the classpath to use to resolve type references in the source code.
Returns the directory to generate the documentation into.
Returns the Javadoc executable to use to generate the Javadoc. When null
, the Javadoc executable for
the current JVM is used.
Returns the amount of memory allocated to this task.
Returns the Javadoc generation options.
Returns the title for the generated documentation.
Specifies whether this task should fail when errors are encountered during Javadoc generation. When true
,
this task will fail on Javadoc error. When false
, this task will ignore Javadoc errors.
Returns whether Javadoc generation is accompanied by verbose output.
Convenience method for configuring Javadoc generation options.
block
- The configuration block for Javadoc generation options.Sets the classpath to use to resolve type references in this source code.
classpath
- The classpath. Must not be null.
Sets the directory to generate the documentation into.
Sets the amount of memory allocated to this task.
maxMemory
- The amount of memorySets the Javadoc generation options.
options
- The options. Must not be null.
Sets the title for the generated documentation.
Sets whether Javadoc generation is accompanied by verbose output or not. The verbose output is done via println (by the underlying Ant task). Thus it is not handled by our logging.
verbose
- Whether the output should be verbose.