Hi, I am trying to use gradle configuration cache ...
# configuration-cache
n
Hi, I am trying to use gradle configuration cache and it seems the kover plugin is not compatible. I get the error below: I tried adding the following to my root 
build.gradle.kts
 file but it still reports the same erorr:
Copy code
tasks.koverMergedHtmlReport {
    notCompatibleWithConfigurationCache("Not Sure")
}
Copy code
17 problems were found storing the configuration cache, 7 of which seem unique.
- Task `:koverMergedHtmlReport` of type `kotlinx.kover.tasks.KoverMergedHtmlReportTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverMergedVerify` of type `kotlinx.kover.tasks.KoverMergedVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverMergedXmlReport` of type `kotlinx.kover.tasks.KoverMergedXmlReportTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverVerify` of type `kotlinx.kover.tasks.KoverVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:utils:common:koverVerify` of type `kotlinx.kover.tasks.KoverVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:utils:common:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
- Task `:utils:common:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
Using Gradle 7.4
r
This seems like an issue on Jetbrains's side, you're probably better served by the Kotlin slack, there's a #code-coverage channel. Unless this is about the "incremental" configuration cache feature.
p
notCompatibleWithConfigurationCache()
will make the problems to not fail the build and disable CC but the problems are still reported
koverMergedHtmlReport
is not the only task that has problems, you should mark the others as not compatible
n
Thanks
I added the following but it still fails the build
Copy code
listOf(
    ":koverMergedHtmlReport",
    ":koverMergedXmlReport",
    ":koverVerify",
    ":utils:common:koverVerify",
    ":utils:common:test",
).forEach {
    tasks.getByPath(it).notCompatibleWithConfigurationCache("Don't know")
}
looks like I missed one!
:koverMergedVerify
perhaps the error message should specify which problems were ignored and which weren’t.
I filed a feature request with Kover: https://github.com/Kotlin/kotlinx-kover/issues/142
👍 2