Hi, does anyone know how to recover a configuration file without using the function afterEvaluate
Here is my plugin
class MyPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.plugins.apply(JavaLibraryPlugin::class.java)
val pluginExtension= project.configurations.create("thrift")
project.afterEvaluate {
project.configuraThrift(pluginExtension)
}
}
When I try without afterEvaluate
class MyPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.plugins.apply(JavaLibraryPlugin::class.java)
project.plugins.apply(MavenPublishPlugin::class.java)
val pluginExtension= project.configurations.create("thrift")
project.configuraThrift(pluginExtension)
}
}
I have following error
* What went wrong:
A problem occurred evaluating script.
> Cannot change resolution strategy of dependency configuration ':thrift' after it has been resolved.
Because if that is all, you miss half of the parts and have errors.
You request “true” and your transformation transforms from “true” to “false”.
So even if you would set the attribute on the jar artifacts as in the documentation, the transform would never trigger.
Currently you request “true” and get the jars because they do not have the attribute at all and absent is compatible to any value.