Example #1
0
 /**
  * @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;
 }
Example #2
0
 /**
  * Add task to the build process
  *
  * @param  Task  $task
  * @return $this
  */
 public function addTask(Task $task)
 {
     $this->taskRunner->addTask($task);
     return $this;
 }