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
    Constructor
    Description
    Creates a new task instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Task action: collects .feature files, 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 when getSourceDir() is used.
    abstract org.gradle.api.file.DirectoryProperty
    Directory 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.DirectoryProperty
    Root directory of the project, used to resolve the default source directory when neither getSourceDir() nor getSourceFile() is set.
    abstract org.gradle.api.file.DirectoryProperty
    Optional source directory containing the .feature files to process.
    abstract org.gradle.api.file.RegularFileProperty
    Optional single .feature file 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, usesService

    Methods 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, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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 .feature files to process. Mutually exclusive with getSourceFile().
      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 .feature file to process. Mutually exclusive with getSourceDir().
      Returns:
      mutable file property for a single feature file
    • getIncludeSubDirs

      @Input public abstract org.gradle.api.provider.Property<Boolean> getIncludeSubDirs()
      Whether to recursively scan sub-directories when getSourceDir() 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

      @Input public abstract org.gradle.api.provider.Property<String> 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 neither getSourceDir() nor getSourceFile() is set.
      Returns:
      mutable directory property for the project root directory
    • generate

      public void generate()
      Task action: collects .feature files, parses scenario titles, and writes them to the configured AsciiDoc output file.