Reputation: 227
I have a dependency that I need removed from all modules of my application (10 modules), except for one.
In the top level build.gradle file, I have:
configurations.all { exclude group: 'com.nasty', module: 'nasty-dependency' }
Is there an easy way to express that for modules A thru I, I want to exclude this dependency, but in module J include it?
Thanks.
Upvotes: 0
Views: 829
Reputation: 27984
Off the top of my head
[':A', ':B', ':C'].each {
project(it).configurations.all { exclude group: 'com.nasty', module: 'nasty-dependency }
}
Or maybe
allprojects {
if (path !=':X') {
configurations.all { exclude group: 'com.nasty', module: 'nasty-dependency }
}
}
Upvotes: 1