配置中的all * .exclude和all.exclude有什么区别

编程入门 行业动态 更新时间:2024-10-27 21:15:22
本文介绍了配置中的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有什么区别

本文发布于:2023-11-23 19:25:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622606.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   exclude

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!