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

Where does currentVersion come from ?

Open Calin-Cosma opened this issue 2 years ago • 5 comments

version=0.0.1-SNAPSHOT in gradle.properties is ignored

currentVersion returns 0.1.0-SNAPSHOT, but I have no idea where that's coming from.

There is no such tag on the repo.

''' $ git tag 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 '''

How can I configure it to use either the value in gradle.properties, or from build.gradle (and have it automatically increased when released) ?

Thank you.

Calin-Cosma avatar Aug 31 '22 10:08 Calin-Cosma

hi, it's starting (first) version because no tag prefixed with "v" is found. Axion is based on git tags only ;)

bgalek avatar Aug 31 '22 11:08 bgalek

@bgalek Thanks for the answer. Is there a way to explicitly define the version ? Like in gradle.properties ?

I would expect the plugin to automatically increase that version on release.

Calin-Cosma avatar Aug 31 '22 13:08 Calin-Cosma

@Calin-Cosma You need to decide how do you want your workflow to work ;) If you're use this plugin you will need to stick with git tags, you can reference them in your build.gradle file with project.version = scmVersion.version. Plugin will increase this version on realise (and add a git tag to remember what version was the last one) see https://axion-release-plugin.readthedocs.io/en/latest/configuration/basic_usage/#single-module-project

bgalek avatar Sep 01 '22 12:09 bgalek

@bgalek I did notice a weird issue after upgrading to newer version of the plugin that feels like a bug. In my project - we do have existing tags/releases that have a different prefix than v - instead they are prefixed with release-. Plugin allows to configure this by setting

scmVersion.tag.prefix="release-"

This works fine for the release task - the version is increased properly and proper tag is pushed to the repo. But the currentVersion task does not seem to respect that and it returns completely different/unrelated version (the 0.1.0 one to be exact - aka the default one when nothing can be detected I assume?)

sycyhy avatar Sep 06 '22 16:09 sycyhy

Hi! Could you setup a GitHub repo as a proof of bug? You know simplest example - just to be sure that is not configuration related? After confirming a bug it should be easy to fix it and write a regression test :)

bgalek avatar Sep 06 '22 17:09 bgalek