mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-05-20 00:30:20 +00:00
build: address review comments
This commit is contained in:
@@ -2,26 +2,20 @@ import java.io.ByteArrayOutputStream
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.support.serviceOf
|
||||
import org.gradle.process.ExecOperations
|
||||
|
||||
|
||||
var isPrerelease = false
|
||||
|
||||
|
||||
fun Project.getGitHash(): String {
|
||||
val stdout = ByteArrayOutputStream()
|
||||
serviceOf<ExecOperations>().exec {
|
||||
return providers.exec {
|
||||
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}.standardOutput.asText.get().trim()
|
||||
}
|
||||
|
||||
fun Project.gitClone(name: String) {
|
||||
val stdout = ByteArrayOutputStream()
|
||||
serviceOf<ExecOperations>().exec {
|
||||
providers.exec {
|
||||
commandLine = mutableListOf("git", "clone", name)
|
||||
standardOutput = stdout
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user