Class Main
- java.lang.Object
-
- com.diffplug.gradle.eclipserunner.launcher.Main
-
public class Main extends Object
Copied on 2021-02-11 straight from https://github.com/eclipse/rt.equinox.framework/blob/7433233fbcf44fe8b82e63a10f8733767e5b3042/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java - then make `void basicRun(String[] args)` into `public` - `Thread splashHandler` into `protected` - `void invokeFramework(` into `protected` - make the following `public` - `String PARENT_CLASSLOADER_EXT` - `String PARENT_CLASSLOADER_BOOT` - `String PROP_PARENT_CLASSLOADER` - `String PROP_FRAMEWORK_PARENT_CLASSLOADER`
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMain.SplashHandlerclassMain.StartupClassLoader
-
Field Summary
Fields Modifier and Type Field Description protected Stringarchprotected StringbootLocationThe location of the launcher to run.protected URLconfigurationLocationThe location of the configuration information for this instanceprotected booleandebugIndicates whether this instance is running in debug mode.protected StringdevClassPathThe extra development time class path entries for the framework.protected static StringENTRYprotected static intERRORprotected StringframeworkThe id of the bundle that will contain the framework to run.protected booleaninDevelopmentModeIndicates whether this instance is running in development mode.protected URLinstallLocationThe location of the install rootprotected static StringJAR_SCHEMEprotected BufferedWriterlogprotected FilelogFileprotected static StringMESSAGEprotected booleannewSessionprotected StringosIndicates which OS was passed in with -osstatic StringPARENT_CLASSLOADER_BOOTstatic StringPARENT_CLASSLOADER_EXTprotected StringparentConfigurationLocationThe location of the configuration information in the install rootprotected static StringPLUGIN_IDprotected static StringPROP_FRAMEWORKstatic StringPROP_FRAMEWORK_PARENT_CLASSLOADERstatic StringPROP_PARENT_CLASSLOADERprotected static StringREFERENCE_SCHEMEprotected static StringSESSIONstatic StringSPLASH_HANDLEstatic StringSPLASH_LOCATIONprotected booleansplashDownprotected ThreadsplashHandlerprotected static StringSTACKstatic charVARIABLE_DELIM_CHARstatic StringVARIABLE_DELIM_STRINGprotected Stringws
-
Constructor Summary
Constructors Constructor Description Main()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEntry(URL url, List<URL> result)voidbasicRun(String[] args)Executes the launch.protected voidbeforeFwkInvocation()protected Stringdecode(String urlString)Returns a string representation of the given URL String.protected intfindMax(String prefix, String[] candidates)protected String[]getArrayFromList(String prop)Returns the result of converting a list of comma-separated tokens into an arrayprotected StringgetDate(Date date)protected voidinvokeFramework(String[] passThruArgs, URL[] bootPath)protected voidlog(Object obj)static voidmain(String argString)Runs this launcher with the arguments specified in the given string.static voidmain(String[] args)Runs the platform with the given arguments.protected String[]processCommandLine(String[] args)Processes the command line arguments.intrun(String[] args)Runs the platform with the given arguments.protected StringsearchFor(String target, String start)Searches for the given target directory starting in the "plugins" subdirectory of the given location.protected voidsetSecurityPolicy(URL[] bootPath)static StringsubstituteVars(String path)protected voidtakeDownSplash()
-
-
-
Field Detail
-
debug
protected boolean debug
Indicates whether this instance is running in debug mode.
-
bootLocation
protected String bootLocation
The location of the launcher to run.
-
installLocation
protected URL installLocation
The location of the install root
-
configurationLocation
protected URL configurationLocation
The location of the configuration information for this instance
-
parentConfigurationLocation
protected String parentConfigurationLocation
The location of the configuration information in the install root
-
framework
protected String framework
The id of the bundle that will contain the framework to run. Defaults to org.eclipse.osgi.
-
devClassPath
protected String devClassPath
The extra development time class path entries for the framework.
-
inDevelopmentMode
protected boolean inDevelopmentMode
Indicates whether this instance is running in development mode.
-
os
protected String os
Indicates which OS was passed in with -os
-
ws
protected String ws
-
arch
protected String arch
-
splashDown
protected boolean splashDown
-
splashHandler
protected final Thread splashHandler
-
SPLASH_HANDLE
public static final String SPLASH_HANDLE
- See Also:
- Constant Field Values
-
SPLASH_LOCATION
public static final String SPLASH_LOCATION
- See Also:
- Constant Field Values
-
REFERENCE_SCHEME
protected static final String REFERENCE_SCHEME
- See Also:
- Constant Field Values
-
JAR_SCHEME
protected static final String JAR_SCHEME
- See Also:
- Constant Field Values
-
PROP_FRAMEWORK
protected static final String PROP_FRAMEWORK
- See Also:
- Constant Field Values
-
PROP_PARENT_CLASSLOADER
public static final String PROP_PARENT_CLASSLOADER
- See Also:
- Constant Field Values
-
PROP_FRAMEWORK_PARENT_CLASSLOADER
public static final String PROP_FRAMEWORK_PARENT_CLASSLOADER
- See Also:
- Constant Field Values
-
PARENT_CLASSLOADER_EXT
public static final String PARENT_CLASSLOADER_EXT
- See Also:
- Constant Field Values
-
PARENT_CLASSLOADER_BOOT
public static final String PARENT_CLASSLOADER_BOOT
- See Also:
- Constant Field Values
-
SESSION
protected static final String SESSION
- See Also:
- Constant Field Values
-
ENTRY
protected static final String ENTRY
- See Also:
- Constant Field Values
-
MESSAGE
protected static final String MESSAGE
- See Also:
- Constant Field Values
-
STACK
protected static final String STACK
- See Also:
- Constant Field Values
-
ERROR
protected static final int ERROR
- See Also:
- Constant Field Values
-
PLUGIN_ID
protected static final String PLUGIN_ID
- See Also:
- Constant Field Values
-
logFile
protected File logFile
-
log
protected BufferedWriter log
-
newSession
protected boolean newSession
-
VARIABLE_DELIM_STRING
public static final String VARIABLE_DELIM_STRING
- See Also:
- Constant Field Values
-
VARIABLE_DELIM_CHAR
public static final char VARIABLE_DELIM_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
basicRun
public void basicRun(String[] args) throws Exception
Executes the launch.- Parameters:
args- command-line arguments- Throws:
Exception- thrown if a problem occurs during the launch
-
beforeFwkInvocation
protected void beforeFwkInvocation()
-
setSecurityPolicy
protected void setSecurityPolicy(URL[] bootPath)
-
invokeFramework
protected void invokeFramework(String[] passThruArgs, URL[] bootPath) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Error, Exception, InvocationTargetException
-
decode
protected String decode(String urlString)
Returns a string representation of the given URL String. This converts escaped sequences (%..) in the URL into the appropriate characters. NOTE: due to class visibility there is a copy of this method in InternalBootLoader
-
getArrayFromList
protected String[] getArrayFromList(String prop)
Returns the result of converting a list of comma-separated tokens into an array- Parameters:
prop- the initial comma-separated string- Returns:
- the array of string tokens
-
searchFor
protected String searchFor(String target, String start)
Searches for the given target directory starting in the "plugins" subdirectory of the given location.- Parameters:
start- the location to begin searching- Returns:
- the location where target directory was found,
nullotherwise
-
main
public static void main(String argString)
Runs this launcher with the arguments specified in the given string.- Parameters:
argString- the arguments string
-
main
public static void main(String[] args)
Runs the platform with the given arguments. The arguments must identify an application to run (e.g.,-application com.example.application). After running the applicationSystem.exit(N)is executed. The value of N is derived from the value returned from running the application. If the application's return value is anInteger, N is this value. In all other cases, N = 0.Clients wishing to run the platform without a following
System.exitcall should userun().- Parameters:
args- the command line arguments- See Also:
run(String[])
-
run
public int run(String[] args)
Runs the platform with the given arguments. The arguments must identify an application to run (e.g.,-application com.example.application). Returns the value returned from running the application. If the application's return value is anInteger, N is this value. In all other cases, N = 0.- Parameters:
args- the command line arguments
-
processCommandLine
protected String[] processCommandLine(String[] args)
Processes the command line arguments. The general principle is to NOT consume the arguments and leave them to be processed by Eclipse proper. There are a few args which are directed towards main() and a few others which we need to know about. Very few should actually be consumed here.- Parameters:
args- the command line arguments- Returns:
- the arguments to pass through to the launched application
-
takeDownSplash
protected void takeDownSplash()
-
log
protected void log(Object obj)
-
-