add build:libs option --rebuild

This commit is contained in:
crazywhalecc 2023-09-11 23:44:30 +08:00 committed by Jerry Ma
parent be8eb90b86
commit 00a49c662b
2 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,7 @@ abstract class BuilderBase
// build all libs
foreach ($this->libs as $lib) {
match ($lib->tryBuild()) {
match ($lib->tryBuild($this->getOption('rebuild', false))) {
BUILD_STATUS_OK => logger()->info('lib [' . $lib::NAME . '] build success'),
BUILD_STATUS_ALREADY => logger()->notice('lib [' . $lib::NAME . '] already built'),
BUILD_STATUS_FAILED => logger()->error('lib [' . $lib::NAME . '] build failed'),

View File

@ -20,6 +20,7 @@ class BuildLibsCommand extends BuildCommand
$this->addArgument('libraries', InputArgument::REQUIRED, 'The libraries will be compiled, comma separated');
$this->addOption('clean', null, null, 'Clean old download cache and source before fetch');
$this->addOption('all', 'A', null, 'Build all libs that static-php-cli needed');
$this->addOption('rebuild', 'r', null, 'Delete old build and rebuild');
}
public function initialize(InputInterface $input, OutputInterface $output): void