Class ProjectAttribution
java.lang.Object
com.arc_e_tect.gradle.gherkin.indexing.ProjectAttribution
Decides which project in a Gradle build a given
.feature file belongs to, by matching the
file's path against every project's directory.
This is the single notion of "owning project" the plugin scopes work by. FeatureIndexer
uses it to number each project's features as its own 1-based sequence, and the task uses it to tell
whether the files one invocation collected actually span more than one project - which is the only
situation in which that scoping changes anything.
A file that isn't under any of the configured project directories (which shouldn't normally happen, since callers supply every project directory in the build) is attributed to itself rather than being silently folded into an unrelated project.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectAttribution(List<File> projectDirectories) Creates an attribution overprojectDirectories. -
Method Summary
Modifier and TypeMethodDescriptionowningProjectDirectories(List<File> featureFiles) Every distinct projectfeatureFilesis spread across, in the order each owner was first encountered.owningProjectDirectory(File featureFile) The most specific project directory that is an ancestor offeatureFile, orfeatureFileitself when none is.
-
Constructor Details
-
ProjectAttribution
Creates an attribution overprojectDirectories.- Parameters:
projectDirectories- every project directory in the build; an empty list attributes every file to itself, since there are then no boundaries to match against
-
-
Method Details
-
owningProjectDirectory
The most specific project directory that is an ancestor offeatureFile, orfeatureFileitself when none is.- Parameters:
featureFile- the feature file to attribute- Returns:
- the owning project's directory, never
null
-
owningProjectDirectories
Every distinct projectfeatureFilesis spread across, in the order each owner was first encountered.- Parameters:
featureFiles- the feature files one run collected- Returns:
- the distinct owning project directories; empty when
featureFilesis empty
-