Changeset View
Changeset View
Standalone View
Standalone View
src/runtime/ArcanistRuntime.php
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | private function executeCore(array $argv) { | ||||
$this->installSignalHandler(); | $this->installSignalHandler(); | ||||
$args->parsePartial($config_args, true); | $args->parsePartial($config_args, true); | ||||
$config_engine = $this->loadConfiguration($args); | $config_engine = $this->loadConfiguration($args); | ||||
$config = $config_engine->newConfigurationSourceList(); | $config = $config_engine->newConfigurationSourceList(); | ||||
$this->loadLibraries($config_engine, $config, $args); | $this->loadLibraries($config_engine, $config, $args); | ||||
$this->loadPackages($config_engine, $config, $args); | |||||
// Now that we've loaded libraries, we can validate configuration. | // Now that we've loaded libraries, we can validate configuration. | ||||
// Do this before continuing since configuration can impact other | // Do this before continuing since configuration can impact other | ||||
// behaviors immediately and we want to catch any issues right away. | // behaviors immediately and we want to catch any issues right away. | ||||
$config->setConfigOptions($config_engine->newConfigOptionsMap()); | $config->setConfigOptions($config_engine->newConfigOptionsMap()); | ||||
$config->validateConfiguration($this); | $config->validateConfiguration($this); | ||||
$toolset = $this->newToolset($argv); | $toolset = $this->newToolset($argv); | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | foreach ($sources as $spec) { | ||||
case 'config': | case 'config': | ||||
$config_source = $spec['config-source']; | $config_source = $spec['config-source']; | ||||
$description = pht( | $description = pht( | ||||
'Configuration (%s)', | 'Configuration (%s)', | ||||
$config_source->getSourceDisplayName()); | $config_source->getSourceDisplayName()); | ||||
break; | break; | ||||
} | } | ||||
$this->loadLibrary($engine, $library_source, $description); | $this->loadLegacyLibrary($engine, $library_source, $description); | ||||
} | } | ||||
} | } | ||||
private function loadLibrary( | private function loadLegacyLibrary( | ||||
ArcanistConfigurationEngine $engine, | ArcanistConfigurationEngine $engine, | ||||
$location, | $location, | ||||
$description) { | $description) { | ||||
// TODO: This is a legacy system that should be replaced with package | // TODO: This is a legacy system that should be replaced with package | ||||
// management. | // management. | ||||
$log = $this->getLogEngine(); | $log = $this->getLogEngine(); | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | try { | ||||
$prompt = pht('Continue without loading library?'); | $prompt = pht('Continue without loading library?'); | ||||
if (!phutil_console_confirm($prompt)) { | if (!phutil_console_confirm($prompt)) { | ||||
throw $ex; | throw $ex; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
private function loadPackages( | |||||
ArcanistConfigurationEngine $engine, | |||||
ArcanistConfigurationSourceList $config, | |||||
PhutilArgumentParser $args) { | |||||
$loader = id(new ArcanistPackagesLoader()) | |||||
->setConfigurationSourceList($config); | |||||
$loader->loadPackages(); | |||||
} | |||||
private function newToolset(array $argv) { | private function newToolset(array $argv) { | ||||
$binary = basename($argv[0]); | $binary = basename($argv[0]); | ||||
$toolsets = ArcanistToolset::newToolsetMap(); | $toolsets = ArcanistToolset::newToolsetMap(); | ||||
if (!isset($toolsets[$binary])) { | if (!isset($toolsets[$binary])) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Arcanist toolset "%s" is unknown. The Arcanist binary should '. | 'Arcanist toolset "%s" is unknown. The Arcanist binary should '. | ||||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |