Closed vinjana closed 6 years ago
Yes, this is expected behavior because from the perspective of the plugin, you're trying to create a new pre-release it and promote it (since the last tag).
The plugin works based on tags, so you're describing a series of version bumps from the last tag, that when resolved into a single "bump", don't really make sense.
If you aren't interested in creating actual pre-release artifacts or tags, then you shouldn't create a new pre-release. It looks like the net effect of what you're doing is to have a single [major]
bump.
Would you mind describing somewhere in the documentation how your plugin is supposed to work with e.g. gitflow or githubflow? Or maybe elaborate somewhat on the use-cases for which you intended the plugin?
In the current documentation the meaning of the individual tasks and properties seems to be well described but leaves me kind of puzzled about how things work together.
@vinjana Yes that is a major shortcoming. I'm planning on adding some examples and a FAQ. Unfortunately, I'm busy with full-time work and full-time school so I haven't had a chance to get to it. I will try to get to it soon.
I am considering to use the plugin in one of our projects and am playing around with it to figure out how it works. Thereby I encountered the following issue:
Given the following (complete) git history:
At 3444194
gradlew printVersion
shows: 1.0.0-alpha.0-SNAPSHOT. That is a pre-release tag-name, as expected. However at 6ce0191gradlew printVersion
gives an error message:From the documentation I interpret that in the default configuration you can switch between pre-release state and release state by "[new-pre-release]" and "[promote]", respectively. Should the result then not just be
1.0.0
in this situation (or maybe1.0.0-SNAPSHOT
)? Or am I getting something wrong about the working of the plugin?In this context it might be relevant that I did not get pre-release numbering. If I extend the repository by a "continue" branch like this
Then doing
./gradlew printVersion
on 904cd37 shows "0.1.0-alpha.0-SNAPSHOT". What I'd (naïvely) expect of a plugin would be that e.g. "alpha.0" gets increased to "alpha.1" and so on with non-"[promote]" commits like here. Is this also the behaviour that is intended by the example in the readme?Finally, it seems that the closure in
preRelease { bump = ... }
never gets executed. At least System.err.println or throws do not result in gradlew --debug output.It all seems like that all commits since the 91db0d1 commit get interpreted as "[new-pre-release]" commits.
I'd be grateful for some support in this issue or clarification about the working of the plugin!
Here are my configuration files:
build.gradle:
settings.gradle:
buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { // The configuration of this plugin is in semantic-build-versioning.gradle. classpath group: 'gradle.plugin.net.vivin', name: 'gradle-semantic-build-versioning', version: '4.0.0' } }
apply plugin: 'net.vivin.gradle-semantic-build-versioning' // MIT