我想知道当您想排除依赖项时,all..exclude和all.exclude在configuration.all中到底有什么区别
I want to know what exactly different between all*.exclude and all.exclude in configurations.all when you want to exclude dependencies
configurations.all { all.exclude all*.exclude group: 'org.json', module: 'json' }推荐答案
正确的语法是:
configurations.all { exclude group: 'org.json', module: 'json' }OR
configurations { all*.exclude(group: 'org.json', module: 'json') }all属性包含所有 configuration 对象. gradle.api.Project:configurations"rel =" nofollow noreferrer> configurations .
The all property holds a list of all configuration objects within the project configurations.
如果要查看其实际包含的内容,可以执行以下操作:
If you want to see what it actually it contains you can do:
println configurations.all.namesOR
println configurations.all*.name并且语法*.是特定于Groovy的运算符,称为传播运算符.您可以阅读该方法的工作原理,以了解其在这里的工作原理.
And the syntax *. is a groovy specific operator called the spread operator. You can read how that works to understand why it worked here.
更多推荐
配置中的all * .exclude和all.exclude有什么区别
发布评论