1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00
This commit is contained in:
Cedric Beust 2015-11-10 22:13:19 -08:00
parent fea075d755
commit 58a50a5e60
2 changed files with 22 additions and 1 deletions

View file

@ -165,7 +165,7 @@ class KFiles {
log(2, "Windows detected, not overwriting ${to!!}") log(2, "Windows detected, not overwriting ${to!!}")
} else { } else {
try { try {
log(2, "Copy from $from!! to ${to!!}") log(2, "Copy from $from to ${to!!}")
Files.copy(from, to, option) Files.copy(from, to, option)
} catch(ex: IOException) { } catch(ex: IOException) {
// Windows is anal about this // Windows is anal about this

View file

@ -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"))
}
}