From 2a7775529de6ff84cec5d62f0d82197d56bf023a Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sun, 26 Mar 2017 10:18:36 -0700 Subject: [PATCH] Fix log line. --- src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt index 3a57d564..b90c9f5a 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt @@ -51,11 +51,14 @@ class AptPlugin @Inject constructor(val dependencyManager: DependencyManager) override fun apply(project: Project, context: KobaltContext) { listOf(aptConfigs[project.name]?.outputDir, aptConfigs[project.name]?.outputDir) .filterNotNull() + .distinct() .map { generatedDir(project, it) } .forEach { - context.logger.log(project.name, 1, "Deleting " + it.absolutePath) - val success = it.deleteRecursively() - if (! success) warn(" Couldn't delete " + it.absolutePath) + it.normalize().absolutePath.let { path -> + context.logger.log(project.name, 1, " Deleting " + path) + val success = it.deleteRecursively() + if (!success) warn(" Couldn't delete " + path) + } } }