From 138df155a9a5e575edd1731c25cd516f3350b68c Mon Sep 17 00:00:00 2001 From: Aaron Newton Date: Thu, 13 Oct 2011 15:01:21 -0700 Subject: [PATCH] Adding ability to exclude a component. --- README.md | 4 ++++ packager | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97f46c9..183ff3f 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,10 @@ Which is the same as... Which builds the passed in components (and their dependancies) using your registered packages. + ./packager build +components Core/Type Core/Fx ART/ART.Element -components Core/Core + +This will build a library that has the same dependencies as the previous example but exclude the `Core/Core` component. + ./packager build +files Core/Core Core/Fx ART/ART This builds the passed in files (and their dependancies) using your registered packages. diff --git a/packager b/packager index 61e8274..75b572a 100755 --- a/packager +++ b/packager @@ -87,6 +87,7 @@ switch ($command){ 'files' => array(), 'add-packages' => array(), 'remove-packages' => array(), + 'remove-components' => array(), 'blocks' => array(), 'use-only' => null ); @@ -120,7 +121,11 @@ switch ($command){ $build = 'components'; continue; } - + if ($arg == '-components'){ + $build = 'remove-components'; + continue; + } + if ($arg == '+files'){ $build = 'files'; continue; @@ -176,7 +181,12 @@ switch ($command){ } $files = $pkg->complete_files($files); - + + foreach ($selected['remove-components'] as $component){ + $file = $pkg->component_to_file($component); + array_erase($files, $file); + } + Packager::warn("Build using: " . implode(', ', $pkg->get_packages()) . "\n"); Packager::warn("Included Files/Components:\n");