mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
File adjustment.
This commit is contained in:
parent
2d37408493
commit
04762f153d
1 changed files with 11 additions and 9 deletions
|
@ -13,19 +13,21 @@ import java.nio.file.StandardCopyOption
|
||||||
public class KFiles {
|
public class KFiles {
|
||||||
val kobaltJar : String
|
val kobaltJar : String
|
||||||
get() {
|
get() {
|
||||||
val jar = joinDir(distributionsDir, Kobalt.version, "kobalt/wrapper/kobalt-" + Kobalt.version + ".jar")
|
|
||||||
val jarFile = File(jar)
|
|
||||||
val envJar = System.getenv("KOBALT_JAR")
|
val envJar = System.getenv("KOBALT_JAR")
|
||||||
if (! jarFile.exists() && envJar != null) {
|
if (envJar != null) {
|
||||||
debug("Using kobalt jar $envJar")
|
debug("Using kobalt jar $envJar")
|
||||||
return File(envJar).absolutePath
|
return File(envJar).absolutePath
|
||||||
}
|
} else {
|
||||||
|
val jar = joinDir(distributionsDir, Kobalt.version, "kobalt/wrapper/kobalt-" + Kobalt.version + ".jar")
|
||||||
|
val jarFile = File(jar)
|
||||||
if (! jarFile.exists()) {
|
if (! jarFile.exists()) {
|
||||||
|
return jarFile.absolutePath
|
||||||
|
} else {
|
||||||
// Will only happen when building kobalt itself: the jar file might not be in the dist/ directory
|
// Will only happen when building kobalt itself: the jar file might not be in the dist/ directory
|
||||||
// yet since we're currently building it. Instead, use the classes directly
|
// yet since we're currently building it. Instead, use the classes directly
|
||||||
return File(joinDir("build", "classes", "main")).absolutePath
|
debug("Couldn't find a kobalt.jar file, using build/classes/main")
|
||||||
} else {
|
return java.io.File(joinDir("build", "classes", "main")).absolutePath
|
||||||
return jar
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue