I have a nasty problem with Gradle build and transitive resource files.
Let me explain in short.
Plugin X, creates its own configurations and a sourceSet:
// XPlugin.groovy
configurations {
batman
}
sourceSets {
batman {
scala { ... }
resources { ... }
}
}
Then it declares the output of main sourceSet as a dependency (!!!):
// XPlugin.groovy
dependencies {
batman sourceSets.main.output
batman sourceSets.test.output
}
Both batman and main source sets have logback.groovy in resources folder (which is a problem)
Then I apply this plugin:
// build.gradle
apply plugin: 'some.comapny:x-gradle-plugin:0.0.1'
Result: the logback.groovy from the main source set is taken by logback library in the end.
Is there an option in Gradle to remove the file that is not wanted here, basically the /main/resources/logback.groovy file?
PS I don’t need to build a jar out of batman sourceSet, it’s just a sourceSet runnable via Gradle, e.g.
gradle callBatman
PS tried to handle myself, didn’t succeed, google doesn’t help as well
Thanks for help in advance