JavierSegoviaCordoba / semver-gradle-plugin

Set projects versions based on git tags and following semantic versioning
https://semver-gradle-plugin.javiersc.com
Other
25 stars 3 forks source link

Project properties semver.project.tagPrefix #159

Closed rivancic closed 1 month ago

rivancic commented 2 months ago

I was trying to set tag prefix property as following inside of the gradle.properties file:

semver.tagPrefix=v

As its documented in README.md file https://github.com/JavierSegoviaCordoba/semver-gradle-plugin/tree/main?tab=readme-ov-file#usage

While this doesn't work.

Then I found (forgot where) the reference to semver.project.tagPrefix which actually does set the expected configuration. So documentation in README should be updated to reflect the correct properties that should be set.

JavierSegoviaCordoba commented 2 months ago

Hello 👋

I think you are looking for this:

https://github.com/JavierSegoviaCordoba/semver-gradle-plugin/blob/0ba9c8689bda6aed5847ff29addfe2139d9fc249/README.md?plain=1#L137

Both properties are used by the plugin; one is used to indicate which tag you are referencing in order to upgrade the version, and the one you mention that is used to indicate which is the tag associated to the project.

rivancic commented 1 month ago

Thanks for the prompt response 💯

What is then the concrete difference between the two. Its confusing. Until now I was used to use only one prefix per project. And with it it doesn't make sense to use different prefix tag to upgrade version if we have specific one set for the project

say for project we set semver.project.tagPrefix=v

in what case would it make sense to explicitly set semver.tagPrefix=x

Or expressing it in another way if semver.project.tagPrefix=v is set then the semver.tagPrefix should default to the value of semver.project.tagPrefix by default.

JavierSegoviaCordoba commented 1 month ago

Imagine the next scenario:

All projects are on the version 1.0.0.

The semver.tagPrefix is usted to indicate which tag prefix will be upgraded:

./gradlew printSemver -P semver.tagPrefix=w -P semver.scope=patch`

All project will show the version 1.0.0 except the project-b which is using the tag prefix w, so it will show the version 1.0.1.

rivancic commented 1 month ago

Advanced configuration options. Luckily for me all modules have same prefix and version for now. Still have to do some tweaking of the Jenkins pipeline will let you know if everything works as expected at the end. BTW switched to this plugin after I couldn't figure our how to properly setup https://github.com/jgitver/gradle-jgitver-plugin to my needs. And your plugin is up to date And you respond super fast.

JavierSegoviaCordoba commented 1 month ago

You can set both properties to use the v prefix in the root gradle.properties so you can forget about anything related to the prefix.