Class Javadoc
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.SourceTask
org.gradle.api.tasks.javadoc.Javadoc
- All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, PatternFilterable, org.gradle.util.Configurable<Task>
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")
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface Task
Task.Namer -
Field Summary
Fields inherited from class SourceTask
sourceFields inherited from interface Task
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgenerate()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.Returns the amount of memory allocated to this task.Returns the Javadoc generation options.protected FileReturns the source for this task, after the include and exclude patterns have been applied.getTitle()Returns the title for the generated documentation.Returns the tool chain that will be used to generate the Javadoc.booleanSpecifies whether this task should fail when errors are encountered during Javadoc generation.booleanReturns whether Javadoc generation is accompanied by verbose output.voidConvenience method for configuring Javadoc generation options.voidoptions(Action<? super MinimalJavadocOptions> action) Convenience method for configuring Javadoc generation options.voidsetClasspath(FileCollection classpath) Sets the classpath to use to resolve type references in this source code.voidsetDestinationDir(File destinationDir) Sets the directory to generate the documentation into.voidsetExecutable(String executable) voidsetFailOnError(boolean failOnError) voidsetMaxMemory(String maxMemory) Sets the amount of memory allocated to this task.voidSets the title for the generated documentation.voidsetToolChain(JavaToolChain toolChain) Sets the tool chain to use to generate the Javadoc.voidsetVerbose(boolean verbose) Sets whether Javadoc generation is accompanied by verbose output or not.Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class DefaultTask
newInputDirectory, newInputFile, newOutputDirectory, newOutputFileMethods inherited from class org.gradle.api.internal.AbstractTask
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doFirst, doLast, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, 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
-
Constructor Details
-
Javadoc
public Javadoc()
-
-
Method Details
-
generate
protected void generate() -
getSource
Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.- Overrides:
getSourcein classSourceTask- Returns:
- The source.
-
getToolChain
Returns the tool chain that will be used to generate the Javadoc. -
setToolChain
Sets the tool chain to use to generate the Javadoc. -
getDestinationDir
-
getOutputDirectory
-
setDestinationDir
Sets the directory to generate the documentation into.
-
getMaxMemory
-
setMaxMemory
Sets the amount of memory allocated to this task.- Parameters:
maxMemory- The amount of memory
-
getTitle
-
setTitle
Sets the title for the generated documentation.
-
isVerbose
Returns whether Javadoc generation is accompanied by verbose output.- See Also:
-
setVerbose
public void setVerbose(boolean verbose) 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.- Parameters:
verbose- Whether the output should be verbose.
-
getClasspath
Returns the classpath to use to resolve type references in the source code.- Returns:
- The classpath.
-
setClasspath
Sets the classpath to use to resolve type references in this source code.- Parameters:
classpath- The classpath. Must not be null.
-
getOptions
Returns the Javadoc generation options.- Returns:
- The options. Never returns null.
-
options
Convenience method for configuring Javadoc generation options.- Parameters:
block- The configuration block for Javadoc generation options.
-
options
Convenience method for configuring Javadoc generation options.- Parameters:
action- The action for Javadoc generation options.- Since:
- 3.5
-
isFailOnError
Specifies whether this task should fail when errors are encountered during Javadoc generation. Whentrue, this task will fail on Javadoc error. Whenfalse, this task will ignore Javadoc errors. -
setFailOnError
public void setFailOnError(boolean failOnError) -
getOptionsFile
-
getExecutable
-
setExecutable
-