When starting Getdown as an application, pass everything after the
application identifier as (base) jvm args.
This commit is contained in:
@@ -36,6 +36,7 @@ import java.io.BufferedOutputStream;
|
|||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
|
||||||
import com.samskivert.swing.util.SwingUtil;
|
import com.samskivert.swing.util.SwingUtil;
|
||||||
|
import com.samskivert.util.ArrayUtil;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
import static com.threerings.getdown.Log.log;
|
import static com.threerings.getdown.Log.log;
|
||||||
@@ -54,7 +55,7 @@ public class GetdownApp
|
|||||||
if (StringUtil.isBlank(adarg)) {
|
if (StringUtil.isBlank(adarg)) {
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
System.err.println(
|
System.err.println(
|
||||||
"Usage: java -jar getdown.jar app_dir [app_id]");
|
"Usage: java -jar getdown.jar app_dir [app_id] [jvm args]");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
adarg = args[aidx++];
|
adarg = args[aidx++];
|
||||||
@@ -66,6 +67,12 @@ public class GetdownApp
|
|||||||
appId = args[aidx++];
|
appId = args[aidx++];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pass along anything after that as jvm args
|
||||||
|
String[] jvmargs = null;
|
||||||
|
if (args.length > aidx) {
|
||||||
|
jvmargs = ArrayUtil.splice(args, 0, aidx);
|
||||||
|
}
|
||||||
|
|
||||||
// ensure a valid directory was supplied
|
// ensure a valid directory was supplied
|
||||||
File appDir = new File(adarg);
|
File appDir = new File(adarg);
|
||||||
if (!appDir.exists() || !appDir.isDirectory()) {
|
if (!appDir.exists() || !appDir.isDirectory()) {
|
||||||
@@ -99,7 +106,7 @@ public class GetdownApp
|
|||||||
log.info("---------------------------------------------");
|
log.info("---------------------------------------------");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Getdown app = new Getdown(appDir, appId) {
|
Getdown app = new Getdown(appDir, appId, null, jvmargs) {
|
||||||
@Override
|
@Override
|
||||||
protected Container createContainer () {
|
protected Container createContainer () {
|
||||||
// create our user interface, and display it
|
// create our user interface, and display it
|
||||||
|
|||||||
Reference in New Issue
Block a user