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

30 lines
770 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;
#[AsCommand('build:libs')]
class BuildLibsCommand extends BaseCommand
{
public function configure()
{
$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;
}
}