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

Update to new structure.

This commit is contained in:
Cedric Beust 2016-03-10 03:21:23 +04:00
parent 376fa40e10
commit 42cb7ff441
7 changed files with 16 additions and 18 deletions

View file

@ -26,7 +26,8 @@ class KFiles {
debug("Using kobalt jar $envJar")
return listOf(File(envJar).absolutePath)
} else {
val jar = joinDir(distributionsDir, Kobalt.version, "kobalt/wrapper/kobalt-" + Kobalt.version + ".jar")
val jar = joinDir(distributionsDir, "kobalt-" + Kobalt.version,
"kobalt/wrapper/kobalt-" + Kobalt.version + ".jar")
val jarFile = File(jar)
if (jarFile.exists()) {
return listOf(jarFile.absolutePath)

View file

@ -17,7 +17,7 @@ public class Main {
}
private static final boolean DEV = false;
private static final int DEV_VERSION_INT = 650;
private static final int DEV_VERSION_INT = 660;
private static final String DEV_VERSION = "0." + DEV_VERSION_INT;
private static final String DEV_ZIP = "/Users/beust/kotlin/kobalt/kobaltBuild/libs/kobalt-" + DEV_VERSION + ".zip";
@ -150,12 +150,12 @@ public class Main {
log(2, "Wrapper version: " + wrapperVersion);
String zipOutputDir = DISTRIBUTIONS_DIR + "/" + wrapperVersion;
boolean isNew = Float.parseFloat(version) * 1000 >= 650;
if (isNew) {
zipOutputDir += File.separator + "kobalt-" + version;
}
Path kobaltJarFile = Paths.get(zipOutputDir,
String fromZipOutputDir = DISTRIBUTIONS_DIR + File.separator + "kobalt-" + version;
String toZipOutputDir = DISTRIBUTIONS_DIR;
Path kobaltJarFile = Paths.get(toZipOutputDir,
isNew ? "kobalt-" + version : "",
getWrapperDir().getPath() + "/" + FILE_NAME + "-" + wrapperVersion + ".jar");
boolean downloadedZipFile = false;
if (! Files.exists(localZipFile) || ! Files.exists(kobaltJarFile)) {
@ -170,7 +170,7 @@ public class Main {
int retries = 0;
while (retries < 2) {
try {
extractZipFile(localZipFile, zipOutputDir);
extractZipFile(localZipFile, toZipOutputDir);
break;
} catch (ZipException e) {
retries++;
@ -192,13 +192,10 @@ public class Main {
Path to = Paths.get(file);
to.toFile().getAbsoluteFile().getParentFile().mkdirs();
if (Files.exists(to)) {
log(2, to + " already exists, not overwriting it");
continue;
} else if (file.endsWith(KOBALTW)) {
if (file.endsWith(KOBALTW)) {
generateKobaltW(Paths.get(KOBALTW));
} else {
Path from = Paths.get(zipOutputDir, file);
Path from = Paths.get(fromZipOutputDir, file);
try {
if (isWindows() && to.toFile().exists()) {
log(2, " Windows detected, not overwriting " + to);
@ -232,7 +229,7 @@ public class Main {
}
log(2, "Generating " + KOBALTW + (envFile.exists() ? " with shebang" : "") + ".");
content += "java -jar $(dirname $0)/../kobalt/wrapper/kobalt-wrapper.jar $*\n";
content += "java -jar $(dirname $0)/kobalt/wrapper/kobalt-wrapper.jar $*\n";
Files.write(filePath, content.getBytes());