Skip to content

Commit

Permalink
Make sure that progress bar steps are calculated correctly for nested…
Browse files Browse the repository at this point in the history
… collections.
  • Loading branch information
greg-1-anderson committed Aug 3, 2016
1 parent cfa1bc7 commit dbd7c91
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
18 changes: 13 additions & 5 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,22 @@ public function publish()
*/
public function pharBuild()
{
$collection = $this->collection();

// Make sure to remove dev files before finding the files to pack into
// the phar.
// the phar. This must therefore be done outside the collection,
// as the files to pack are found when the collection is built.
$this->taskComposerInstall()
->noDev()
->printed(false)
->run();

$collection = $this->collectionBuilder();

// revert back phar dependencies on completion
$collection->completion($this
->taskComposerInstall()
->printed(false)
);

$packer = $this->taskPackPhar('robo.phar');
$files = Finder::create()->ignoreVCS(true)
->files()
Expand All @@ -280,8 +287,9 @@ public function pharBuild()
$packer->addFile($file->getRelativePathname(), $file->getRealPath());
}
$packer->addFile('robo', 'robo')
->executable('robo')
->addToCollection($collection);
->executable('robo');

$collection->addTask($packer);

return $collection->run();
}
Expand Down
Binary file modified robo.phar
Binary file not shown.
7 changes: 6 additions & 1 deletion src/Collection/CollectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Robo\Contract\ConfigAwareInterface;
use Robo\Common\ConfigAwareTrait;

class CollectionBuilder implements NestedCollectionInterface, ConfigAwareInterface, ContainerAwareInterface, TaskInterface
class CollectionBuilder implements NestedCollectionInterface, ConfigAwareInterface, ContainerAwareInterface, TaskInterface, WrappedTaskInterface
{
use ConfigAwareTrait;
use ContainerAwareTrait;
Expand Down Expand Up @@ -247,6 +247,11 @@ public function run()
return $this->getCollection()->run();
}

public function original()
{
return $this->getCollection();
}

/**
* Return the collection of tasks associated with this builder.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Task/Development/PackPhar.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* ?>
* ```
*/
class PackPhar extends BaseTask implements PrintedInterface
class PackPhar extends BaseTask implements PrintedInterface, ProgressIndicatorAwareInterface
{
/**
* @var \Phar
Expand Down

0 comments on commit dbd7c91

Please sign in to comment.