Files
static-php-cli/src/StaticPHP/Command/BuildLibsCommand.php

30 lines
812 B
PHP
Raw Normal View History

2025-11-30 15:35:04 +08:00
<?php
declare(strict_types=1);
namespace StaticPHP\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
2026-02-02 15:35:59 +08:00
#[AsCommand('build:libs', 'Build specified library packages')]
2025-11-30 15:35:04 +08:00
class BuildLibsCommand extends BaseCommand
{
2026-02-02 15:35:59 +08:00
public function configure(): void
2025-11-30 15:35:04 +08:00
{
$this->addArgument('libraries', InputArgument::REQUIRED, 'The library packages will be compiled, comma separated');
}
public function handle(): int
{
$libs = parse_comma_list($this->input->getArgument('libraries'));
$installer = new \StaticPHP\Package\PackageInstaller($this->input->getOptions());
foreach ($libs as $lib) {
$installer->addBuildPackage($lib);
}
$installer->run();
return static::SUCCESS;
}
}