Skip to content

Commit

Permalink
Use providers.exec
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Oct 1, 2022
1 parent 27e4bfd commit d8c3f9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/build-metadata.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.codehaus.groovy.runtime.ProcessGroovyMethods
import java.time.Instant
import java.time.OffsetDateTime
import java.time.ZoneOffset
Expand All @@ -22,6 +21,8 @@ val buildTimeAndDate =
val buildDate: String by extra { DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) }
val buildTime: String by extra { DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) }
val buildRevision: String by extra {
ProcessGroovyMethods.getText(ProcessGroovyMethods.execute("git rev-parse --verify HEAD"))
providers.exec {
commandLine("git", "rev-parse", "--verify", "HEAD")
}.standardOutput.asText.get()
}
val builtByValue by extra { project.findProperty("builtBy") ?: project.property("defaultBuiltBy") }

0 comments on commit d8c3f9d

Please sign in to comment.