Class Groovydoc
- All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, PatternFilterable, Configurable<Task>
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA Link class represent a link between groovydoc/javadoc output and url.Nested classes/interfaces inherited from interface Named
Named.Namer -
Field Summary
Fields inherited from interface Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgenerate()abstract Property<GroovydocAccess> The most restrictive access level to include in the Groovydoc.abstract ConfigurableFileCollectionAdditional stylesheets to copy into the generated documentation alongside the default stylesheet, preserving each file's name.Returns the classpath used to locate classes referenced by the documented sources.protected abstract org.gradle.internal.file.DeleterReturns the directory to generate the documentation into.abstract DirectoryPropertyReturns the directory to generate the documentation into.@Nullable StringReturns the title for the package index(first) page.@Nullable StringReturns the HTML footer for each page.Returns the classpath containing the Groovy library to be used.@Nullable StringReturns the HTML header for each page.Whether to include author paragraphs.Whether to include main method for scripts.abstract Property<JavaLauncher> The Java launcher used to start the worker process for generating Groovydoc.protected abstract JavaToolchainServiceabstract Property<JavaLanguageVersion> The Java language version used when parsing Java source files, e.g.getLinks()Returns the links to groovydoc/javadoc output at the given URL.Returns the amount of memory allocated to this task.Whether to suppress generation of the deprecated-list page (deprecated-list.html) and its nav-bar link.Whether to suppress generation of the help page (help-doc.html) and its nav-bar link.Whether to suppress generation of the alphabetical index page (index-all.html) and its nav-bar link.protected abstract ObjectFactory@Nullable TextResourceReturns a HTML text to be used for overview documentation.The default language id applied to preformatted code blocks in rendered doc comments that carry noclassattribute.Whether to process scripts.Whether to include members annotated withgroovy.transform.Internal(per GEP-17) in the generated documentation.Returns the source for this task, after the include and exclude patterns have been applied.The client-side syntax highlighter for{@snippet}and fenced Markdown code blocks.getTheme()The theme lock mode for the generated documentation.@Nullable StringReturns the browser window title for the documentation.protected abstract WorkerExecutorbooleanReturns whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6).booleanReturns whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6).booleanisUse()Returns whether to create class and package usage pages.voidAdd links to groovydoc/javadoc output at the given URL.voidsetClasspath(FileCollection classpath) Sets the classpath used to locate classes referenced by the documented sources.voidsetDestinationDir(File destinationDir) Sets the directory to generate the documentation into.voidsetDocTitle(@Nullable String docTitle) Sets title for the package index(first) page (optional).voidSets footer text for each page (optional).voidsetGroovyClasspath(FileCollection groovyClasspath) Sets the classpath containing the Groovy library to be used.voidSets header text for each page (optional).voidsetLinks(Set<Groovydoc.Link> links) Sets links to groovydoc/javadoc output at the given URL.voidsetNoTimestamp(boolean noTimestamp) Sets whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6).voidsetNoVersionStamp(boolean noVersionStamp) Sets whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6).voidsetOverviewText(@Nullable TextResource overviewText) Sets a HTML text to be used for overview documentation (optional).voidsetUse(boolean use) Sets whether to create class and package usage pages.voidsetWindowTitle(@Nullable String windowTitle) Sets the browser window title for the documentation.Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, 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
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, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getLoggingManager, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
Groovydoc
@Inject public Groovydoc()
-
-
Method Details
-
getWorkerExecutor
-
getJavaToolchainService
-
getObjectFactory
-
getJavaLauncher
The Java launcher used to start the worker process for generating Groovydoc.- Since:
- 9.7.0
-
getMaxMemory
Returns the amount of memory allocated to this task. Ex. 512m, 1G- Since:
- 9.7.0
-
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.The
PathSensitivityfor the sources is configured to bePathSensitivity.ABSOLUTE. If your sources are less strict, please change it accordingly by overriding this method in your subclass.- Overrides:
getSourcein classSourceTask- Returns:
- The source.
-
getDestinationDirectory
Returns the directory to generate the documentation into.- Returns:
- The directory to generate the documentation into
- Since:
- 9.7.0
-
getDestinationDir
Returns the directory to generate the documentation into.- Returns:
- The directory to generate the documentation into
-
setDestinationDir
Sets the directory to generate the documentation into. -
getGroovyClasspath
Returns the classpath containing the Groovy library to be used.- Returns:
- The classpath containing the Groovy library to be used
-
setGroovyClasspath
Sets the classpath containing the Groovy library to be used. -
getClasspath
Returns the classpath used to locate classes referenced by the documented sources.- Returns:
- The classpath used to locate classes referenced by the documented sources
-
setClasspath
Sets the classpath used to locate classes referenced by the documented sources. -
isUse
Returns whether to create class and package usage pages. -
setUse
public void setUse(boolean use) Sets whether to create class and package usage pages. -
isNoTimestamp
Returns whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6). -
setNoTimestamp
public void setNoTimestamp(boolean noTimestamp) Sets whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6). -
isNoVersionStamp
Returns whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6). -
setNoVersionStamp
public void setNoVersionStamp(boolean noVersionStamp) Sets whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6). -
getWindowTitle
-
setWindowTitle
Sets the browser window title for the documentation.- Parameters:
windowTitle- A text for the windows title
-
getDocTitle
-
setDocTitle
Sets title for the package index(first) page (optional).- Parameters:
docTitle- the docTitle as HTML
-
getHeader
-
setHeader
Sets header text for each page (optional).- Parameters:
header- the header as HTML
-
getOverviewText
Returns a HTML text to be used for overview documentation. Set tonullwhen there is no overview text. -
setOverviewText
Sets a HTML text to be used for overview documentation (optional).Example:
overviewText = resources.text.fromFile("/overview.html") -
getAccess
The most restrictive access level to include in the Groovydoc.For example, to include classes and members with package, protected, and public access, use
GroovydocAccess.PACKAGE.- Returns:
- the access property
- Since:
- 7.5
-
getIncludeAuthor
-
getProcessScripts
-
getIncludeMainForScripts
-
getJavaVersion
The Java language version used when parsing Java source files, e.g.JavaLanguageVersion.of(17).Groovydoc uses the JavaParser library to read Java sources; this controls the source level it assumes, which is needed for parsing newer Java language constructs (for example, sealed classes require Java 17). When unset, Groovydoc uses the JavaParser library's own default.
Only has an effect with Groovy 4.0.27 or later; the option is silently ignored with earlier Groovy versions.
- Since:
- 9.8.0
-
getShowInternal
Whether to include members annotated withgroovy.transform.Internal(per GEP-17) in the generated documentation.Defaults to
false, so internal members are hidden. Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getNoIndex
Whether to suppress generation of the alphabetical index page (index-all.html) and its nav-bar link.Defaults to
false. Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getNoDeprecatedList
Whether to suppress generation of the deprecated-list page (deprecated-list.html) and its nav-bar link.Defaults to
false. Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getNoHelp
Whether to suppress generation of the help page (help-doc.html) and its nav-bar link.Defaults to
false. Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getSyntaxHighlighter
The client-side syntax highlighter for{@snippet}and fenced Markdown code blocks.Valid values are
"prism"(bundled) or"none"(default); any other value is treated as"none". Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getTheme
The theme lock mode for the generated documentation."auto"(default) — emit aprefers-color-schememedia query so each reader sees their OS preference."light"— lock the palette to light regardless of OS."dark"— lock the palette to dark regardless of OS.
"auto". Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.- Since:
- 9.8.0
-
getPreLanguage
The default language id applied to preformatted code blocks in rendered doc comments that carry noclassattribute.When set (for example,
"groovy"), a post-pass addsclass="language-xxx"to the opening tag of such blocks, enabling syntax highlighting for legacy doc-comment code blocks without touching source files. Blocks that already carry anyclassattribute are left alone.Only has an effect with Groovy 6.0.0 or later; the option is silently ignored with earlier Groovy versions.
- Since:
- 9.8.0
-
getAdditionalStylesheets
@Incubating @InputFiles @PathSensitive(NAME_ONLY) public abstract ConfigurableFileCollection getAdditionalStylesheets()Additional stylesheets to copy into the generated documentation alongside the default stylesheet, preserving each file's name.Only has an effect with Groovy 6.0.0 or later; the stylesheets are silently ignored with earlier Groovy versions.
- Since:
- 9.8.0
-
getLinks
Returns the links to groovydoc/javadoc output at the given URL. -
setLinks
Sets links to groovydoc/javadoc output at the given URL.- Parameters:
links- The links to set- See Also:
-
link
-
getDeleter
@Inject protected abstract org.gradle.internal.file.Deleter getDeleter()
-