diff --git a/PHPCI/Helper/BaseCommandExecutor.php b/PHPCI/Helper/BaseCommandExecutor.php index bd948834..6fe14ea4 100644 --- a/PHPCI/Helper/BaseCommandExecutor.php +++ b/PHPCI/Helper/BaseCommandExecutor.php @@ -162,7 +162,12 @@ abstract class BaseCommandExecutor implements CommandExecutor $this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG); return $composerBin . '/' . $bin; } - + + if (is_dir($this->buildPath) && is_file($this->buildPath.$bin)) { + $this->logger->log(Lang::get('found_in_path', $this->buildPath, $bin), LogLevel::DEBUG); + return $this->buildPath . $bin; + } + if (is_file($this->rootDir . $bin)) { $this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG); return $this->rootDir . $bin; diff --git a/PHPCI/Plugin/Phing.php b/PHPCI/Plugin/Phing.php index 3a5bd834..969c4c7d 100644 --- a/PHPCI/Plugin/Phing.php +++ b/PHPCI/Plugin/Phing.php @@ -23,9 +23,9 @@ use PHPCI\Model\Build; class Phing implements \PHPCI\Plugin { - private $directory; + protected $directory; private $buildFile = 'build.xml'; - private $targets = array('build'); + protected $targets = array('build'); private $properties = array(); private $propertyFile; @@ -144,7 +144,7 @@ class Phing implements \PHPCI\Plugin * Converts an array of targets into a string. * @return string */ - private function targetsToString() + protected function targetsToString() { return implode(' ', $this->targets); } diff --git a/PHPCI/Plugin/PhingLauncher.php b/PHPCI/Plugin/PhingLauncher.php new file mode 100644 index 00000000..44bd1522 --- /dev/null +++ b/PHPCI/Plugin/PhingLauncher.php @@ -0,0 +1,35 @@ +phpci->findBinary('phing.sh'); + + $cmd[] = 'sh ' . $phingExecutable . ' -f ' . $this->getBuildFilePath(); + + if ($this->getPropertyFile()) { + $cmd[] = '-propertyfile ' . $this->getPropertyFile(); + } + + $cmd[] = $this->propertiesToString(); + + $cmd[] = '-logger phing.listener.DefaultLogger'; + $cmd[] = $this->targetsToString(); + $cmd[] = '2>&1'; + + return $this->phpci->executeCommand(implode(' ', $cmd), $this->directory, $this->targets); + } +}