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

please add ability to allocate a snapshot version with a dirty repo #17

Closed peterfigure closed 2 years ago

peterfigure commented 2 years ago

-Psemver.checkClean=false

JavierSegoviaCordoba commented 2 years ago

Fixed in https://github.com/JavierSegoviaCordoba/semver-gradle-plugin/commit/542d397f284a44268edebe526208c4ce9206b969

Set versions without timestamp on dirty repositories

By default, if the repository status is not clean, the version shows the timestamp but that can be avoided by setting the Gradle property semver.checkClean.

For example, if the last tag is 1.0.0, there are 23 commits between that tag and the last commit and the repo is not clean:

./gradlew "-Psemver.stage=final" "-Psemver.scope=patch"

semver: 1.0.0.23+2021-12-09T23-46-33-217289300Z
./gradlew "-Psemver.stage=final" "-Psemver.scope=patch" "-Psemver.checkClean=false"
semver: 1.0.1
./gradlew "-Psemver.checkClean=false"
semver: 1.0.0.23+1a2cd5b2 # 1a2cd5b2 is the last commit hash