Closed jrodbx closed 1 year ago
+1 Would love to have this fixed.
Pull requests are always welcomed!
I did try it, but I failed.
First try was to get rid of the project
property during TaskAction and use injection to get the properties.
internal open class LicenseeTask @Inject constructor(
private val objects: ObjectFactory,
private val dependencies: DependencyFactory,
private val configurations: ConfigurationContainer,
): DefaultTask() {
With the current implementation we need to use a ConfigurationContainer to call detachedConfiguration to add a dependency to the pom file. But this container is not compatible with the configuration cache:
⌄ task:licensee📋 of type app.cash.licensee.LicenseeTask📋
⌄ fieldconfigurations📋 of app.cash.licensee.LicenseeTask📋
■⚠️cannot serialize object of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer📋, a subtype of org.gradle.api.artifacts.ConfigurationContainer📋, as these are not supported with the configuration cache.
And according to the docs, these types won't be supported: https://docs.gradle.org/7.5.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
These types fall into some categories as follows:
- Dependency management types
In all cases the reason these types are disallowed is that their state cannot easily be stored or recreated by the configuration cache.
We are seeing type
app.cash.licensee.LicenseeTask: invocation of 'Task.project' at execution time is unsupported.
error with Gradle 8.1, seems to work with Gradle 8.0.2. Anyone else seeing the issue?
While I think, this is an upstream issue, I fixed this in #189.
Just curious, how do you use licensee? KGP does not support 8.1 yet.
Looks like the recursive traversal of loadPomInfo is the root cause:
https://github.com/cashapp/licensee/blob/trunk/src/main/kotlin/app/cash/licensee/task.kt#L136
https://github.com/cashapp/licensee/blob/trunk/src/main/kotlin/app/cash/licensee/dependencyGraph.kt#L247