Hi,
I’ve created a task that depends on the ‘jar’ task. Then I made it available to all subprojects with a java plugin enabled like:
subprojects {
plugins.withType(JavaPlugin) {
task javaDist(dependsOn: 'jar') { }
}
}
It works fine, but i wanted to move it into the separate script, so I’ve made a corrections:
subprojects {
plugins.withType(JavaPlugin) {
apply from: "$rootDir/buildSrc/unemDist.gradle"
}
}
And I am getting the following error:
* What went wrong:
A problem occurred evaluating project ':bp'.
> Failed to apply plugin [id 'org.gradle.java']
> java.util.LinkedHashMap cannot be cast to org.gradle.api.internal.project.ProjectInternal
If I move the ‘apply from’ outside the filtering closure it works fine.
Thanks !