public class Javadoc extends SourceTask
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") }
Task.Namer
source
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
Javadoc() |
Modifier and Type | Method and Description |
---|---|
protected void |
generate() |
FileCollection |
getClasspath()
Returns the classpath to use to resolve type references in the source code.
|
File |
getDestinationDir()
Returns the directory to generate the documentation into.
|
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() |
protected File |
getOutputDirectory() |
String |
getTitle()
Returns the title for the generated documentation.
|
JavaToolChain |
getToolChain()
Returns the tool chain that will be used to generate the Javadoc.
|
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)
Sets the directory to generate the documentation into.
|
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)
Sets the title for the generated documentation.
|
void |
setToolChain(JavaToolChain toolChain)
Sets the tool chain to use to generate the Javadoc.
|
void |
setVerbose(boolean verbose)
Sets whether Javadoc generation is accompanied by verbose output or not.
|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source
conventionMapping, conventionMapping, getConventionMapping
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
protected void generate()
@Incubating @Inject public JavaToolChain getToolChain()
@Incubating public void setToolChain(JavaToolChain toolChain)
@Internal public File getDestinationDir()
Returns the directory to generate the documentation into.
@OutputDirectory protected File getOutputDirectory()
public void setDestinationDir(File destinationDir)
Sets the directory to generate the documentation into.
@Optional @Input public String getMaxMemory()
public void setMaxMemory(String maxMemory)
maxMemory
- The amount of memory@Input @Optional public String getTitle()
Returns the title for the generated documentation.
public void setTitle(String title)
Sets the title for the generated documentation.
@Internal public boolean isVerbose()
setVerbose(boolean)
public void setVerbose(boolean verbose)
verbose
- Whether the output should be verbose.@InputFiles public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)
classpath
- The classpath. Must not be null.public MinimalJavadocOptions getOptions()
public void setOptions(MinimalJavadocOptions options)
options
- The options. Must not be null.public void options(Closure<?> block)
block
- The configuration block for Javadoc generation options.@Input public boolean isFailOnError()
true
,
this task will fail on Javadoc error. When false
, this task will ignore Javadoc errors.public void setFailOnError(boolean failOnError)
@Input @Optional public String getExecutable()
null
, the Javadoc executable for
the current JVM is used.public void setExecutable(String executable)