/** * Builds version for target * * @param string $target * @param Version|string $version */ public function build($target, $version) { if (is_string($version)) { $version = $this->getRepository()->getVersion($version); } $this->assertTargetExists($target, $this->getConfig()->getConfig()); $this->setConfigParametersForTarget($target); $builder = $this->getBuilder(); $io = $this->getIO(); $context = new Context(); $context->setBuilddir($builder->getBuildDir())->setVersion($version)->setTarget($target); $manager = new StageManager($context, $this->container->get('dispatcher')); $manager->addStage('build', new Stage\BuildStage($builder, $io))->execute(); }