Skip to content

Commit d8c3f9d

Browse files
committed
Use providers.exec
1 parent 27e4bfd commit d8c3f9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildSrc/src/main/kotlin/build-metadata.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import org.codehaus.groovy.runtime.ProcessGroovyMethods
21
import java.time.Instant
32
import java.time.OffsetDateTime
43
import java.time.ZoneOffset
@@ -22,6 +21,8 @@ val buildTimeAndDate =
2221
val buildDate: String by extra { DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) }
2322
val buildTime: String by extra { DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) }
2423
val buildRevision: String by extra {
25-
ProcessGroovyMethods.getText(ProcessGroovyMethods.execute("git rev-parse --verify HEAD"))
24+
providers.exec {
25+
commandLine("git", "rev-parse", "--verify", "HEAD")
26+
}.standardOutput.asText.get()
2627
}
2728
val builtByValue by extra { project.findProperty("builtBy") ?: project.property("defaultBuiltBy") }

0 commit comments

Comments
 (0)