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() { String calculateGitHash() {
try { try {
ByteArrayOutputStream stdout = new ByteArrayOutputStream() def output = providers.exec {
exec {
commandLine("git", "rev-parse", "HEAD") commandLine("git", "rev-parse", "HEAD")
standardOutput = stdout
} }
return stdout.toString().trim() return output.standardOutput.asText.get().trim()
} catch(Throwable ignored) { } catch(Throwable ignored) {
return "unknown" return "unknown"
} }
@ -380,14 +378,12 @@ String calculateGitHash() {
boolean hasUnstaged() { boolean hasUnstaged() {
try { try {
ByteArrayOutputStream stdout = new ByteArrayOutputStream() def output = providers.exec {
exec {
commandLine("git", "status", "--porcelain") 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()) if (!result.isEmpty())
println("Found stageable results:\n${result}\n") println("Found stageable results:\n ${result}\n")
return !result.isEmpty() return !result.isEmpty()
} catch(Throwable ignored) { } catch(Throwable ignored) {
return false return false

View file

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