Class CommitAnalyzerExtension
java.lang.Object
io.github.duckasteroid.gradle.versioning.CommitAnalyzerExtension
Gradle-facing configuration for
CommitAnalyzer's type-to-bump mapping. Registered by
VersionPlugin as the commitAnalyzer { } extension, with each property
pre-populated (via addAll(...), not convention(...) - see the note
below) with the corresponding entry of CommitAnalyzer.DEFAULT_TYPE_RULES. This is an
abstract class rather than a plain one deliberately - Gradle auto-implements the abstract
SetProperty getters (its "managed properties" mechanism).
Consumers configure it like:
commitAnalyzer {
minorTypes.add('perf2') // append 'perf2' to the default minor-bump types
majorTypes.add('security') // always treat "security: ..." commits as breaking
noBumpTypes.set(['docs']) // REPLACE the default no-bump set entirely (not append)
}
.add(...)/.addAll(...) appends to whatever's already in the property;
.set(...) replaces it outright. Note this is why VersionPlugin seeds the
defaults with addAll(...) rather than convention(...): a Property's
convention is only used as a fallback while nothing has been explicitly added/set - the moment
.add(...) is called, Gradle discards the convention rather than appending to it, so
seeding with convention(...) would make minorTypes.add('perf2') silently end up
as just ['perf2'], losing the default 'feat'.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.SetProperty<String>abstract org.gradle.api.provider.SetProperty<String>abstract org.gradle.api.provider.SetProperty<String>abstract org.gradle.api.provider.SetProperty<String>Materializes the four properties into theMap<Bump, Set<String>>CommitAnalyzer expects.
-
Constructor Details
-
CommitAnalyzerExtension
public CommitAnalyzerExtension()
-
-
Method Details
-
getMajorTypes
-
getMinorTypes
-
getPatchTypes
-
getNoBumpTypes
-
toTypeRules
Materializes the four properties into theMap<Bump, Set<String>>CommitAnalyzer expects.
-