Elephant taming

- Enable parallel and caching args
- Modify tasks to support configuration cache
This commit is contained in:
IThundxr 2025-01-12 16:23:40 -05:00
parent d506625266
commit 88907795fe
Failed to generate hash of commit
2 changed files with 8 additions and 9 deletions

View file

@ -367,12 +367,10 @@ publishMods {
String calculateGitHash() {
try {
ByteArrayOutputStream stdout = new ByteArrayOutputStream()
exec {
def output = providers.exec {
commandLine("git", "rev-parse", "HEAD")
standardOutput = stdout
}
return stdout.toString().trim()
return output.standardOutput.asText.get().trim()
} catch(Throwable ignored) {
return "unknown"
}
@ -380,12 +378,10 @@ String calculateGitHash() {
boolean hasUnstaged() {
try {
ByteArrayOutputStream stdout = new ByteArrayOutputStream()
exec {
def output = providers.exec {
commandLine("git", "status", "--porcelain")
standardOutput = stdout
}
String result = stdout.toString().replace("/M gradlew(\\.bat)?/", "").trim()
String result = output.standardOutput.asText.get().replace("/M gradlew(\\.bat)?/", "").trim()
if (!result.isEmpty())
println("Found stageable results:\n ${result}\n")
return !result.isEmpty()

View file

@ -2,6 +2,9 @@
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
org.gradle.parallel = true
org.gradle.caching = true
org.gradle.configuration-cache = true
# mod version info
# build_info_mod_version is the version that gets filled into CreateBuildInfo.java