shipkit / shipkit-auto-version

Gradle plugin that helps automating releases by automatically deducing the next Semver version
Apache License 2.0
42 stars 10 forks source link

Simplify getting previous revision #53

Closed shestee closed 3 years ago

shestee commented 3 years ago

This PR resolves https://github.com/shipkit/shipkit-auto-version/issues/52 To avoid unwanted complexity of getting project's previous version with shipkit-auto-version.previous-version property another property is exposed: shipkit-auto-version.previous-tag. Earlier to get previous revision (e.g. for generating chengelog with Shipkit Changelog plugin) concatenation and possible conditional had to be used. Now it requires just to refer to shipkit-auto-version.previous-tag alone. There is new field previousTag added in DeductedVersion class, which is initialized with value based on project's previous version. To initialize this field with proper value, existing TagConvention.tagFor() method is used, what provides fixed tag naming convention. These changes are covered with test in DeductedVersionTest (both happy and unhappy path when there is no previous version). Getting previous tag is covered with javadoc.