@@ -8,7 +8,7 @@ package app.passwordstore.gradle.versioning
8
8
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
9
9
import com.android.build.api.variant.VariantOutputConfiguration
10
10
import com.android.build.gradle.internal.plugins.AppPlugin
11
- import com.vdurmont.semver4j.Semver
11
+ import com.github.zafarkhaja.semver.Version
12
12
import java.util.Properties
13
13
import java.util.concurrent.atomic.AtomicBoolean
14
14
import org.gradle.api.Plugin
@@ -56,30 +56,30 @@ class VersioningPlugin : Plugin<Project> {
56
56
}
57
57
}
58
58
}
59
- val version = Semver (versionName)
59
+ val version = Version .parse (versionName)
60
60
tasks.register<VersioningTask >(" clearPreRelease" ) {
61
61
description = " Remove the pre-release suffix from the version"
62
- semverString.set(version.withClearedSuffix ().toString())
62
+ semverString.set(version.toStableVersion ().toString())
63
63
propertyFile.set(propFile)
64
64
}
65
65
tasks.register<VersioningTask >(" bumpMajor" ) {
66
66
description = " Increment the major version"
67
- semverString.set(version.withIncMajor().withClearedSuffix ().toString())
67
+ semverString.set(version.nextMajorVersion ().toString())
68
68
propertyFile.set(propFile)
69
69
}
70
70
tasks.register<VersioningTask >(" bumpMinor" ) {
71
71
description = " Increment the minor version"
72
- semverString.set(version.withIncMinor().withClearedSuffix ().toString())
72
+ semverString.set(version.nextMinorVersion ().toString())
73
73
propertyFile.set(propFile)
74
74
}
75
75
tasks.register<VersioningTask >(" bumpPatch" ) {
76
76
description = " Increment the patch version"
77
- semverString.set(version.withIncPatch().withClearedSuffix ().toString())
77
+ semverString.set(version.nextPatchVersion ().toString())
78
78
propertyFile.set(propFile)
79
79
}
80
80
tasks.register<VersioningTask >(" bumpSnapshot" ) {
81
81
description = " Increment the minor version and add the `SNAPSHOT` suffix"
82
- semverString.set(version.withIncMinor().withSuffix (" SNAPSHOT" ).toString())
82
+ semverString.set(version.nextMinorVersion (" SNAPSHOT" ).toString())
83
83
propertyFile.set(propFile)
84
84
}
85
85
afterEvaluate {
0 commit comments