/**
  * @test
  */
 public function should_not_trigger_node_class_loading()
 {
     $task = $this->amakaScript->task(':A')->dependsOn('Composer');
     $this->amakaScript->add($task);
     $cd = new CycleDetector($this->amakaScript);
     $cd->isValid(':A');
 }
Exemple #2
0
 /**
  * Run a task
  *
  * @param string $entry Starting task
  */
 public function run($entry)
 {
     if (empty($entry)) {
         throw new \RuntimeException("No task to run");
     }
     if (null === $this->amakaScript->get($entry)) {
         throw new UndefinedTaskException("Task '{$entry}' was not defined in the amaka script.");
     }
     $detector = new CycleDetector($this->amakaScript);
     $runner = new StandardRunner($this->amakaScript);
     if (!$detector->isValid($entry)) {
         throw $detector->getExceptionClass();
     }
     $runner->run($entry);
 }