/** * @param IShell $shell * @throws GulpException When gulp exit with none zero code. */ public function execute(IShell $shell) { $commandParts = array_merge(['export HOME="' . $this->getHomeDirectory() . '" &&'], ["cd {$this->path} &&"], ['gulp'], [$this->action], $this->arguments, ['2>&1']); $command = implode(' ', $commandParts); $result = $shell->execute($command, $this->output); if ($result !== 0) { Config::log()->logBuildException($this->output); throw new GulpException($result, $this->output); } }
/** * @throws \Exception */ public function compile() { $packageDefinitionManager = Config::instance()->packageDefinitionManager(); foreach ($packageDefinitionManager->getNames() as $name) { $originalPackage = $packageDefinitionManager->get($name); Config::log()->logPackageBuildStart($originalPackage); $compiledPackage = $this->compilePackage($originalPackage); /** @var IPhpBuilder $builder */ $builder = Config::skeleton(IPhpBuilder::class); $builder->buildPhpFile($compiledPackage); Config::log()->logPackageBuildComplete($compiledPackage); } }