2017-07-27 65 views
0
def mergedCompileClasspath == null 
project.sourceSets.each { 
     if (mergedCompileClasspath == null) 
      mergedCompileClasspath = it.compileClasspath 
     else  
      mergedCompileClasspath .plus(it.compileClasspath) 

} 

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

回答

0

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

def emptyFileCollection = project.files([])