Hello,
While updating our company’s Gradle scripting with jsemver (via the axion-release-plugin), I ran into a confusing deprecation.
Code example
In this example, we try to set a prerelease version if none exists yet.
if (context.currentVersion.preReleaseVersion().isEmpty()) {
return context.currentVersion.incrementMinorVersion()
.setPreReleaseVersion("rc.1");
}
Problem
Version.setPreReleaseVersion(String) is deprecated (link), with a Javadoc note suggesting nextPreReleaseVersion(String...) instead.
- However,
nextPreReleaseVersion fails when no pre-release version exists because of the isPreRelease() check.
- This makes it impossible to replace the deprecated call in the example above.
Expected behavior
Either:
- The deprecation message should be updated to reflect the correct replacement (or lack thereof) when no pre-release exists.
- Or, a non-deprecated API should exist for the above code fragment (setting the first pre-release version).
Hello,
While updating our company’s Gradle scripting with jsemver (via the
axion-release-plugin), I ran into a confusing deprecation.Code example
In this example, we try to set a prerelease version if none exists yet.
Problem
Version.setPreReleaseVersion(String)is deprecated (link), with a Javadoc note suggestingnextPreReleaseVersion(String...)instead.nextPreReleaseVersionfails when no pre-release version exists because of theisPreRelease()check.Expected behavior
Either: