Skip to content

Commit 0be5d73

Browse files
devondragonclaude
andcommitted
Fix debugCI task for configuration cache compatibility
Moved project object references outside doLast block to capture values at configuration time rather than execution time, resolving configuration cache incompatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b371bdd commit 0be5d73

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,25 +237,30 @@ tasks.register("publishLocal") {
237237

238238
// Debug task to help diagnose file issues in CI
239239
tasks.register("debugCI") {
240+
// Capture values at configuration time to be compatible with configuration cache
241+
def projectDir = project.projectDir.absolutePath
242+
def rootDirectory = rootDir.absolutePath
243+
def checkstyleFile = project.file("config/checkstyle/checkstyle.xml")
244+
def pmdFile = project.file("config/pmd/ruleset.xml")
245+
def configDir = project.file("config")
246+
240247
doLast {
241248
println "Working directory: ${System.getProperty('user.dir')}"
242-
println "Project directory: ${project.projectDir.absolutePath}"
243-
println "Root directory: ${rootDir.absolutePath}"
249+
println "Project directory: ${projectDir}"
250+
println "Root directory: ${rootDirectory}"
244251

245-
def checkstyleFile = project.file("config/checkstyle/checkstyle.xml")
246252
println "Checkstyle file exists: ${checkstyleFile.exists()}"
247253
if (checkstyleFile.exists()) {
248254
println "Checkstyle file path: ${checkstyleFile.absolutePath}"
249255
}
250256

251-
def pmdFile = project.file("config/pmd/ruleset.xml")
252257
println "PMD file exists: ${pmdFile.exists()}"
253258
if (pmdFile.exists()) {
254259
println "PMD file path: ${pmdFile.absolutePath}"
255260
}
256261

257262
println "Directory contents:"
258-
project.file("config").listFiles().each { file ->
263+
configDir.listFiles().each { file ->
259264
println " - ${file.name}"
260265
if (file.isDirectory()) {
261266
file.listFiles().each { subFile ->

0 commit comments

Comments
 (0)