Add a new plugin Phing Launcher (https://bitbucket.org/kmelia/phing-launcher) based on the Phing plugin
This commit is contained in:
parent
943c8124ac
commit
719dd184b0
|
@ -162,7 +162,12 @@ abstract class BaseCommandExecutor implements CommandExecutor
|
||||||
$this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG);
|
$this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG);
|
||||||
return $composerBin . '/' . $bin;
|
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)) {
|
if (is_file($this->rootDir . $bin)) {
|
||||||
$this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG);
|
$this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG);
|
||||||
return $this->rootDir . $bin;
|
return $this->rootDir . $bin;
|
||||||
|
|
|
@ -23,9 +23,9 @@ use PHPCI\Model\Build;
|
||||||
class Phing implements \PHPCI\Plugin
|
class Phing implements \PHPCI\Plugin
|
||||||
{
|
{
|
||||||
|
|
||||||
private $directory;
|
protected $directory;
|
||||||
private $buildFile = 'build.xml';
|
private $buildFile = 'build.xml';
|
||||||
private $targets = array('build');
|
protected $targets = array('build');
|
||||||
private $properties = array();
|
private $properties = array();
|
||||||
private $propertyFile;
|
private $propertyFile;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ class Phing implements \PHPCI\Plugin
|
||||||
* Converts an array of targets into a string.
|
* Converts an array of targets into a string.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function targetsToString()
|
protected function targetsToString()
|
||||||
{
|
{
|
||||||
return implode(' ', $this->targets);
|
return implode(' ', $this->targets);
|
||||||
}
|
}
|
||||||
|
|
35
PHPCI/Plugin/PhingLauncher.php
Normal file
35
PHPCI/Plugin/PhingLauncher.php
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PHPCI\Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Phing Launcher Plugin - Provides access to Phing functionality with Phing Launcher.
|
||||||
|
*
|
||||||
|
* @author kmelia
|
||||||
|
* @package PHPCI
|
||||||
|
* @subpackage Plugins
|
||||||
|
*/
|
||||||
|
class PhingLauncher extends Phing implements \PHPCI\Plugin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Executes Phing Launcher and runs a specified targets
|
||||||
|
*/
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
$phingExecutable = $this->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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue