vivin / gradle-semantic-build-versioning

Gradle plugin to generate version-numbers and tags using semantic versioning
MIT License
85 stars 32 forks source link

Tag SNAPSHOT versions #113

Open ryantoussaint opened 4 years ago

ryantoussaint commented 4 years ago

We would like to be able to tag versions that have -SNAPSHOT in them.

For example, if the current version is 1.5.1-SNAPSHOT and we make some new changes, we would like to increment the next version to 1.5.2-SNAPSHOT. Is this possible?

The closest we've gotten is using ./gradlew tag -P bumpComponent=patch -P release but this removes the -SNAPSHOT suffix.

The other issue (which may be related) that we've seen is when the current version ends in -SNAPSHOT, and gradle builds the project, it fails with:

FAILURE: Build failed with an exception.

* What went wrong:
Cannot bump version because the latest version is '1.5.1-SNAPSHOT', which contains pre-release identifiers. However, no preRelease configuration has been specified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

What should the preRelease configuration be to bump the patch value and keep the -SNAPSHOT? We've seen in the documentation with alpha example but wanted to modify for SNAPSHOT.

Thanks!

vivin commented 4 years ago

SNAPSHOTs identify local versions that haven't been released. Basically it's a transient, constantly changing version that you really aren't going to release.

Tags also identify unique versions of the software, so what would distinguish a 1.2.3-SNAPSHOT on your machine, from one on mine?

Instead of SNAPSHOT what you could do is use pre-release versions. Maybe something like "UNSTABLE". But you would still need another suffix that you could increment.