What's the different between all*.exclude and all.exclude in configurations.all

核能气质少年 提交于 2020-01-29 21:29:11

问题


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'
}

回答1:


The correct syntax is:

Using the all method

configurations.all {
    exclude group: 'org.json', module: 'json'
}

OR

Using the all property

configurations {
    all*.exclude(group: 'org.json', module: 'json')
}

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.names

OR

println configurations.all*.name

And the syntax *. is a groovy specific operator called the spread operator. You can read how that works to understand why it worked here.



来源:https://stackoverflow.com/questions/57506009/whats-the-different-between-all-exclude-and-all-exclude-in-configurations-all

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!