This message was deleted.
# configuration-cache
s
This message was deleted.
d
are you seeing this in your config-cache html file? Also sometimes, I see more errors in a build-scan.
e
is this an ad-hoc task that has
doFirst
or
doLast
blocks? I think the most likely case is that one of those is capturing the build script reference. but you should provide more details on how the task is created.
m
It's part of doLast doFirst, I have figured out that with build scan I get more info 🙂.
I already solved some of those
Okay I am stuck on those 😞
Copy code
val version = project.version
val staticResourceDirectory = project.fileTree("$buildDir/resources/main/static/")
tasks.processResources.configure {
    inputs.property("projectVersion", version)
    outputs.cacheIf { true }
    doLast {
        staticResourceDirectory.forEach {
            postProcessApiFile(it)
        }
    }
}
@ephemient Is this forbidden?
e
if
postProcessApiFile
is a function defined locally, yes it's forbidden
m
Copy code
val version = project.version
val staticResourceDirectory = project.fileTree("$buildDir/resources/main/static/").asFileTree
tasks.processResources.configure {
    inputs.property("projectVersion", version)
    outputs.cacheIf { true }
    doLast {
        staticResourceDirectory.forEach {
            //postProcessApiFile(it, version as String)
        }
    }
}
Even this does not work 🙂 .
Copy code
staticResourceDirectory
is the issue.
It is of type FileTree but it seems to be forbidden, commenting this reference removes the warning