使用
使用
>我想知道 all*.exclude 和 all.exclude 在配置中到底有什么区别。all 当你想排除依赖关系时
configurations.all {
all.exclude
all*.exclude group: 'org.json', module: 'json'
}
正确的语法是:
使用all
方法
configurations.all {
exclude group: 'org.json', module: 'json'
}
或
使用all
属性
configurations {
all*.exclude(group: 'org.json', module: 'json')
}
all
属性包含项目configurations
中所有configuration
对象的列表。
如果你想看看它实际包含什么,你可以做:
println configurations.all.names
或
println configurations.all*.name
语法*.
是一个时髦的特定运算符,称为 spread 运算符。您可以阅读它是如何工作的,以了解它为什么在这里起作用。