dwursteisen
04/12/2019, 2:27 PMJar
task that will use all dependencies :
val dist = project.tasks.create("dist", Jar::class.java) {
from(configurations.runtime.map { if (it.isDirectory) it else zipTree(it) })
}
But I got an error:
from(configurations.runtime.map { if (it.isDirectory) it else zipTree(it) })
^ Unresolved reference: isDirectory
If I’m printing the configuration (println(configurations.runtime.javaClass)
), I got that: class org.gradle.api.internal.DefaultNamedDomainObjectCollection$ExistingNamedDomainObjectProvider_Decorated
I would expect something like FileCollection
or Configuration
. What I’m doing wrong? 🤔snowe
04/12/2019, 2:29 PMNamedDomainObjectCollection
require you to retrieve the object from the collection before calling stuff on itdwursteisen
04/12/2019, 2:49 PMfrom(configurations.runtime.get().map { … })
works 👍