Package com.arc_e_tect.gradle.gherkin
Class GherkinToAsciidocExtension
java.lang.Object
com.arc_e_tect.gradle.gherkin.GherkinToAsciidocExtension
DSL extension for the Gherkin-to-AsciiDoc Gradle plugin.
gherkinToAsciidoc {
sourceDirs.from('src/test/resources/features') // default
includeSubDirs = false // default
outputDir = layout.buildDirectory.dir('generated-docs') // default
outputFileName = 'features.adoc' // default
trackProgress = false // default
// glueCodeDirs.from('src/test/java/.../steps') // required when trackProgress = true
groupByFeature = false // default; forced to true whenever trackProgress = true
// snippetDir = layout.buildDirectory.dir('generated-docs/features/snippets') // default
// template = file('templates/report.mustache') // optional
// systemUnderTestVersion = 'v1.0.0' // optional; default: project.version
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault name of the generated AsciiDoc output file.static final StringDefault relative path of the directory report snippets are written to.static final StringDefault relative path of the source directory containing.featurefiles.static final StringExtension DSL block name, i.e. -
Constructor Summary
ConstructorsConstructorDescriptionFor use by the Gradle-generated concrete subclass. -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.ConfigurableFileCollectionDirectories containing the Cucumber-JVM glue code (step definitions) used to determine whether a scenario's steps are implemented.abstract org.gradle.api.provider.Property<Boolean> Whether to group scenarios by their enclosingFeaturein the generated AsciiDoc, instead of a flat list.abstract org.gradle.api.provider.Property<Boolean> Whether to recursively scan sub-directories of every configured directory ingetSourceDirs().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.DirectoryPropertyDirectory that thelisted.adoc/defined.adoc/implemented.adocreport snippets are written to whengetTrackProgress()istrue.abstract org.gradle.api.file.ConfigurableFileCollectionSource directories that contain the.featurefiles to process.abstract org.gradle.api.file.RegularFilePropertyA single.featurefile to process.abstract org.gradle.api.provider.Property<String> Version of the system under test that the reported Gherkin scenarios exercise, printed in the generated document as e.g.abstract org.gradle.api.file.RegularFilePropertyOptional Mustache template used to render the generated AsciiDoc file so that it references the report snippets viainclude::directives, instead of embedding their content verbatim.abstract org.gradle.api.provider.Property<Boolean> Whether to classify every scenario aslisted,defined, orimplementedand include a progress summary in the generated AsciiDoc.
-
Field Details
-
NAME
Extension DSL block name, i.e. the name used to register the extension with the project.- See Also:
-
DEFAULT_SOURCE_DIR
Default relative path of the source directory containing.featurefiles.- See Also:
-
DEFAULT_OUTPUT_FILE_NAME
Default name of the generated AsciiDoc output file.- See Also:
-
DEFAULT_SNIPPET_DIR
Default relative path of the directory report snippets are written to.- See Also:
-
-
Constructor Details
-
GherkinToAsciidocExtension
public GherkinToAsciidocExtension()For use by the Gradle-generated concrete subclass.
-
-
Method Details
-
getSourceDirs
public abstract org.gradle.api.file.ConfigurableFileCollection getSourceDirs()Source directories that contain the.featurefiles to process. One or more directories may be configured, e.g. viasourceDirs.from(file('a'), file('b')). Mutually exclusive withgetSourceFile().- Returns:
- mutable file collection of feature file source directories
-
getSourceFile
public abstract org.gradle.api.file.RegularFileProperty getSourceFile()A single.featurefile to process. Mutually exclusive withgetSourceDirs().- Returns:
- mutable file property for a single feature file
-
getIncludeSubDirs
Whether to recursively scan sub-directories of every configured directory ingetSourceDirs(). Defaults tofalse. Forced totruewhenevergetTrackProgress()istrue.- Returns:
- mutable boolean property controlling recursive directory scanning
-
getOutputDir
public abstract org.gradle.api.file.DirectoryProperty getOutputDir()Directory where the generated AsciiDoc file will be written. Defaults tobuild/generated-docs.- Returns:
- mutable directory property for the output directory
-
getOutputFileName
Name of the generated AsciiDoc file (without path). Defaults to "features.adoc".- Returns:
- mutable string property for the output file name
-
getTrackProgress
Whether to classify every scenario aslisted,defined, orimplementedand include a progress summary in the generated AsciiDoc. Defaults tofalse.Can only be enabled when
getSourceDirs()andgetGlueCodeDirs()are both configured; enabling it also impliesgetIncludeSubDirs().- Returns:
- mutable boolean property controlling progress tracking
-
getGlueCodeDirs
public abstract org.gradle.api.file.ConfigurableFileCollection getGlueCodeDirs()Directories containing the Cucumber-JVM glue code (step definitions) used to determine whether a scenario's steps are implemented. One or more directories may be configured, e.g. viaglueCodeDirs.from(file('a'), file('b')). Required whengetTrackProgress()istrue; ignored otherwise.- Returns:
- mutable file collection of glue code directories
-
getGroupByFeature
Whether to group scenarios by their enclosingFeaturein the generated AsciiDoc, instead of a flat list. Defaults tofalse. Forced totruewhenevergetTrackProgress()istrue, in which case scenarios are grouped by feature within each of the listed/defined/implemented sections.- Returns:
- mutable boolean property controlling grouping by feature
-
getSnippetDir
public abstract org.gradle.api.file.DirectoryProperty getSnippetDir()Directory that thelisted.adoc/defined.adoc/implemented.adocreport snippets are written to whengetTrackProgress()istrue. Defaults tobuild/generated-docs/features/snippets.When
getGroupByFeature()istrue, snippets for a status with at least one scenario are written per feature, under<snippetDir>/<camelCaseFeatureTitle>/<status>.adoc.- Returns:
- mutable directory property for the snippet output directory
-
getTemplate
public abstract org.gradle.api.file.RegularFileProperty getTemplate()Optional Mustache template used to render the generated AsciiDoc file so that it references the report snippets viainclude::directives, instead of embedding their content verbatim. Only consulted whengetTrackProgress()istrue; ignored otherwise.When not set, the generated report looks exactly as it does without this property: scenario titles are embedded directly, with no
include::directives. The snippet files are still written either way.- Returns:
- mutable file property for the Mustache template file
-
getSystemUnderTestVersion
Version of the system under test that the reported Gherkin scenarios exercise, printed in the generated document as e.g.System Under Test version: v1.0.0. Defaults to the project's ownversion(as set in the build file or a properties file); set this property to override that default, e.g. when the scenarios target a different artifact than the one being built.- Returns:
- mutable string property for the system-under-test version
-