Restore modded jar incrementality

- Drop outputs.upToDateWhen and outputs.cacheIf from the loader jar Exec tasks
- Declare lombok.config, core/agent and both revision scripts as modded inputs
This commit is contained in:
Brian Neumann-Fopiano
2026-09-08 03:40:40 -04:00
parent 6e3e1f3c64
commit 0bdacc6fed
+10 -6
View File
@@ -227,9 +227,10 @@ tasks.register('buildBukkit', Copy) {
}
}
// The three loader jars come out of nested standalone Gradle builds driven through Exec. Their own
// Gradle builds own the complete incremental model, so always launch them instead of allowing an
// incomplete outer input inventory to publish stale jars.
// The three loader jars come out of nested standalone Gradle builds driven through Exec. The outer
// task therefore has to carry the full inventory of what those builds read: every shared source tree,
// every build script and version file they load, and the local VolmLib checkout when the composite
// resolves one. Anything missing from that list publishes a stale jar.
Closure<File> resolveLocalVolmLibDirectory = { ->
String configured = localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()
? localVolmLibDirectory
@@ -262,13 +263,18 @@ List<Object> moddedSharedInputs = []
'adapters/client-common/src',
'core/src/main',
'core/build.gradle',
'core/agent/src',
'core/agent/build.gradle',
'spi/src/main',
'spi/build.gradle',
'build.gradle',
'settings.gradle',
'gradle.properties',
'lombok.config',
'gradle/libs.versions.toml',
'gradle/volmlib-resolution.settings.gradle'
'gradle/volmlib-resolution.settings.gradle',
'gradle/generation-build-revision.gradle',
'gradle/modded-generation-build-revision.gradle'
].each { String path -> moddedSharedInputs.add(layout.projectDirectory.file(path).asFile) }
File localVolmLibCheckout = useLocalVolmLib.equalsIgnoreCase('true') ? resolveLocalVolmLibDirectory() : null
if (localVolmLibCheckout != null) {
@@ -287,8 +293,6 @@ Closure<Void> declareModdedJarIo = { Exec task, String adapter, String artifactN
task.inputs.property('volmLibCoordinate', volmLibCoordinate)
task.inputs.property('localVolmLibCheckout', localVolmLibCheckout == null ? '' : localVolmLibCheckout.absolutePath)
task.outputs.file(layout.projectDirectory.file("adapters/${adapter}/build/libs/${artifactName}"))
task.outputs.upToDateWhen { false }
task.outputs.cacheIf { false }
return null
}