public final class MainRunner extends Object
MainWithNailgun and MainWithoutNailgun have completed the initial bootstrapping of resources and state.
One instance of MainRunner exists per command run.
| Modifier and Type | Class and Description |
|---|---|
static interface |
MainRunner.KnownRuleTypesFactoryFactory |
static interface |
MainRunner.ParserAndCaches
|
| Modifier and Type | Field and Description |
|---|---|
static int |
JNA_POINTER_SIZE
Force JNA to be initialized early to avoid deadlock race condition.
|
| Constructor and Description |
|---|
MainRunner(Console console,
InputStream stdIn,
MainRunner.KnownRuleTypesFactoryFactory knownRuleTypesFactoryFactory,
BuildId buildId,
com.google.common.collect.ImmutableMap<String,String> clientEnvironment,
Platform platform,
Path projectRoot,
org.pf4j.PluginManager pluginManager,
BuckModuleManager moduleManager,
BackgroundTaskManager bgTaskManager,
CommandMode commandMode,
Optional<com.facebook.nailgun.NGContext> context)
This constructor allows integration tests to add/remove/modify known build rules (aka
descriptions).
|
| Modifier and Type | Method and Description |
|---|---|
ExitCode |
runMainWithExitCode(WatchmanWatcher.FreshInstanceAction watchmanFreshInstanceAction,
long initTimestamp,
com.google.common.collect.ImmutableList<String> unexpandedCommandLineArgs) |
public static final int JNA_POINTER_SIZE
See: https://github.com/java-native-access/jna/issues/652
public MainRunner(Console console, InputStream stdIn, MainRunner.KnownRuleTypesFactoryFactory knownRuleTypesFactoryFactory, BuildId buildId, com.google.common.collect.ImmutableMap<String,String> clientEnvironment, Platform platform, Path projectRoot, org.pf4j.PluginManager pluginManager, BuckModuleManager moduleManager, BackgroundTaskManager bgTaskManager, CommandMode commandMode, Optional<com.facebook.nailgun.NGContext> context)
console - the Console to print to for this commandstdIn - the input stream to the command being ranknownRuleTypesFactoryFactory - the known rule types for this commandbuildId - the BuildId for this commandclientEnvironment - the environment variable map for this commandplatform - the current running PlatformprojectRoot - the project root of the current commandpluginManager - the PluginManager for this commandmoduleManager - the BuckModuleManager for this commandcontext - the NGContext from nailgun for this commandpublic ExitCode runMainWithExitCode(WatchmanWatcher.FreshInstanceAction watchmanFreshInstanceAction, long initTimestamp, com.google.common.collect.ImmutableList<String> unexpandedCommandLineArgs) throws Exception
initTimestamp - Value of System.nanoTime() when process got main()/nailMain() invoked.unexpandedCommandLineArgs - command line argumentsException