From 0118e71b4f4030c2f0e50e08b8123dddca0f66a4 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 26 Nov 2015 20:18:39 -0800 Subject: [PATCH] Skip install if there's nothing to install. --- .../beust/kobalt/plugin/packaging/PackagingPlugin.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt index 7964e172..16424817 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt @@ -264,15 +264,14 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana @Task(name = PackagingPlugin.TASK_INSTALL, description = "Install the artifacts", runAfter = arrayOf(PackagingPlugin.TASK_ASSEMBLE)) fun taskInstall(project: Project) : TaskResult { - val config = configurationFor(project) - if (config != null) { - val buildDir = project.projectProperties.getString(LIBS_DIR) + val config = configurationFor(project) ?: InstallConfig() + val buildDir = project.projectProperties.getString(LIBS_DIR) + val buildDirFile = File(buildDir) + if (buildDirFile.exists()) { log(1, "Installing from $buildDir to ${config.libDir}") val toDir = KFiles.makeDir(config.libDir) - KFiles.copyRecursively(File(buildDir), toDir) - } else { - log(1, "No install specified for ${project.name}, nothing to do") + KFiles.copyRecursively(buildDirFile, toDir) } return TaskResult()