def mergedCompileClasspath == null
project.sourceSets.each {
if (mergedCompileClasspath == null)
mergedCompileClasspath = it.compileClasspath
else
mergedCompileClasspath .plus(it.compileClasspath)
}
The plus() method is not working. compileClassPath is immutable? How to create an empty fileCollection?
You can call Project.files()
with an empty collection.
def emptyFileCollection = project.files([])
Update:
As of Gradle 5.3 you can also use the ObjectFactory.fileCollection()
method.
def emptyFileCollection = project.objects.fileCollection()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With