Skip to content

Commit

Permalink
build(version): If on a pre-release, use the SemVer with SHA1 metadata
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
sschuberth committed Oct 4, 2023
1 parent fbf96b9 commit 311ab74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ semver {

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

logger.lifecycle("Building ORT version $version.")
Expand Down

0 comments on commit 311ab74

Please sign in to comment.