Closed rivancic closed 1 month ago
I am not sure what you mean.
I have a project that uses prefixes and the output for
./gradlew printSemver -P semver.scope=minor -P semver.stage=snapshot -P semver.tagPrefix=p
is
> Task :hubdle-version-catalog:printSemver
semver for hubdle-version-catalog: c0.3.2.2+69f559a
> Task :hubdle-gradle-plugin:printSemver
semver for hubdle-gradle-plugin: p0.8.0-SNAPSHOT
> Task :printSemver
semver for hubdle: p0.8.0-SNAPSHOT
If you are referring to the project.version
, it will never show the tag prefix there, as it is invalid. I don't remember if Gradle crashes or if Maven Central publications will fail (I think this last one).
Is this expected? Then later I have to manually append tag prefix after extracting project version. Need to do a custom git tag push.
You shouldn't need to do any manual job.
Additionally, if you need to get the version, you can read it from a file that is already generated, for example:
The path would be: some-project/semver/version.txt
And the content:
0.8.0-SNAPSHOT
p0.8.0-SNAPSHOT
You can map the version too, but I don't recommend appending the tag prefix to project.version
.
Exactly I was referring to the project.version
Gradle property.
In current customized pipeline this value is being used as project version and it works fine it is without prefix
When I push tags with git tag
command in pipeline then I prepend proper prefix.
Thanks for the clarification.
Version generated with semver plugin isn't prefixed in the Gradle properties.
If I run following command
./gradlew properties -Psemver.scope=minor -Psemver.stage=snapshot -Psemver.tagPrefix=v
I even have
semver.tagPrefix=v
ingradle.properties
file set.The output is without the prefix in the version
Is this expected? Then later I have to manually append tag prefix after extracting project version. Need to do a custom git tag push.