@groovy.transform.CompileStatic @SuppressWarnings(value: MethodCount) class DefaultAsciidoctorFileOperations extends Object implements AsciidoctorTaskFileOperations, AsciidoctorTaskTreeOperations
Implements Asciidoctor conversion task file operations. Instances of this is meant to be used via delegation.
| Modifiers | Name | Description |
|---|---|---|
class |
DefaultAsciidoctorFileOperations.1 |
| Type | Name and description |
|---|---|
String |
engineName |
List<String> |
languages |
boolean |
logDocumentsLogs documents as they are converted |
File |
outputDir |
| Constructor and description |
|---|
DefaultAsciidoctorFileOperations
(Task task, String engineName) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
checkForIncompatiblePathRoots(BaseDirStrategy baseDir)Validates that the path roots are sane. |
|
void |
checkForInvalidSourceDocuments()Validates the source tree |
|
void |
clearSecondarySources()Clears any of the existing secondary soruces patterns. |
|
void |
clearSources()Clears existing sources patterns. |
|
Set<File> |
getBackendOutputDirectories()Returns a list of all output directories by backend |
|
CopySpec |
getDefaultResourceCopySpec(Optional<String> lang)The default CopySpec that will be used if resources was never called |
|
PatternSet |
getDefaultSecondarySourceDocumentPattern()The default pattern set for secondary sources. |
|
PatternSet |
getDefaultSourceDocumentPattern()The default PatternSet that will be used if sources was never called |
|
Provider<PatternSet> |
getIntermediateArtifactPatternProvider()A provider of patterns identifying intermediate artifacts. |
|
Provider<File> |
getIntermediateWorkDirProvider()The directory that will be the intermediate directory should one be required. |
|
CopySpec |
getLanguageResourceCopySpec(String lang)Returns the copy specification for the resources of a specific language. |
|
FileTree |
getLanguageSecondarySourceFileTree(String lang)Gets the language-specific secondary source tree. |
|
FileTree |
getLanguageSourceFileTree(String lang)Gets the language-specific source tree |
|
List<String> |
getLanguages()Obtain List of languages the sources documents are written in. |
|
File |
getOutputDir()Returns the current toplevel output directory |
|
File |
getOutputDirFor(String backendName)Get the output directory for a specific backend. |
|
DirectoryProperty |
getOutputDirProperty()Returns the current toplevel output directory as a property object. |
|
CopySpec |
getResourceCopySpec(Optional<String> lang)Gets the CopySpec for additional resources. |
|
FileTree |
getSecondarySourceFileTree()Returns a FileTree containing all of the secondary source documents. |
|
FileTree |
getSecondarySourceFileTreeFrom(File dir)Obtains a secondary source tree based on patterns. |
|
DirectoryProperty |
getSourceDirProperty()Returns the parent directory for Asciidoctor source as a property object. |
|
FileTree |
getSourceFileTree()Returns a FileTree containing all of the source documents |
|
FileTree |
getSourceFileTreeFrom(File dir)Obtains a source tree based on patterns. |
|
Map<String, ?> |
getTaskSpecificDefaultAttributes(File workingSourceDir)A task may add some default attributes. |
|
boolean |
hasIntermediateWorkDir()Checks whether an intermediate workdir is required. |
|
void |
languages(Iterable<String> langs)Add to list of languages to process. |
|
void |
languages(String[] langs)Add to list of languages to process. |
|
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. |
|
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
Validates that the path roots are sane.
baseDir - Base directory strategy. Can be nullValidates the source tree
Clears any of the existing secondary soruces patterns. This should be used if none of the default patterns should be monitored.
Clears existing sources patterns.
Returns a list of all output directories by backend
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.The default pattern set for secondary sources.
The default PatternSet that will be used if sources was never called
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.Gets the language-specific secondary source tree.
lang - LanguageGets the language-specific source tree
lang - LanguageObtain List of languages the sources documents are written in.
null.Get the output directory for a specific backend.
backendName - Name of backendReturns the current toplevel output directory as a property object.
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.
Obtains a secondary source tree based on patterns.
dir - Toplevel source directory.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.
Obtains a source tree based on patterns.
dir - Toplevel source directory. 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.Add to list of languages to process.
langs - List of additional languagesAdd to list of languages to process.
langs - List of additional languagesAdd 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.Reset 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.
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.Copyright © 2013-2024 the original author or authors. All rights reserved.