Package com.arc_e_tect.gradle.gherkin
Class GenerateFeatureDocsTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.arc_e_tect.gradle.gherkin.GenerateFeatureDocsTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault(because="Generated documentation depends on source file content and is cheap to regenerate")
public abstract class GenerateFeatureDocsTask
extends org.gradle.api.DefaultTask
Gradle task that scans
.feature files and writes all scenario titles
to a single AsciiDoc file.
Caching is intentionally disabled: the output depends entirely on the contents of the feature files and regeneration is cheap.
Either getSourceDir() or getSourceFile() must be
configured, but not both. When neither is set the task falls back to the
default source directory ("src/test/resources/features")
relative to the project directory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.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 TypeMethodDescriptionvoidgenerate()Task action: collects.featurefiles, parses scenario titles, and writes them to the configured AsciiDoc output file.abstract org.gradle.api.provider.Property<Boolean> Whether to recursively scan sub-directories whengetSourceDir()is used.abstract org.gradle.api.file.DirectoryPropertyDirectory where the generated AsciiDoc file will be written.abstract org.gradle.api.provider.Property<String> Name of the generated AsciiDoc file (without path).abstract org.gradle.api.file.DirectoryPropertyRoot directory of the project, used to resolve the default source directory when neithergetSourceDir()norgetSourceFile()is set.abstract org.gradle.api.file.DirectoryPropertyOptional source directory containing the.featurefiles to process.abstract org.gradle.api.file.RegularFilePropertyOptional single.featurefile to process.Methods inherited from class org.gradle.api.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, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
GenerateFeatureDocsTask
@Inject public GenerateFeatureDocsTask()Creates a new task instance. Invoked by Gradle's dependency injection infrastructure.
-
-
Method Details
-
getSourceDir
@Optional @InputDirectory @PathSensitive(RELATIVE) public abstract org.gradle.api.file.DirectoryProperty getSourceDir()Optional source directory containing the.featurefiles to process. Mutually exclusive withgetSourceFile().- Returns:
- mutable directory property for the feature file source directory
-
getSourceFile
@Optional @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getSourceFile()Optional single.featurefile to process. Mutually exclusive withgetSourceDir().- Returns:
- mutable file property for a single feature file
-
getIncludeSubDirs
Whether to recursively scan sub-directories whengetSourceDir()is used.- Returns:
- mutable boolean property controlling recursive directory scanning
-
getOutputDir
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDir()Directory where the generated AsciiDoc file will be written.- Returns:
- mutable directory property for the output directory
-
getOutputFileName
Name of the generated AsciiDoc file (without path).- Returns:
- mutable string property for the output file name
-
getProjectDirectory
@Internal public abstract org.gradle.api.file.DirectoryProperty getProjectDirectory()Root directory of the project, used to resolve the default source directory when neithergetSourceDir()norgetSourceFile()is set.- Returns:
- mutable directory property for the project root directory
-
generate
public void generate()Task action: collects.featurefiles, parses scenario titles, and writes them to the configured AsciiDoc output file.
-