Enhance package management in CraftCommand by merging craft-level packages and shared extensions into build options

This commit is contained in:
crazywhalecc
2026-04-29 15:09:21 +08:00
parent 269cd600f8
commit 02713fafb5
3 changed files with 36 additions and 0 deletions

View File

@@ -106,6 +106,14 @@ class TargetPackage extends LibraryPackage
if ($input !== null && $input->hasArgument($key)) {
return $input->getArgument($key);
}
// fallback to builder arguments (set programmatically, e.g. from CraftCommand)
$builder = ApplicationContext::has(PackageBuilder::class)
? ApplicationContext::get(PackageBuilder::class)
: null;
if ($builder !== null && ($arg = $builder->getArgument($key)) !== null) {
return $arg;
}
return null;
}