axion-release-plugin icon indicating copy to clipboard operation
axion-release-plugin copied to clipboard

v1.10.0 - Correct Version Not Being Calculated

Open EarthCitizen opened this issue 6 years ago • 3 comments

axion-release-plugin: 1.10.0 Gradle: 4.10.2

Configuration:

buildscript {
  dependencies {
    classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.10.0'
  }
}

apply plugin: 'pl.allegro.tech.build.axion-release'

project.version = scmVersion.version

When executing the steps (below), as shown in the documentation (https://axion-release-plugin.readthedocs.io/en/latest/configuration/next_version/), the current version does not increment. Unlike the docs, the version stays the same.

 $ git tag

 $ git tag release-1.5.0

 $ git tag
release-1.5.0

 $ ./gradlew cV

> Task :currentVersion

Project version: 1.5.0

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ ./gradlew markNextVersion -Prelease.version=2.0.0

> Task :markNextVersion
Creating next version marker tag: release-2.0.0-alpha
Changes made to local repository only

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ git tag
release-1.5.0
release-2.0.0-alpha

 $ ./gradlew cV

> Task :currentVersion

Project version: 1.5.0

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ ./gradlew markNextVersion

> Task :markNextVersion
Creating next version marker tag: release-1.5.1-alpha
Changes made to local repository only

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ ./gradlew cV

> Task :currentVersion

Project version: 1.5.0

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ ./gradlew marNextVersion -Prelease.incrementer=incrementMinor

> Task :markNextVersion
Creating next version marker tag: release-1.6.0-alpha
Changes made to local repository only

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

 $ ./gradlew cV

> Task :currentVersion

Project version: 1.5.0

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

EarthCitizen avatar Dec 06 '18 03:12 EarthCitizen

This is actually sane behavior, I should probably change docs. With multiple tags on single commit, the logic gets a bit complicated, but is described in VersionSorter class and tests.

TL;DR - with multiple tags on one release commit and without -Prelease.forceSnapshot flag, release tag has precedence over next tags.

adamdubiel avatar Dec 06 '18 09:12 adamdubiel

OK. Then I think clarification in the docs would resolve this.

EarthCitizen avatar Dec 06 '18 18:12 EarthCitizen

I will keep this one open till I change the docs. Thanks!

adamdubiel avatar Dec 07 '18 07:12 adamdubiel