Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Function to create a new pre-release or bump an existing one in one step #109

Open
alex42ree opened this issue Oct 10, 2019 · 1 comment

Comments

@alex42ree
Copy link

We need a function that creates the next pre-release version regardless of the status of the last release.

Current behaviour for a NEW pre-release is providing the property "-PnewPreRelease". It does the following:
Current version 1.0.0 -> new pre-release is 1.0.1-RC.0
Current version 1.0.1-RC.0 -> new pre-release is 1.0.2-RC.0
It always creates a new pre-release even if the latest version is already a pre-release.

Current behavior for INCREASING an existing pre-release version with "-PbumpComponent=pre-release" property is:
Current version 1.0.0 -> ERROR, there is no existing pre-release (see below)
Current version 1.0.0-SNAPSHOT -> ERROR, there is no existing pre-release (see below)
Current version 1.0.0-RC.0 -> new pre-release is 1.0.1-RC.1

The bump function throws an error if there is no existing pre-release: „Cannot bump pre-release because the latest version is not a pre-release version. To create a new pre-release version, use newPreRelease instead“.

To create a new pre-release when the latest version is not a pre-release version or update a current pre-release version I would have to gather the latest version, check if it is a pre-release and then perform action accordingly. But this is something that the plugin could do in one step. Let’s say I had a property called „-PnewPreReleaseOrBumpPreRelease“, I would get the following behaviour:

Current version 1.0.0 -> pre-release is 1.0.1-RC.0
Current version 1.0.0-RC.0 -> pre-release is 1.0.0-RC.1
Current version 1.0.0-SNAPSHOT -> pre-release is 1.0.1-RC.0
Current version 1.0.0-RC.1 -> pre-release is 1.0.0-RC.2

Any thoughts?

I could create a pull request for this functionality.

@vivin
Copy link
Owner

vivin commented Jan 31, 2020

That's a good idea. Something like -PnewOrBumpPreRelease.

I can definitely look at a PR.

Sorry for the late response by the way. I'm working full-time and going to school so I haven't been able to give the project the attention it deserves.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants