use of net.runelite.launcher.beans.Bootstrap in project launcher by runelite.
the class Launcher method main.
public static void main(String[] args) throws Exception {
OptionParser parser = new OptionParser();
parser.accepts("version").withRequiredArg();
parser.accepts("clientargs").withRequiredArg();
parser.accepts("nojvm");
parser.accepts("debug");
OptionSet options = parser.parse(args);
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception ex) {
logger.warn("Unable to set cross platform look and feel", ex);
}
LauncherFrame frame = new LauncherFrame();
Bootstrap bootstrap = getBootstrap();
// update packr vmargs
PackrConfig.updateLauncherArgs(bootstrap);
if (options.has("version")) {
String version = (String) options.valueOf("version");
logger.info("Using version {}", version);
DefaultArtifact artifact = bootstrap.getClient();
artifact = (DefaultArtifact) artifact.setVersion(version);
bootstrap.setClient(artifact);
// non-releases are not signed
verify = false;
}
ArtifactResolver resolver = new ArtifactResolver(REPO_DIR);
resolver.setListener(frame);
resolver.addRepositories();
Artifact a = bootstrap.getClient();
List<ArtifactResult> results = resolver.resolveArtifacts(a);
if (results.isEmpty()) {
logger.error("Unable to resolve artifacts");
return;
}
try {
verifyJarSignature(results.get(0).getArtifact().getFile());
logger.info("Verified signature of {}", results.get(0).getArtifact());
} catch (CertificateException | IOException | SecurityException ex) {
if (verify) {
logger.error("Unable to verify signature of jar file", ex);
return;
} else {
logger.warn("Unable to verify signature of jar file", ex);
}
}
frame.setVisible(false);
frame.dispose();
String clientArgs = getArgs(options);
// packr doesn't let us specify command line arguments
if ("true".equals(System.getProperty("runelite.launcher.nojvm")) || options.has("nojvm")) {
ReflectionLauncher.launch(results, clientArgs, options);
} else {
JvmLauncher.launch(bootstrap, results, clientArgs, options);
}
}
use of net.runelite.launcher.beans.Bootstrap in project launcher by runelite.
the class ArtifactResolverTest method printJson.
@Test
public void printJson() {
Bootstrap b = new Bootstrap();
Gson g = new Gson();
DefaultArtifact a = new DefaultArtifact("net.runelite", "client", "", "jar", "1.0.0-SNAPSHOT");
b.setClient(a);
b.setClientJvmArguments(new String[] { "-Xmx256m", "-Xss2m", "-Dsun.java2d.noddraw=true", "-XX:CompileThreshold=1500", "-Xincgc", "-XX:+UseConcMarkSweepGC", "-XX:+UseParNewGC" });
System.out.println(g.toJson(b));
}
Aggregations