Skip to content

Commit 311ab74

Browse files
committed
build(version): If on a pre-release, use the SemVer with SHA1 metadata
This results the version string for a non-tagged commit to be something like `3.0.0-SNAPSHOT+032.sha.2ad228b`. The version string for a tagged commit is not affected. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent fbf96b9 commit 311ab74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ semver {
4343

4444
// Only override a default version (which usually is "unspecified"), but not a custom version.
4545
if (version == Project.DEFAULT_VERSION) {
46-
version = semver.version
46+
version = semver.semVersion.takeIf { it.isPreRelease } ?: semver.version
4747
}
4848

4949
logger.lifecycle("Building ORT version $version.")

0 commit comments

Comments
 (0)