bootstrapper: update for gradle / add staging configuration

This commit is contained in:
Zeruth
2019-07-23 16:38:31 -04:00
parent caa3ecf3b5
commit a37fe7d865
3 changed files with 49 additions and 25 deletions

1
.gitignore vendored
View File

@@ -18,3 +18,4 @@ classes/artifacts/client_jar/client.jar
*/out/
.gradle/
runelite-client/src/main/resources/runelite/*
.staging/

View File

@@ -318,29 +318,29 @@ public class Bootstrap
//Dynamic artifacts
artifacts[3] = new Artifact();
artifacts[3].name = "client-" + RuneLiteAPI.getVersion() + ".jar";
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].hash = getChecksumFile("./runelite-client/build/libs/" + artifacts[3].name);
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master" + Bootstrapper.remoteLocation + artifacts[3].name;
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/" + artifacts[3].name));
copyTodir("./runelite-client/target/" + artifacts[3].name, "./live/");
copyTodir("./runelite-client/build/libs/" + artifacts[3].name, Bootstrapper.localLocation);
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].hash = getChecksumFile("./runelite-api/build/libs/" + artifacts[35].name);
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[35].name;
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/" + artifacts[35].name));
copyTodir("./runelite-api/target/" + artifacts[35].name, "./live/");
copyTodir("./runelite-api/build/libs/" + artifacts[35].name, Bootstrapper.localLocation);
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].hash = getChecksumFile("./runescape-api/build/libs/" + artifacts[36].name);
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[36].name;
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/" + artifacts[36].name));
copyTodir("./runescape-api/target/" + artifacts[36].name, "./live/");
copyTodir("./runescape-api/build/libs/" + artifacts[36].name, Bootstrapper.localLocation);
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].hash = getChecksumFile("./http-api/build/libs/" + artifacts[37].name);
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[37].name;
artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name));
copyTodir("./http-api/target/" + artifacts[37].name, "./live/");
copyTodir("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar", "./live/");
copyTodir("./http-api/build/libs/" + artifacts[37].name, Bootstrapper.localLocation);
copyTodir("./injected-client/build/libs/injected-client-" + RuneLiteAPI.getVersion() + ".jar", Bootstrapper.localLocation);
}
catch (IOException | NoSuchAlgorithmException e)
{

View File

@@ -9,19 +9,42 @@ import java.io.FileWriter;
public class Bootstrapper
{
public static String remoteLocation;
public static String localLocation;
public static void main(String[] args)
{
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./live/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./live/bootstrap.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
if (args.length>0)
{
remoteLocation = "/staging/";
localLocation = "./staging/";
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./staging/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./staging/bootstrap-staging.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
} else
{
remoteLocation = "/live/";
localLocation = "./live/";
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./live/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./live/bootstrap.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}