Add pack lib command

This commit is contained in:
crazywhalecc
2026-02-05 16:11:28 +08:00
parent 2a4959d973
commit 9f2132c001
4 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace StaticPHP\Command\Dev;
use StaticPHP\Command\BaseCommand;
use StaticPHP\Package\PackageInstaller;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
#[AsCommand('dev:pack-lib', 'Packs a library package for distribution')]
class PackLibCommand extends BaseCommand
{
public function configure(): void
{
$this->addArgument('library', InputArgument::REQUIRED, 'The library will be compiled');
$this->addOption('show-libc-ver', null, null);
}
public function handle(): int
{
$library = $this->getArgument('library');
$show_libc_ver = $this->getOption('show-libc-ver');
$installer = new PackageInstaller(['pack-mode' => true]);
$installer->addBuildPackage($library);
$installer->run();
return static::SUCCESS;
}
}