Skip to content

Commit a9cd1ff

Browse files
committed
Enable the Gradle configuration cache and configuration on demand
1 parent c5d379c commit a9cd1ff

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'net.neoforged.moddev' version '2.0.141'
33
id 'net.darkhax.curseforgegradle' version '1.1.28'
44
id 'com.github.kt3k.coveralls' version '2.12.0'
5-
id 'com.diffplug.spotless' version '6.25.0'
5+
id 'com.diffplug.spotless' version '7.2.1'
66
id 'com.gradleup.shadow' version '8.3.8'
77
id 'com.modrinth.minotaur' version '2.+'
88
}
@@ -70,9 +70,13 @@ def getChangelog() {
7070
if (System.getenv().RELEASE) {
7171
return file("./CHANGELOG-${project.minecraft_version}.md").getText();
7272
} else {
73-
// Check if any release tag exists for this Minecraft version
74-
def proc = ['git', 'tag', '--list', "${project.minecraft_version}-*"].execute([], project.rootProject.projectDir)
75-
def tags = proc.text.trim()
73+
// Check if any release tag exists for this Minecraft version.
74+
// Uses providers.exec so the process is not started during configuration,
75+
// which would be incompatible with the configuration cache.
76+
def tags = providers.exec {
77+
workingDir = project.rootProject.projectDir
78+
commandLine 'git', 'tag', '--list', "${project.minecraft_version}-*"
79+
}.standardOutput.asText.get().trim()
7680
if (tags) {
7781
return "Changes since last release: ${project.github_url}/compare/${project.minecraft_version}-${project.mod_version}...${System.getenv().GITHUB_SHA}"
7882
} else {
@@ -380,7 +384,7 @@ spotless {
380384
endWithNewline()
381385
trimTrailingWhitespace()
382386
removeUnusedImports()
383-
indentWithSpaces()
387+
leadingTabsToSpaces()
384388
}
385389
}
386390

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ neoforge_update_json_url=https://raw.githubusercontent.com/CyclopsMC/Versions/ma
2525

2626
# Gradle
2727
org.gradle.jvmargs=-Xmx3G
28-
org.gradle.daemon=false
28+
org.gradle.daemon=true
2929
org.gradle.caching=true
30+
org.gradle.configuration-cache=true
31+
org.gradle.configureondemand=true
3032

3133
# Dependencies
3234
cyclopscore_version=1.29.5-1012

0 commit comments

Comments
 (0)