Gradle如何创建一个空的fileCollection?

时间:2017-07-27 16:20:41

标签: file gradle collections classpath

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

}

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

1 个答案:

答案 0 :(得分:4)

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

def emptyFileCollection = project.files([])
相关问题