Marc Reichelt
01/28/2019, 12:44 PMConfiguration
class does not have an isDirectory
property - but how could the Groovy code then work in the first place?Dominaezzz
01/28/2019, 1:45 PMMarc Reichelt
01/28/2019, 1:47 PMConfiguration
to a File
?Dominaezzz
01/28/2019, 1:50 PMprintln()
to check and then cast to the expected type with as
.Marc Reichelt
01/28/2019, 1:55 PMfrom(configurations.compile.map { configuration ->
var finalFileTree: FileCollection = files().asFileTree
configuration.asFileTree.forEach {
if (it.isDirectory.not()) {
finalFileTree = finalFileTree.plus(zipTree(it))
}
}
finalFileTree
})
from(configurations.compile.map { configuration ->
configuration.asFileTree
.fold(files().asFileTree) { collection, file ->
if (file.isDirectory) collection else collection.plus(zipTree(file))
}
})
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})