1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

Move file.

This commit is contained in:
Cedric Beust 2016-02-27 19:39:43 -08:00
parent f3a352cf74
commit f5b1bcc6b5
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ package com.beust.kobalt.app
import com.beust.kobalt.Args
import com.beust.kobalt.api.ITemplate
import com.beust.kobalt.api.ITemplateContributor
import com.beust.kobalt.internal.Mustache
import com.beust.kobalt.app.Mustache
import com.beust.kobalt.maven.Pom
import com.beust.kobalt.misc.KFiles
import com.beust.kobalt.misc.log

View file

@ -0,0 +1,19 @@
package com.beust.kobalt.app
import com.github.mustachejava.DefaultMustacheFactory
import java.io.*
class Mustache {
companion object {
fun generateFile(mustacheIns: InputStream, createdFile: File, map: Map<String, Any>) {
val sw = StringWriter()
val pw = PrintWriter(sw)
var mf = DefaultMustacheFactory()
mf.compile(InputStreamReader(mustacheIns), "kobalt").execute(pw, map).flush()
with(createdFile) {
parentFile.mkdirs()
writeText(sw.toString())
}
}
}
}