Skip to content

Commit

Permalink
update commandLines
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjenx committed Jul 26, 2024
1 parent c75416d commit a7d7c2c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,18 @@ publishing {
}

@Suppress("UnstableApiUsage")
val gitCurrentTag = providers.exec {
commandLine("git", "describe", "--tags", "`git rev-list --tags --max-count=1`")
private val gitRevListTags = providers.exec {
commandLine("git", "rev-list", "--tags", "--max-count=1")
}.standardOutput.asText.map { it.trim() }

@Suppress("UnstableApiUsage")
private val gitCurrentTag = providers.exec {
commandLine("git", "describe", "--tags", gitRevListTags.get())
}.standardOutput.asText.map { it.trim() }

// get git shortSha for version
@Suppress("UnstableApiUsage")
val gitSha = providers.exec { commandLine("git", "rev-parse", "--short", "HEAD") }
private val gitSha = providers.exec { commandLine("git", "rev-parse", "--short", "HEAD") }
.standardOutput.asText.map { it.trim() }

mavenPublishing {
Expand Down

0 comments on commit a7d7c2c

Please sign in to comment.