Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Sanitizing the Git Version for Correct Snapshot Publishing (#5357)
Browse files Browse the repository at this point in the history
* circleci update

* corner cases:

* test

* hack

* hack

* fix extra line

* don't need that

* this way is safer

* fix
  • Loading branch information
jeremyk-91 committed Sep 21, 2021
1 parent 33390a9 commit b8a6e82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ apply plugin: 'com.palantir.external-publish'
apply from: 'gradle/versions.gradle'

group = 'com.palantir.atlasdb'
version = gitVersion()
version = sanitizeVersion()
description = 'Transactional distributed database layer'

def sanitizeVersion() {
def isClean = "git status --porcelain".execute().text.isEmpty()
def pluginReportedVersion = gitVersion()

if (isClean && pluginReportedVersion.endsWith(".dirty")) {
return pluginReportedVersion.dropRight(".dirty".length())
}
return pluginReportedVersion
}

task printLastVersion {
doLast {
def details = versionDetails()
Expand Down

0 comments on commit b8a6e82

Please sign in to comment.