xapi.gwt.X_Gwt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xapi-gwt Show documentation
Show all versions of xapi-gwt Show documentation
This module exists solely to package all other gwt modules into a single
uber jar. This makes deploying to non-mavenized targets much easier.
Of course, you would be wise to inherit your dependencies individually;
the uber jar is intended for projects like collide,
which have complex configuration, and adding many jars would be a pain.
The newest version!
package xapi.gwt;
import xapi.log.X_Log;
public class X_Gwt {
private X_Gwt(){}
/**
* Runs a main method;
* dev mode will simply use reflection to call .main(args);
* prod mode can magic-method-inject the main method into a web worker / iframe.
*
* @param cls - The class with the main method to run. Use a class literal.
* @param args - The strings you want passed to the main()
*/
public static void runMainMethod(Class> cls, String ... args) {
// This is for dev mode only, or prod mode if you don't use a class literal.
try{
cls.getMethod("main", String[].class).invoke(null, new Object[]{args});
} catch (Exception e) {
X_Log.error("Error running main method in",cls,"with args",args);
}
}
}