vlsi / vlsi-release-plugins

A set of plugins to simplify Gradle release tasks
Apache License 2.0
41 stars 13 forks source link

`GatherLicenseTask` is not compatible with configuration cache #90

Open DreierF opened 4 weeks ago

DreierF commented 4 weeks ago

The GatherLicenseTask is not compatible with Gradle's configuration cache.

val gatherLicense = tasks.register<com.github.vlsi.gradle.license.GatherLicenseTask>("gatherLicense") {
    configuration(project.configurations.runtimeClasspath)
}

Running it via ./gradlew gatherLicense --configuration-cache --configuration-cache-problems=warn results in:

Configuration cache state could not be cached: field `value` of `kotlin.InitializedLazyImpl` bean found in field `extraDeps$delegate` of task `:ide:cli:gatherLicense` of type `com.github.vlsi.gradle.license.GatherLicenseTask`: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration'
> Resolving dependency configuration 'gatherLicense_dependencies' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'gatherLicense_dependencies' should be resolved.
alexei-osipov commented 1 week ago

Also the plugin uses Gradle.addBuildListener API that is also unsupported for configuration cache.

See https://docs.gradle.org/8.10.2/userguide/configuration_cache.html#config_cache:requirements:build_listeners