diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 842b3300..401bc33c 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.72 \ No newline at end of file +kobalt.version=1.0.73 diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt index 065e5ab1..d7199542 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt @@ -242,22 +242,18 @@ class KFiles { private fun isWindows() = System.getProperty("os.name").contains("Windows") fun copy(from: Path?, to: Path?, option: StandardCopyOption = StandardCopyOption.REPLACE_EXISTING) { - if (isWindows() && to!!.toFile().exists()) { - kobaltLog(2, "Windows detected, not overwriting $to") - } else { - try { - if (from != null && to != null) { - if (!Files.exists(to) || Md5.toMd5(from.toFile()) != Md5.toMd5(to.toFile())) { - kobaltLog(3, "Copy from $from to $to") - Files.copy(from, to, option) - } else { - kobaltLog(3, " Not copying, indentical files: $from $to") - } + try { + if (from != null && to != null) { + if (!Files.exists(to) || Md5.toMd5(from.toFile()) != Md5.toMd5(to.toFile())) { + kobaltLog(3, "Copy from $from to $to") + Files.copy(from, to, option) + } else { + kobaltLog(3, " Not copying, indentical files: $from $to") } - } catch(ex: IOException) { - // Windows is anal about this - kobaltLog(1, "Couldn't copy $from to $to: ${ex.message}") } + } catch(ex: IOException) { + // Windows is anal about this + kobaltLog(1, "Couldn't copy $from to $to: ${ex.message}") } } diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt index 1d235a44..67d31496 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt @@ -1,6 +1,9 @@ package com.beust.kobalt.misc -import com.beust.kobalt.* +import com.beust.kobalt.Args +import com.beust.kobalt.AsciiArt +import com.beust.kobalt.Constants +import com.beust.kobalt.KobaltException import com.beust.kobalt.api.Kobalt import com.beust.kobalt.maven.aether.Exceptions import java.lang.Exception @@ -75,7 +78,8 @@ class Logger(val dev: Boolean) { fun error(tag: String, message: CharSequence, e: Throwable? = null) { val docUrl = if (e is KobaltException && e.docUrl != null) e.docUrl else null - val text = if (! message.isBlank()) message + val text = + if (message.isNotBlank()) message else if (e != null && (! e.message.isNullOrBlank())) e.message else { e?.toString() } val shortMessage = "***** E $text " + if (docUrl != null) " Documentation: $docUrl" else "" @@ -88,7 +92,10 @@ class Logger(val dev: Boolean) { } fun warn(tag: String, message: CharSequence, e: Throwable? = null) { - val fullMessage = "***** WARNING " + (e?.message ?: message) + val fullMessage = "***** WARNING " + + if (message.isNotBlank()) message + else if (e != null && (!e.message.isNullOrBlank())) e.message + else e?.toString() println(AsciiArt.Companion.warnColor(getPattern("W", fullMessage, fullMessage, tag))) if (KobaltLogger.LOG_LEVEL > 1 && e != null) { Exceptions.printStackTrace(e) diff --git a/src/main/resources/kobalt.properties b/src/main/resources/kobalt.properties index 4436f17d..401bc33c 100644 --- a/src/main/resources/kobalt.properties +++ b/src/main/resources/kobalt.properties @@ -1 +1 @@ -kobalt.version=1.0.72 +kobalt.version=1.0.73