配置中的all * .exclude和all.exclude有什么区别 [英] What's the different between all*.exclude and all.exclude in configurations.all

查看:2833
本文介绍了配置中的all * .exclude和all.exclude有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道当您想排除依赖项时,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.names

OR

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有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆