Reputation: 495
I have a simple question. Is it possible to modify the gradle library build project specific and how?
Following example, I have a library that I use in multiple projects. Now I want to exclude some files in the library when I build Project_A.
But I want them included when I build Project_B.
I wonder if its possible to add parameters to the dependencies in the build.gradle file of Projekt_A. Something like:
dependencies {
compile project(':explore_layout',
//specify the exclude inside the lib
sourceSets {
main {
java {
exclude '**/uncompilable/**'
}
}
}
)
}
Upvotes: 1
Views: 194
Reputation: 38619
Make two source sets in your library project and then depend on the the according configurations that are added for the source sets. This way you can get only one source set for A
but both for B
.
Upvotes: 3