Eric VANTILLARD
03/26/2025, 8:53 AMFAILURE: Build failed with an exception.
* What went wrong:
Configuration cache problems found in this build.
1 problem was found storing the configuration cache.
- Task `:list:checkReproCase` of type `org.gradle.api.DefaultTask`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
See <https://docs.gradle.org/8.11.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
The error complains about a GradleScript
reference see UnsupportedTypesCodecs.kt#L93
Gradle version 8.13
,8.11.1
Reprocase :
val checkReproCase by tasks.registering(Task::class) {
doLast {
logReproCase(logger)
}
}
private fun logReproCase(logger:Logger) {
logger.info("reprocase")
}
tasks.check {
dependsOn(checkReproCase)
}
Philip W
03/26/2025, 10:12 AMproject.logger
implicitly during runtime and any project access is not allowed at runtime.
val checkReproCase by tasks.registering(Task::class) {
val logger = logger
doLast {
logReproCase(logger)
}
}
Eric VANTILLARD
03/26/2025, 10:15 AMval checkReproCase by tasks.registering(Task::class) {
val loggerRef = logger
doLast {
logReproCase(loggerRef)
}
}
private fun logReproCase(loggerParam:Logger) {
<http://loggerParam.info|loggerParam.info>("reprocase")
}
tasks.check {
dependsOn(checkReproCase)
}
Vampire
03/26/2025, 11:47 AMlogger
. You call a function that you defined in the script. So to call that function you need the reference to that script instance and that is what it complains about.Eric VANTILLARD
03/26/2025, 5:06 PMEric VANTILLARD
03/31/2025, 8:03 AM