vivin / gradle-semantic-build-versioning

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

specify bump up minor by default #89

Closed DemianTinkiel closed 6 years ago

DemianTinkiel commented 6 years ago

I would like to do something like

autobump {
    majorPattern = ~/(?m)^\[major-release\]$/
    patchPattern = ~/(?m)^hotfix$/
}
> > 1: git commit -m "normal stuff" -> v1.1.0 > 2: git commit -m "hotfix" -> v1.1.1 > 3: git commit -m "[major-release]" -> v2.1.1 but when I do case 1 I get a bump in patch component, not minor
vivin commented 6 years ago

@DemianTinkiel You'd have to set a pattern that matches anything except hotfix or [major-release] for minorPattern I would think.

DemianTinkiel commented 6 years ago

Hi @vivin Yeah that was my first thought. Perhaps my regex foo is not as strong as I thought

    majorPattern = ~/(?m)^\[major-release\]$/
    patchPattern = ~/(?m)^hotfix$/
    minorPattern = ~/^(?!(.*(hotfix|\[major-release\]).*))$/

1: git commit -m "normal stuff" gives me v1.0.1 and I expected v1.1.0

vivin commented 6 years ago

Perhaps ~/^(?!.*(hotfix|\[major-release\]))/?

Nols1000 commented 6 years ago

For me this regex works great you could change it for your use case:

minorPattern = ~/(?m)^(?!(.*(\[bump-major\]|\[bump-patch\]|\[make-new-pre-release\]|\[promote-to-release\]).*)$).*$/
vivin commented 6 years ago

@DemianTinkiel Did this fix your issue?

DemianTinkiel commented 6 years ago

@vivin sorry for the really late reply. Yes issue fixed