Improves bootstrapper. Moves all jars to single folder ./live as it produces bootstrap for easy moving.
This commit is contained in:
@@ -83,7 +83,7 @@ import org.slf4j.LoggerFactory;
|
||||
@Slf4j
|
||||
public class RuneLite
|
||||
{
|
||||
public static final String RUNELIT_VERSION = "2.0.1-1";
|
||||
public static final String RUNELIT_VERSION = "2.0.2";
|
||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
|
||||
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
|
||||
public class Bootstrap
|
||||
{
|
||||
@@ -84,6 +85,14 @@ public class Bootstrap
|
||||
|
||||
}
|
||||
|
||||
public void copyTodir(String origPath, String newPath) {
|
||||
try {
|
||||
FileUtils.copyFileToDirectory(new File(origPath), new File(newPath));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static String bytesToHex(byte[] hashInBytes)
|
||||
{
|
||||
|
||||
@@ -300,26 +309,31 @@ public class Bootstrap
|
||||
artifacts[3].hash = getChecksumFile("./runelite-client/target/" + artifacts[3].name);
|
||||
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[3].name;
|
||||
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/" + artifacts[3].name));
|
||||
copyTodir("./runelite-client/target/" + artifacts[3].name, "./live/");
|
||||
artifacts[35] = new Artifact();
|
||||
artifacts[35].name = "runelite-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[35].hash = getChecksumFile("./runelite-api/target/" + artifacts[35].name);
|
||||
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[35].name;
|
||||
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/" + artifacts[35].name));
|
||||
copyTodir("./runelite-api/target/" + artifacts[35].name, "./live/");
|
||||
artifacts[36] = new Artifact();
|
||||
artifacts[36].name = "runescape-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[36].hash = getChecksumFile("./runescape-api/target/" + artifacts[36].name);
|
||||
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[36].name;
|
||||
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/" + artifacts[36].name));
|
||||
copyTodir("./runescape-api/target/" + artifacts[36].name, "./live/");
|
||||
artifacts[37] = new Artifact();
|
||||
artifacts[37].name = "http-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[37].hash = getChecksumFile("./http-api/target/" + artifacts[37].name);
|
||||
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[37].name;
|
||||
artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name));
|
||||
copyTodir("./http-api/target/" + artifacts[37].name, "./live/");
|
||||
artifacts[42] = new Artifact();
|
||||
artifacts[42].name = "injected-client-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[42].hash = getChecksumFile("./injected-client/target/" + artifacts[42].name);
|
||||
artifacts[42].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[42].name;
|
||||
artifacts[42].size = Long.toString(getFileSize("./injected-client/target/" + artifacts[42].name));
|
||||
copyTodir("./injected-client/target/" + artifacts[42].name, "./live/");
|
||||
}
|
||||
catch (IOException | NoSuchAlgorithmException e)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,8 @@ package net.runelite.client.util.bootstrap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
||||
public class Bootstrapper
|
||||
@@ -10,7 +12,9 @@ public class Bootstrapper
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
|
||||
try (FileWriter fw = new FileWriter("./bootstrap.json"))
|
||||
File dir = new File("./live/");
|
||||
dir.mkdir();
|
||||
try (FileWriter fw = new FileWriter("./live/bootstrap.json"))
|
||||
{
|
||||
gson.toJson(new Bootstrap(), fw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user