diff --git a/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt b/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt index 7d3f2500..a162a617 100644 --- a/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt +++ b/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt @@ -165,7 +165,7 @@ class KFiles { log(2, "Windows detected, not overwriting ${to!!}") } else { try { - log(2, "Copy from $from!! to ${to!!}") + log(2, "Copy from $from to ${to!!}") Files.copy(from, to, option) } catch(ex: IOException) { // Windows is anal about this diff --git a/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt b/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt new file mode 100644 index 00000000..c3fff544 --- /dev/null +++ b/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt @@ -0,0 +1,21 @@ +package com.beust.kobalt.misc + +import com.google.inject.Inject +import java.io.File + +class KobaltWrapperProperties @Inject constructor() { + private val WRAPPER_DIR = KFiles.KOBALT_DIR + "/wrapper" + private val KOBALT_WRAPPER_PROPERTIES = "kobalt-wrapper.properties" + private val PROPERTY_VERSION = "kobalt.version" + private val PROPERTY_DOWNLOAD_URL = "kobalt.downloadUrl" + + val file: File + get() = File("$WRAPPER_DIR/$KOBALT_WRAPPER_PROPERTIES") + + fun create(version: String) { + KFiles.saveFile(file, listOf( + "$PROPERTY_VERSION=$version", + "$PROPERTY_DOWNLOAD_URL" + ).joinToString("\n")) + } +}