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

Put the javac command in a file.

Also introduce fixSlashes().
This commit is contained in:
Cedric Beust 2017-03-24 23:42:41 -07:00
parent 771f90332c
commit 4e4c5a7d9e
5 changed files with 15 additions and 8 deletions

View file

@ -65,7 +65,7 @@ class JarUtils {
entry = stream.nextEntry
}
} else {
val entryFileName = file.to(foundFile.path).path.replace("\\", "/")
val entryFileName = KFiles.fixSlashes(file.to(foundFile.path))
val entry = JarEntry(entryFileName)
entry.time = localFile.lastModified()
addEntry(FileInputStream(localFile), entry, outputStream, onError)

View file

@ -115,6 +115,9 @@ class KFiles {
*/
fun joinFileAndMakeDir(vararg ts: String) = joinDir(joinAndMakeDir(ts.slice(0..ts.size - 2)), ts[ts.size - 1])
fun fixSlashes(f: File) = KFiles.fixSlashes(f.path)
fun fixSlashes(s: String) = s.replace('\\', '/')
fun makeDir(dir: String, s: String? = null) =
(if (s != null) File(dir, s) else File(dir)).apply { mkdirs() }