/** * @param YamlConfig $config * @param IOInterface $io * @param EventDispatcherInterface $dispatcher * @param TaskFactory $taskFactory * @return Builder */ public static function get(YamlConfig $config, IOInterface $io, EventDispatcherInterface $dispatcher, TaskFactory $taskFactory) { $_config = $config->getConfig(); $buildDir = $_config['build']['dir']; $builderTasks = array($taskFactory->get('export')); foreach ($_config['build']['tasks'] as $taskConfig) { $task = $taskFactory->get($taskConfig['type'], $taskConfig); $builderTasks[] = $task; } $builder = new Builder($buildDir, $builderTasks, $io, $dispatcher); return $builder; }
/** * @param string $taskConfigPath path to the tasks configuration in the conveyor.yml config * @param TaskFactory $taskFactory * @param YamlConfig $config * @param IOInterface $io * @param EventDispatcherInterface $dispatcher * @return TaskRunner */ public static function get($taskConfigPath, TaskFactory $taskFactory, YamlConfig $config, IOInterface $io, EventDispatcherInterface $dispatcher = null) { $_config = $config->getConfig(); $taskRunner = new TaskRunner($io, $dispatcher); foreach ((array) self::getTasksConfig($_config, $taskConfigPath) as $t => $taskConfig) { $task = $taskFactory->get($taskConfig['type'], $taskConfig); $taskRunner->addTask($task); } return $taskRunner; }