Class CommitAnalyzerExtension

java.lang.Object
io.github.duckasteroid.gradle.versioning.CommitAnalyzerExtension

public abstract class CommitAnalyzerExtension extends Object
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 Details

    • CommitAnalyzerExtension

      public CommitAnalyzerExtension()
  • Method Details

    • getMajorTypes

      public abstract org.gradle.api.provider.SetProperty<String> getMajorTypes()
    • getMinorTypes

      public abstract org.gradle.api.provider.SetProperty<String> getMinorTypes()
    • getPatchTypes

      public abstract org.gradle.api.provider.SetProperty<String> getPatchTypes()
    • getNoBumpTypes

      public abstract org.gradle.api.provider.SetProperty<String> getNoBumpTypes()
    • toTypeRules

      public Map<CommitAnalyzer.Bump,Set<String>> toTypeRules()
      Materializes the four properties into the Map<Bump, Set<String>> CommitAnalyzer expects.