From 00a49c662b69f69f918f8a9e36ad490e42fb2cc6 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 11 Sep 2023 23:44:30 +0800 Subject: [PATCH] add build:libs option --rebuild --- src/SPC/builder/BuilderBase.php | 2 +- src/SPC/command/BuildLibsCommand.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/BuilderBase.php b/src/SPC/builder/BuilderBase.php index 1c3c84fb..6b49ca32 100644 --- a/src/SPC/builder/BuilderBase.php +++ b/src/SPC/builder/BuilderBase.php @@ -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'), diff --git a/src/SPC/command/BuildLibsCommand.php b/src/SPC/command/BuildLibsCommand.php index be49f86a..dc3989e6 100644 --- a/src/SPC/command/BuildLibsCommand.php +++ b/src/SPC/command/BuildLibsCommand.php @@ -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