gradle-release icon indicating copy to clipboard operation
gradle-release copied to clipboard

Question: Behavior of plugin while preparing new version commit

Open fullben opened this issue 2 years ago • 1 comments

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.properties file) 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?

fullben avatar Apr 14 '23 06:04 fullben

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 .

Hillkorn avatar Jul 08 '24 08:07 Hillkorn