@groovy.transform.CompileStatic @SuppressWarnings(value: [MethodCount, ClassSize]) abstract class AbstractAsciidoctorBaseTask extends DefaultTask implements AsciidoctorTaskMethods
Abstract base task for Asciidoctor that can be shared between AsciidoctorJ and Asciidoctor.js.
| Modifiers | Name | Description |
|---|---|---|
class |
AbstractAsciidoctorBaseTask.1 |
|
class |
AbstractAsciidoctorBaseTask.2 |
| Fields inherited from class | Fields |
|---|---|
class DefaultTask |
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION, TASK_CONSTRUCTOR_ARGS |
| Type Params | Return Type | Name and description |
|---|---|---|
|
abstract void |
attributes(Map<String, Object> m)Shortcut method to add additional asciidoctor attributes. |
|
void |
clearSecondarySources()Clears any of the existing secondary soruces patterns. |
|
void |
clearSources()Clears existing sources patterns. |
|
void |
copyAllResources()Copies all resources to the output directory. |
|
void |
copyNoResources()Do not copy any resources to the output directory. |
|
void |
copyResourcesOnlyIf(String[] backendNames)Copy resources to the output directory only if the backend names matches any of the specified names. |
|
abstract List<AsciidoctorAttributeProvider> |
getAttributeProviders()Shortcut method to access additional providers of attributes. |
|
abstract Map<String, Object> |
getAttributes()Shortcut method for obtaining attributes. |
|
Set<File> |
getBackendOutputDirectories()Returns a list of all output directories by backend |
|
Optional<List<String>> |
getCopyResourcesForBackends()List of backends for which to copy resources. |
|
CopySpec |
getDefaultResourceCopySpec(Optional<String> lang)The default CopySpec that will be used if resources was never called |
|
Provider<PatternSet> |
getIntermediateArtifactPatternProvider()A provider of patterns identifying intermediate artifacts. |
|
File |
getIntermediateWorkDir()The directory that will be the intermediate directory should one be required. |
|
Provider<File> |
getIntermediateWorkDirProvider() |
|
CopySpec |
getLanguageResourceCopySpec(String lang)Returns the copy specification for the resources of a specific language. |
|
List<String> |
getLanguages()Obtain List of languages the sources documents are written in. |
|
File |
getOutputDir()Returns the current toplevel output directory |
|
DirectoryProperty |
getOutputDirProperty()Returns the current toplevel output directory as a property object. |
|
abstract Set<Configuration> |
getReportableConfigurations()Configurations for which dependencies should be reported. |
|
CopySpec |
getResourceCopySpec(Optional<String> lang)Gets the CopySpec for additional resources. |
|
FileTree |
getSecondarySourceFileTree()Returns a FileTree containing all of the secondary source documents. |
|
File |
getSourceDir()Returns the parent directory for Asciidoctor source. |
|
DirectoryProperty |
getSourceDirProperty()Returns the parent directory for Asciidoctor source as a property object. |
|
FileTree |
getSourceFileTree()Returns a FileTree containing all of the source documents |
|
Map<String, Object> |
getTaskSpecificDefaultAttributes(File workingSourceDir)A task may add some default attributes. |
|
boolean |
hasIntermediateWorkDir()Checks whether an intermediate workdir is required. |
|
boolean |
isBaseDirConfigured()Checks whether an explicit strategy has been set for base directory. |
|
void |
languages(Iterable<String> langs)Add to list of languages to process. |
|
void |
languages(String[] langs)Add to list of languages to process. |
|
Workspace |
prepareWorkspace()Prepares a workspace prior to conversion. |
|
Workspace |
prepareWorkspace(String language)Prepares a workspace for a specific language prior to conversion. |
|
void |
resources(groovy.lang.Closure cfg)Add to the CopySpec for extra files. |
|
void |
resources(Action<? super CopySpec> cfg)Add to the CopySpec for extra files. |
|
void |
resources(String lang, groovy.lang.Closure cfg)Add to the CopySpec for extra files. |
|
void |
resources(String lang, Action<? super CopySpec> cfg)Add to the CopySpec for extra files. |
|
void |
secondarySources(groovy.lang.Closure cfg)Configures secondary sources. |
|
void |
secondarySources(Action<? super PatternSet> cfg)Configures sources. |
|
abstract void |
setAttributes(Map<String, Object> m)Shortcut method to apply a new set of Asciidoctor attributes, clearing any attributes previously set. |
|
void |
setLanguages(Iterable<String> langs)Reset current list of languages and replace with a new set. |
|
void |
setOutputDir(Object f)Sets the new Asciidoctor parent output directory. |
|
void |
setSourceDir(Object f)Sets the new Asciidoctor parent source directory. |
|
void |
sourceDir(Object f)Sets the new Asciidoctor parent source directory in a declarative style. |
|
void |
sources(groovy.lang.Closure cfg)Configures sources. |
|
void |
sources(Action<? super PatternSet> cfg)Configures sources. |
|
void |
sources(String[] includePatterns)Include source patterns. |
|
void |
useIntermediateWorkDir()Some extensions such as ditaa creates images in the source directory. |
|
void |
withIntermediateArtifacts(groovy.lang.Closure cfg)The document conversion might generate additional artifacts that could require copying to the final destination. |
|
void |
withIntermediateArtifacts(Action<PatternSet> cfg)Additional artifacts created by Asciidoctor that might require copying. |
Logs documents as they are converted
Shortcut method to add additional asciidoctor attributes.
In most implementations this will just access the attributes method
on the appropriate task extension derived from AbstractImplementationEngineExtension
m - Map with new optionsClears any of the existing secondary soruces patterns. This should be used if none of the default patterns should be monitored.
Clears existing sources patterns.
Copies all resources to the output directory.
Some backends (such as html5) require all resources to be copied to the output directory.
This is the default behaviour for this task.
Do not copy any resources to the output directory.
Some backends (such as pdf) process all resources in place.
Copy resources to the output directory only if the backend names matches any of the specified names.
backendNames - List of names for which resources should be copied.Shortcut method to access additional providers of attributes.
In most implementations this will just access the getAttributeProviders method
on the appropriate task extension derived from AbstractImplementationEngineExtension
Shortcut method for obtaining attributes.
In most implementations this will just access the getAttributes method
on the appropriate task extension derived from AbstractImplementationEngineExtension
Returns a list of all output directories by backend
List of backends for which to copy resources.
null.The default CopySpec that will be used if resources was never called
By default anything below $sourceDir/images will be included.
lang - Language to use. Can be empty (not null) when not to use a language.null.A provider of patterns identifying intermediate artifacts.
The directory that will be the intermediate directory should one be required.
Returns the copy specification for the resources of a specific language.
lang - Languagenull.Obtain List of languages the sources documents are written in.
null.Returns the current toplevel output directory
Returns the current toplevel output directory as a property object.
Configurations for which dependencies should be reported.
null.Gets the CopySpec for additional resources.
If resources was never called, it will return a default CopySpec otherwise it will return the
one built up via successive calls to resources
lang - Language to to apply to or empty for no-language support.null.Returns a FileTree containing all of the secondary source documents. If a filter with secondarySources was never set then all asciidoc source files below setSourceDir will be included. If multiple languages are used all of the language secondary source sets be will included.
Returns the parent directory for Asciidoctor source as a property object.
Returns a FileTree containing all of the source documents If a filter with sources was never set then all asciidoc source files below setSourceDir will be included. If multiple languages are used all of the language source sets be will included.
A task may add some default attributes.
If the user specifies any of these attributes, then those attributes will not be utilised.
The default implementation will add includedir, revnumber, gradle-project-group,
gradle-project-name
workingSourceDir - Directory where source files are located.Checks whether an intermediate workdir is required.
true is there is an intermediate working directory.Checks whether an explicit strategy has been set for base directory.
true if a strategy has been configured.Add to list of languages to process.
langs - List of additional languagesAdd to list of languages to process.
langs - List of additional languagesPrepares a workspace prior to conversion.
Prepares a workspace for a specific language prior to conversion.
language - Language to prepare workspace for.Add to the CopySpec for extra files. The destination of these files will always have a parent directory
of outputDir or outputDir + backend
cfg - CopySpec runConfiguration closureAdd to the CopySpec for extra files. The destination of these files will always have a parent directory
of outputDir or outputDir + backend
Add to the CopySpec for extra files. The destination of these files will always have a parent directory
of outputDir or outputDir + backend
If not languages are set. these resources will be ignored.
cfg - CopySpec runConfiguration closurelang - Language to which these resources will be applied to.Add to the CopySpec for extra files. The destination of these files will always have a parent directory
of outputDir or outputDir + backend
If not languages are set. these resources will be ignored.
cfg - CopySpec runConfiguration Actionlang - Language to which these resources will be applied to.Configures secondary sources.
cfg - Configuration closure. Is passed a PatternSet.Configures sources.
cfg - Configuration Action. Is passed a PatternSet.Shortcut method to apply a new set of Asciidoctor attributes, clearing any attributes previously set.
In most implementations this will just access the setAttributes method
on the appropriate task extension derived from AbstractImplementationEngineExtension
m - Map with new optionsReset current list of languages and replace with a new set.
langs - List of new languagesSets the new Asciidoctor parent output directory.
f - An object convertible via project.fileSets the new Asciidoctor parent source directory.
f - Any object convertible with project.file.Sets the new Asciidoctor parent source directory in a declarative style.
f - Any object convertible with project.file.Configures sources.
cfg - Configuration closure. Is passed a PatternSet.Configures sources.
cfg - Configuration Action. Is passed a PatternSet.Include source patterns.
includePatterns - ANT-style patterns for sources to includeSome extensions such as ditaa creates images in the source directory.
Use this setting to copy all sources and resources to an intermediate work directory
before processing starts. This will keep the source directory pristine
The document conversion might generate additional artifacts that could
require copying to the final destination.
An example is use of ditaa diagram blocks. These artifacts can be specified
in this block. Use of the option implies useIntermediateWorkDir.
If copyNoResources is set or copyResourcesOnlyIf(String ...) does not
match the backend, no copy will occur.
cfg - Configures a PatternSet with a base directory of the intermediate working
directory.Additional artifacts created by Asciidoctor that might require copying.
cfg - Action that configures a PatternSet.