java.lang.Comparable<Task>
, org.gradle.api.internal.DynamicObjectAware
, org.gradle.api.internal.IConventionAware
, org.gradle.api.internal.TaskInternal
, ExtensionAware
, Task
, PatternFilterable
, Configurable<Task>
@CacheableTask public abstract class Groovydoc extends SourceTask
Generates HTML API documentation for Groovy source, and optionally, Java source.
This task uses Groovy's Groovydoc tool to generate the API documentation. Please note that the Groovydoc tool has some limitations at the moment. The version of the Groovydoc that is used, is the one from the Groovy dependency defined in the build script.
Modifier and Type | Class | Description |
---|---|---|
static class |
Groovydoc.Link |
A Link class represent a link between groovydoc/javadoc output and url.
|
Task.Namer
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor | Description |
---|---|
Groovydoc() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
generate() |
|
Property<GroovydocAccess> |
getAccess() |
The most restrictive access level to include in the Groovydoc.
|
org.gradle.api.internal.tasks.AntGroovydoc |
getAntGroovydoc() |
|
FileCollection |
getClasspath() |
Returns the classpath used to locate classes referenced by the documented sources.
|
protected org.gradle.internal.file.Deleter |
getDeleter() |
|
java.io.File |
getDestinationDir() |
Returns the directory to generate the documentation into.
|
java.lang.String |
getDocTitle() |
Returns the title for the package index(first) page.
|
java.lang.String |
getFooter() |
Returns the HTML footer for each page.
|
FileCollection |
getGroovyClasspath() |
Returns the classpath containing the Groovy library to be used.
|
java.lang.String |
getHeader() |
Returns the HTML header for each page.
|
Property<java.lang.Boolean> |
getIncludeAuthor() |
Whether to include author paragraphs.
|
Property<java.lang.Boolean> |
getIncludeMainForScripts() |
Whether to include main method for scripts.
|
java.util.Set<Groovydoc.Link> |
getLinks() |
Returns the links to groovydoc/javadoc output at the given URL.
|
TextResource |
getOverviewText() |
Returns a HTML text to be used for overview documentation.
|
Property<java.lang.Boolean> |
getProcessScripts() |
Whether to process scripts.
|
FileTree |
getSource() |
Returns the source for this task, after the include and exclude patterns have been applied.
|
java.lang.String |
getWindowTitle() |
Returns the browser window title for the documentation.
|
boolean |
isNoTimestamp() |
Returns whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6).
|
boolean |
isNoVersionStamp() |
Returns whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6).
|
boolean |
isUse() |
Returns whether to create class and package usage pages.
|
void |
link(java.lang.String url,
java.lang.String... packages) |
Add links to groovydoc/javadoc output at the given URL.
|
void |
setAntGroovydoc(org.gradle.api.internal.tasks.AntGroovydoc antGroovydoc) |
|
void |
setClasspath(FileCollection classpath) |
Sets the classpath used to locate classes referenced by the documented sources.
|
void |
setDestinationDir(java.io.File destinationDir) |
Sets the directory to generate the documentation into.
|
void |
setDocTitle(java.lang.String docTitle) |
Sets title for the package index(first) page (optional).
|
void |
setFooter(java.lang.String footer) |
Sets footer text for each page (optional).
|
void |
setGroovyClasspath(FileCollection groovyClasspath) |
Sets the classpath containing the Groovy library to be used.
|
void |
setHeader(java.lang.String header) |
Sets header text for each page (optional).
|
void |
setLinks(java.util.Set<Groovydoc.Link> links) |
Sets links to groovydoc/javadoc output at the given URL.
|
void |
setNoTimestamp(boolean noTimestamp) |
Sets whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6).
|
void |
setNoVersionStamp(boolean noVersionStamp) |
Sets whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6).
|
void |
setOverviewText(TextResource overviewText) |
Sets a HTML text to be used for overview documentation (optional).
|
void |
setUse(boolean use) |
Sets whether to create class and package usage pages.
|
void |
setWindowTitle(java.lang.String windowTitle) |
Sets the browser window title for the documentation.
|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, source
conventionMapping, conventionMapping, getConventionMapping
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
protected void generate()
@PathSensitive(RELATIVE) public FileTree getSource()
The PathSensitivity
for the sources is configured to be PathSensitivity.ABSOLUTE
.
If your sources are less strict, please change it accordingly by overriding this method in your subclass.
getSource
in class SourceTask
@OutputDirectory public java.io.File getDestinationDir()
public void setDestinationDir(java.io.File destinationDir)
@Classpath public FileCollection getGroovyClasspath()
public void setGroovyClasspath(FileCollection groovyClasspath)
@Classpath public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)
@Internal public org.gradle.api.internal.tasks.AntGroovydoc getAntGroovydoc()
public void setAntGroovydoc(org.gradle.api.internal.tasks.AntGroovydoc antGroovydoc)
@Input public boolean isUse()
public void setUse(boolean use)
@Input public boolean isNoTimestamp()
public void setNoTimestamp(boolean noTimestamp)
@Input public boolean isNoVersionStamp()
public void setNoVersionStamp(boolean noVersionStamp)
@Nullable @Optional @Input public java.lang.String getWindowTitle()
null
when there is no window title.public void setWindowTitle(@Nullable java.lang.String windowTitle)
windowTitle
- A text for the windows title@Nullable @Optional @Input public java.lang.String getDocTitle()
null
when there is no document title.public void setDocTitle(@Nullable java.lang.String docTitle)
docTitle
- the docTitle as HTML@Nullable @Optional @Input public java.lang.String getHeader()
null
when there is no header.public void setHeader(@Nullable java.lang.String header)
header
- the header as HTML@Nullable @Optional @Input public java.lang.String getFooter()
null
when there is no footer.public void setFooter(@Nullable java.lang.String footer)
footer
- the footer as HTML@Nullable @Optional public TextResource getOverviewText()
null
when there is no overview text.public void setOverviewText(@Nullable TextResource overviewText)
Example: overviewText = resources.text.fromFile("/overview.html")
@Input public Property<GroovydocAccess> getAccess()
For example, to include classes and members with package, protected, and public access, use GroovydocAccess.PACKAGE
.
@Input public Property<java.lang.Boolean> getIncludeAuthor()
@Input public Property<java.lang.Boolean> getProcessScripts()
@Input public Property<java.lang.Boolean> getIncludeMainForScripts()
@Input public java.util.Set<Groovydoc.Link> getLinks()
public void setLinks(java.util.Set<Groovydoc.Link> links)
links
- The links to setlink(String, String...)
public void link(java.lang.String url, java.lang.String... packages)
url
- Base URL of external sitepackages
- list of package prefixes@Inject protected org.gradle.internal.file.Deleter getDeleter()