Improves bootstrapper. Moves all jars to single folder ./live as it produces bootstrap for easy moving.

This commit is contained in:
Zeruth
2019-07-07 21:05:33 -04:00
parent 92e2fa3857
commit b80ca6e2fa
6 changed files with 48 additions and 23 deletions

View File

@@ -284,6 +284,12 @@
<artifactId>asm-all</artifactId>
<version>6.0_BETA</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.21</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@@ -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");

View File

@@ -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)
{

View File

@@ -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);
}