I am trying to declare a compile dependency in Gradle 1.12, with multiple items that shares the same exclude clauses (this is to avoid repeating the exclusion everywhere). I know I can do something like this:
configurations {
compile.exclude group: 'com.google.gwt'
all*.exclude group: 'com.google.guava'
}
but this will affect ALL configurations. What I want is something like this (which does not work in Gradle 1.12 as written below):
compile (
["org.jboss.errai:errai-data-binding:2.4.4.Final"]
,["org.jboss.errai:errai-data-ioc:2.4.4.Final"]
){
exclude group: 'com.google.gwt'
exclude group: 'com.google.guava'
}
so I can gather together all dependencies for which I need exclusion in one place, and still be able to have elsewhere this:
compile 'com.google.guava:guava:17.0'
Update: Just to clarify, my only goal is to replace this piece of code:
compile ('bla.bla.bla:1.0'){
exclude 'same.component:1.0' //Ugly repeat
}
compile ('boo.boo.boo:1.0'){
exclude 'same.component:1.0' //Ugly repeat
}
compile ('uh.uh.uh:1.0'){
exclude 'same.component:1.0' //Ugly repeat
}
compile ('oh.oh.oh:1.0'){
exclude 'same.component:1.0' //Ugly repeat
}
with something short and sweet like this (not working currently):
compile( 'bla.bla.bla:1.0'
,'boo.boo.boo:1.0'
,'uh.uh.uh:1.0'
,'oh.oh.oh:1.0'
)
{
exclude 'same.component:1.0' //Only once! Sweet!
}