Changeset View
Changeset View
Standalone View
Standalone View
support/lib/rebuild-map.php
Show All 11 Lines | |||||
EOHELP | EOHELP | ||||
); | ); | ||||
$args->parseStandardArguments(); | $args->parseStandardArguments(); | ||||
$args->parse( | $args->parse( | ||||
array( | array( | ||||
array( | array( | ||||
'name' => 'quiet', | |||||
'help' => pht('Do not write status messages to stderr.'), | |||||
), | |||||
array( | |||||
'name' => 'drop-cache', | 'name' => 'drop-cache', | ||||
'help' => pht( | 'help' => pht( | ||||
'Drop the symbol cache and rebuild the entire map from scratch.'), | 'Drop the symbol cache and rebuild the entire map from scratch.'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'limit', | 'name' => 'limit', | ||||
'param' => 'N', | 'param' => 'N', | ||||
'default' => 8, | 'default' => 8, | ||||
Show All 19 Lines | |||||
$root = $args->getArg('root'); | $root = $args->getArg('root'); | ||||
if (count($root) !== 1) { | if (count($root) !== 1) { | ||||
throw new Exception(pht('Provide exactly one library root!')); | throw new Exception(pht('Provide exactly one library root!')); | ||||
} | } | ||||
$root = Filesystem::resolvePath(head($root)); | $root = Filesystem::resolvePath(head($root)); | ||||
$builder = new PhutilLibraryMapBuilder($root); | $builder = new PhutilLibraryMapBuilder($root); | ||||
$builder->setQuiet($args->getArg('quiet')); | |||||
$builder->setSubprocessLimit($args->getArg('limit')); | $builder->setSubprocessLimit($args->getArg('limit')); | ||||
if ($args->getArg('drop-cache')) { | if ($args->getArg('drop-cache')) { | ||||
$builder->dropSymbolCache(); | $builder->dropSymbolCache(); | ||||
} | } | ||||
if ($args->getArg('show')) { | if ($args->getArg('show')) { | ||||
$library_map = $builder->buildMap(); | $library_map = $builder->buildMap(); | ||||
Show All 11 Lines |