Build: Use lazy from with trailing lambda in fromEmbeddedComponents

configurations shouldn't be resolved at project configuration step
This commit is contained in:
Vyacheslav Gerasimov
2018-04-18 17:05:58 +03:00
parent 49bb722f70
commit 3b472f4411
+9 -1
View File
@@ -112,6 +112,14 @@ fun AbstractCopyTask.fromEmbeddedComponents() {
if (this is ShadowJar) {
from(embeddedComponents)
} else {
embeddedComponents.forEach { from(if (it.isDirectory) it else project.zipTree(it)) }
dependsOn(embeddedComponents)
from {
embeddedComponents.map { file ->
if (file.isDirectory)
project.files(file)
else
project.zipTree(file)
}
}
}
}