gradle-release
gradle-release copied to clipboard
Question: Behavior of plugin while preparing new version commit
I'm using this plugin in a project with minimal configuration:
release {
git {
requireBranch.set('my-branch-pattern')
pushToRemote.set('origin')
}
}
I have observed the following behavior:
- When I trigger the release from a branch where my project's version (maintained in the
gradle.propertiesfile) ends with-SNAPSHOT, the plugin will postfix the new version set during the new version commit with-SNAPSHOT. - When i trigger the release from a branch where my project's version does not end with
-SNAPSHOT(e.g. 1.0.1), then the plugin will not postfix the new version set during the new version commit with-SNAPSHOT.
I would like to achieve the following behavior:
- I want to have the new version defined during the new version commit to always be postfixed with
-SNAPSHOT. Is this possible?
If you set in the https://github.com/researchgate/gradle-release/blob/main/src/main/groovy/net/researchgate/release/ReleaseExtension.groovy#L107 usesSnapshot to true. Then it should work that way. It's picked up in the update version task https://github.com/researchgate/gradle-release/blob/main/src/main/groovy/net/researchgate/release/tasks/UpdateVersion.groovy#L34 .