0

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.

1 Answer 1

1

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 } } } 
Sign up to request clarification or add additional context in comments.

Comments