在我的 gradle.build 中,我有各种执行如下相同排除的库
androidTestCompile ('com.android.support.test:runner:0.5') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile ('com.android.support.test:rules:0.5') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile ('com.android.support.test.espresso:espresso-web:2.2.2') {
exclude group: 'com.android.support', module: 'support-annotations'
}
显然,每个人都在使用相同的排除
exclude group: 'com.android.support', module: 'support-annotations'
}
有没有一种方法,我只需要编写一次排除,然后应用于所有库(至少是那些我有兴趣执行排除的库)?
最佳答案
项目中的所有实例都有一个配置:
configurations.all { exclude ... }
关于android - 组合多个库以使用单个排除列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38318438/