diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/versioning/VersioningPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/versioning/VersioningPlugin.kt index cd3499e6..4f4b61af 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/versioning/VersioningPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/versioning/VersioningPlugin.kt @@ -70,27 +70,27 @@ class VersioningPlugin : Plugin { val version = versionName.map(Version::parse) tasks.register("clearPreRelease") { description = "Remove the pre-release suffix from the version" - semverString.set(version.get().toStableVersion().toString()) + semverString.set(version.map(Version::toStableVersion).map(Version::toString)) propertyFile.set(propFile) } tasks.register("bumpMajor") { description = "Increment the major version" - semverString.set(version.get().nextMajorVersion().toString()) + semverString.set(version.map(Version::nextMajorVersion).map(Version::toString)) propertyFile.set(propFile) } tasks.register("bumpMinor") { description = "Increment the minor version" - semverString.set(version.get().nextMinorVersion().toString()) + semverString.set(version.map(Version::nextMinorVersion).map(Version::toString)) propertyFile.set(propFile) } tasks.register("bumpPatch") { description = "Increment the patch version" - semverString.set(version.get().nextPatchVersion().toString()) + semverString.set(version.map(Version::nextPatchVersion).map(Version::toString)) propertyFile.set(propFile) } tasks.register("bumpSnapshot") { description = "Increment the minor version and add the `SNAPSHOT` suffix" - semverString.set(version.get().nextMinorVersion("SNAPSHOT").toString()) + semverString.set(version.map { it.nextMinorVersion("SNAPSHOT") }.map(Version::toString)) propertyFile.set(propFile) } afterEvaluate {