Add DirDiff utility and enhance package build process

- Introduced DirDiff class for tracking directory file changes.
- Updated ConsoleApplication to use addCommand for build targets.
- Enhanced PackageBuilder with methods for deploying binaries and extracting debug info.
- Improved package installation logic to support shared extensions.
- Added readline extension with patching for static builds.
This commit is contained in:
crazywhalecc
2025-12-04 10:53:49 +08:00
parent c38f174a6b
commit daa87e1350
12 changed files with 544 additions and 11 deletions

View File

@@ -195,15 +195,20 @@ class PackageInstaller
/**
* Get all resolved packages.
* You can filter by package type class if needed.
*
* @return array<string, Package>
* @template T
* @param class-string<T> $package_type Filter by package type
* @return array<T>
*/
public function getResolvedPackages(): array
public function getResolvedPackages(mixed $package_type = Package::class): array
{
return $this->packages;
return array_filter($this->packages, function (Package $pkg) use ($package_type): bool {
return $pkg instanceof $package_type;
});
}
public function isPackageBeingResolved(string $package_name): bool
public function isPackageResolved(string $package_name): bool
{
return isset($this->packages[$package_name]);
}