mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-30 05:40:34 +00:00
30 lines
672 B
Kotlin
30 lines
672 B
Kotlin
package com.dfsek.terra
|
|
|
|
import org.gradle.api.Project
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
fun Project.configureCommon() {
|
|
configureDependencies()
|
|
configureCompilation()
|
|
configureDistribution()
|
|
|
|
version = rootProject.version
|
|
}
|
|
|
|
fun Project.getGitHash(): String {
|
|
val stdout = ByteArrayOutputStream()
|
|
exec {
|
|
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
|
|
standardOutput = stdout
|
|
}
|
|
return stdout.toString().trim()
|
|
}
|
|
|
|
fun Project.gitClone(name: String) {
|
|
val stdout = ByteArrayOutputStream()
|
|
exec {
|
|
commandLine = mutableListOf("git", "clone", name)
|
|
standardOutput = stdout
|
|
}
|
|
}
|