gpt4 book ai didi

file - Gradle如何创建一个空的fileCollection?

转载 作者:行者123 更新时间:2023-12-03 02:44:05 25 4
gpt4 key购买 nike

def mergedCompileClasspath == null
project.sourceSets.each {
if (mergedCompileClasspath == null)
mergedCompileClasspath = it.compileClasspath
else
mergedCompileClasspath .plus(it.compileClasspath)

}

plus() 方法不起作用。 compileClassPath 是不可变的?如何创建一个空的fileCollection?

最佳答案

您可以调用 Project.files() 与空集合。

def emptyFileCollection = project.files([])

更新:

从 Gradle 5.3 开始,您还可以使用 ObjectFactory.fileCollection() 方法。
def emptyFileCollection = project.objects.fileCollection()

关于file - Gradle如何创建一个空的fileCollection?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45356165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com