allegro / axion-release-plugin

Gradle release & version management plugin.
https://axion-release-plugin.readthedocs.io/
Apache License 2.0
566 stars 155 forks source link

Configuring versionIncrementer is cumbersome in Kotlin DSL #841

Open radoslaw-panuszewski opened 1 month ago

radoslaw-panuszewski commented 1 month ago

Expected behavior

scmVersion {
    versionIncrementer = PredefinedVersionCreator.INCREMENT_MINOR.versionIncrementer
}

Current behavior

scmVersion {
    versionIncrementer = VersionProperties.Incrementer { it.currentVersion.incrementMinorVersion() }
}

Context

There are 2 interfaces: PredefinedVersionIncrementer.VersionIncrementer and VersionProperties.Incrementer. The latter is exposed to DSL via VersionConfig.getVersionIncrementer() but PredefinedVersionIncrementer implements the former.

The similar config versionCreator has only one interface VersionProperties.Creator and PredefinedVersionCreator implements it. We should do it the same way for versionIncrementer.