Permalink
Browse files

Unification of plugins

  • Loading branch information...
Vincent PELISSET Vincent PELISSET
Vincent PELISSET authored and Vincent PELISSET committed Dec 13, 2018
1 parent 6472cdb commit 9c9f739b5102397f8de1de9d2d8a2a86a241a2f1
@@ -21,3 +21,6 @@
!/public/artifacts/.gitkeep

/public/.htaccess

/tests/runtime
!/tests/runtime/.gitkeep
@@ -4,6 +4,11 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### Changed
- All plugins who have an executable can overide the executable with "executable" config (gulp & grunt use new parameter)
- All plugins who use global ignore can now set a local ignore, cumulative settings
- All plugins who use "path" or "directory" now use "directory", and this can be set like ignore for all plugins who use it


## [0.24.0](https://github.com/php-censor/php-censor/tree/0.24.0) (2018-11-04)

@@ -185,9 +185,11 @@ The project config should look something like this:
setup:
composer:
action: "install"
directory: "."
test:
php_unit:
config: "phpunit.xml"
executable: "/lastBinaryVersion/phpunit"
php_mess_detector:
allow_failures: true
php_code_sniffer:
@@ -127,6 +127,7 @@
]
}
},

"repositories": [
{
"type": "composer",
@@ -10,8 +10,8 @@ Configuration

- **args** [string, optional] - Allows you to pass command line arguments to Atoum.
- **config** [string, optional] - Path to an Atoum configuration file.
- **directory** [string, optional] - Path in which to run Atom (defaults to the build root).
- **executable** [string, optional] - Allows you to provide a path to the Atom binary (defaults to PHP Censor root,
- **directory** [string, optional] - This option lets you specify the tests directory to run.
- **executable** [string, optional] - Allows you to provide a path to the Atom binary
vendor/bin, or a system-provided Atom binary).

### Examples
@@ -15,9 +15,9 @@ configuration file paths. By default this is called `codeception.yml` and will b
made on line 132 regarding the value of `--xml` being the next argument which will not be correct if the user provides
arguments using this config param, you must specify `report.xml` before any user input arguments to satisfy the report
processing on line 146.

* **path** - Optional - The path from the root of your project to the root of the codeception `_output` directory

* **path** - Deprecated - use output_path
* **output_path** - Optional - The path from the root of your project to the root of the codeception `_output` directory
* **executable** [string, optional] - Allows you to provide a path to the codeception binary
#### Default values

- config
@@ -18,6 +18,7 @@ Configuration
* **no_dev** [optional, bool, true|false] - whether Composer should run with the `--no-dev` flag (default: false)
* **ignore_platform_reqs** [optional, bool, true|false] - whether Composer should run with the `--ignore-platform-reqs`
flag (default: false)
* **executable** [string, optional] - Allows you to provide a path to the codeception binary

### Examples

@@ -9,7 +9,8 @@ Configuration
### Options

- **directory** [string, optional] - The directory in which to run Grunt (defaults to build root.)
- **grunt** [string, optional] - Allows you to provide a path to Grunt (defaults to PHP Censor root, vendor/bin, or a
- **grunt** (deprecated) : replaced by **executable**, same functionality
- **executable** [string, optional] - Allows you to provide a path to Grunt (defaults to PHP Censor root, vendor/bin, or a
system-provided Grunt).
- **gruntfile** [string, optional] - Gruntfile to run (defaults to `Gruntfile.js`).
- **task** [string, optional] - The Grunt task to run.
@@ -0,0 +1,27 @@
Plugin gulp
============

This plugin runs [gulpjs](https://gulpjs.com/) tasks.

Configuration
-------------

### Options

- **directory** [string, optional] - The directory in which to run Grunt (defaults to build root.)
- **gulp** (deprecated) : replaced by **executable**, same functionality
- **executable** [string, optional] - Allows you to provide a path to Grunt (defaults to PHP Censor root, vendor/bin, or a
system-provided Grunt).
- **gulpfile** [string, optional] - GulpFile to run (defaults to `gulpfile.js`).
- **task** [string, optional] - The Gulp task to run.

### Example

```yml
test:
gulp:
directory: "path to run gulp in"
grunt: "path to grunt executable"
gruntfile: "gruntfile.js"
task: "css"
```
@@ -9,10 +9,12 @@ Configuration
### Options

* **directory** [string, optional] - Directory in which to run PDepend (default: `%BUILD_PATH%`).
* **executable** [string, optional] - Allows you to provide a path to pdepend executable

### Examples

```yaml
pdepend:
directory: ./src
executable: ./src/vendor/bin/pdepend
```
@@ -13,7 +13,7 @@ Configuration
* **targets** - Which build targets you want to run.
* **properties** - Any custom properties you wish to pass to phing.
* **property_file** - A file containing properties you wish to pass to phing.

* **executable** [string, optional] - Allows you to provide a path to phing executable
### Examples

```yml
@@ -8,15 +8,17 @@ Configuration

### Options

* **path** - Optional - Path in which to run PHP Copy/Paste Detector (default: `%BUILD_PATH%`).
* **path** - Deprecated - use directory
* **directory** - Optional - direcotry in which to run PHP Copy/Paste Detector (default: `%BUILD_PATH%`).
* **ignore** - Optional - A list of files / paths to ignore (default: build_settings > ignore).
* **executable** [string, optional] - Allows you to provide a path to phpcs executable

### Examples

```yml
test:
php_cpd:
path: "app"
directory: "app"
ignore:
- "app/my/path"
```
@@ -16,6 +16,7 @@ Configuration
* **config** [string, optional] - Special config file (default: `%BUILD_PATH%./.php_cs` or `%BUILD_PATH%./.php_cs.dist`)
* **errors** [bool, optional] - Not fix files, but get the number of files with problem (default: false)
* **report_errors** [bool, optional] - With **errors**, get the list of files in "Errors" tab (default: false)
* **executable** [string, optional] - Allows you to provide a path to php-cs-fixer executable
### Examples
@@ -8,11 +8,13 @@ Configuration

### Options

* **allowed_warnings** - Optional - The warning limit for a successful build.
* **path** - Optional - Directory in which PHP Docblock Checker should run.
* **path** - Deprecated - use directory
* **directory** - Optional - Directory in which PHP Docblock Checker should run.
* **skip_methods** - Optional - Tells the checker to ignore methods that don't have a docblock.
* **skip_classes** - Optional - Tells the checker to ignore classes that don't have a docblock.
* **skip_signatures** - Optional - Tells the checker to ignore check docblocks against method signatures.
* **allowed_warnings** - Optional - The warning limit for a successful build.
* **executable** [string, optional] - Allows you to provide a path to phpdoc-checker executable

### Examples

@@ -9,6 +9,7 @@ Configuration
### Options

* **directory** - Optional - The directory in which phploc should run.
* **executable** [string, optional] - Allows you to provide a path to php_loc executable

### Example

@@ -11,6 +11,7 @@ Configuration

* **directory** [string, optional] - directory to inspect (default: build root)
* **ignore** [array, optional] - directory to ignore (default: inherits ignores specified in setup)
* **executable** [string, optional] - Allows you to provide a path to parallel-lint executable

### Examples

@@ -8,7 +8,7 @@ Configuration

### Options

* **bootstrap** - Optional - Path to a PHPSpec bootstrap file.
* **executable** [string, optional] - Allows you to provide a path to phpspec executable

### Examples

@@ -16,8 +16,7 @@ Its activated if you have phpunit.xml file in your build path, `tests/` subfolde
* **config** - Optional - Path to a PHP Unit XML configuration file.
* **run_from** - Optional - When running PHPUnit with an XML config, the command is run from this directory
* **coverage** - Optional - Value for the `--coverage-html` command line flag.
* **path** - Optional - In cases where tests files are in a sub path of the /tests path, allows this path to be set in
the config.
* **executable** [string, optional] - Allows you to provide a path to phpunit executable

#### Running Tests By Specifying Directory

@@ -12,6 +12,7 @@ Configuration
* **user_uuid** [string, required] - https://insight.sensiolabs.com/account Your user.
* **api_token** [string, required] - https://insight.sensiolabs.com/account Your password (API token).
* **project_uuid** [string, required] - Your Project UUID.
* **executable** [string, optional] - Allows you to provide a path to insight executable

### Examples

@@ -17,13 +17,14 @@ Configuration

### Options

- username : Username of your XMPP sender account. (example : "login@server.com")
- password : Password of your XMPP sender account.
- recipients : List of your XMPP recipents account.
- server : If your server is not the same that your login server (optional, example : gtalk.google.com)
- tls : Set 1 to enable TLS connection or 0 to disable it. (optional, default is 0)
- alias : Alias of your sender account. (optional)
- date_format : `strftime` mask date format display in notification message. (optional, default is %c of strftime
* **username** : Username of your XMPP sender account. (example : "login@server.com")
* **password** : Password of your XMPP sender account.
* **recipients** : List of your XMPP recipents account.
* **server** : If your server is not the same that your login server (optional, example : gtalk.google.com)
* **tls** : Set 1 to enable TLS connection or 0 to disable it. (optional, default is 0)
* **alias** : Alias of your sender account. (optional)
* **date_format** : `strftime` mask date format display in notification message. (optional, default is %c of strftime
* **executable** [string, optional] - Allows you to provide a path to sendxmpp executable
function)

### Examples
@@ -28,6 +28,11 @@ class Builder implements LoggerAwareInterface
*/
public $ignore = [];
/**
* Defaut directory for plugins
* @var string
*/
public $directory;
/**
* @var string|null
*/
@@ -372,6 +377,11 @@ protected function setupBuild()
$this->ignore = $this->config['build_settings']['ignore'];
}
// Does the project have a global directory for plugins ?
if (isset($this->config['build_settings']['directory'])) {
$this->directory = $this->config['build_settings']['directory'];
}
$this->buildLogger->logSuccess(sprintf('Working copy created: %s', $this->buildPath));
return true;
@@ -12,6 +12,8 @@
class Atoum extends Plugin
{
/**
* Allows you to provide a path to the Atom binary (defaults to PHP Censor root)
*
* @var string
*/
protected $executable;
@@ -27,7 +29,8 @@ class Atoum extends Plugin
protected $config;
/**
* @var string
*
* @var This option lets you specify the tests directory to run.
*/
protected $directory;
@@ -45,11 +48,15 @@ public static function pluginName()
public function __construct(Builder $builder, Build $build, array $options = [])
{
parent::__construct($builder, $build, $options);
$this->directory = $this->builder->directory;
$this->directory = $this->getWorkingDirectory($options);
if (isset($options['directory']) && !empty($options['directory'])) {
$this->directory = $this->getWorkingDirectory($options);
}
if (isset($options['executable'])) {
$this->executable = $this->builder->buildPath . $options['executable'];
$this->executable = $options['executable'];
} else {
$this->executable = $this->findBinary('atoum');
}
@@ -81,14 +88,15 @@ public function execute()
}
if ($this->directory !== null) {
$cmd .= " -d '{$this->directory}'";
$cmd .= " --directories '{$this->directory}'";
}
chdir($this->builder->buildPath);
$status = true;
$this->builder->executeCommand($cmd);
$output = $this->builder->getLastOutput();
if (count(preg_grep("/Success \(/", $output)) == 0) {
@@ -14,7 +14,15 @@
*/
class Behat extends Plugin
{
/**
* @var string
*/
protected $features;
/**
* @var string
*/
protected $executable;
/**
@@ -31,15 +39,15 @@ public static function pluginName()
public function __construct(Builder $builder, Build $build, array $options = [])
{
parent::__construct($builder, $build, $options);
$this->features = '';
if (isset($options['executable'])) {
$this->executable = $options['executable'];
$this->executable = $options['executable'];
} else {
$this->executable = $this->findBinary('behat');
$this->executable = $this->findBinary('behat');
}
$this->features = '';
if (!empty($options['features'])) {
$this->features = $options['features'];
}
@@ -53,15 +61,13 @@ public function execute()
$currentDir = getcwd();
chdir($this->builder->buildPath);
$behat = $this->executable;
if (!$behat) {
if (!$this->executable) {
$this->builder->logFailure(sprintf('Could not find %s', 'behat'));
return false;
}
$success = $this->builder->executeCommand($behat . ' %s', $this->features);
$success = $this->builder->executeCommand($this->executable . ' %s', $this->features);
chdir($currentDir);
list($errorCount, $data) = $this->parseBehatOutput();
Oops, something went wrong.

0 comments on commit 9c9f739

Please sign in to comment.