Removed Gulp build script
Build process is now handled by Composer and Robo, so clean up old stuff
This commit is contained in:
parent
8c556ca509
commit
5e2dd4b6e1
65
Gulpfile.js
65
Gulpfile.js
@ -1,65 +0,0 @@
|
||||
var gulp = require('gulp');
|
||||
var clean = require('gulp-clean');
|
||||
var copy = require('gulp-copy');
|
||||
var zip = require('gulp-zip');
|
||||
var composer = require('gulp-composer');
|
||||
var phpunit = require('gulp-phpunit');
|
||||
var exec = require('child_process').exec;
|
||||
var phpcs = require('gulp-phpcs');
|
||||
var config = require('./package.json');
|
||||
|
||||
// Clean the target directory.
|
||||
gulp.task('clean', function () {
|
||||
console.log('Cleaning up target directory ...');
|
||||
return gulp.src('dist', {read: false})
|
||||
.pipe(clean());
|
||||
});
|
||||
|
||||
// Prepare composer.
|
||||
gulp.task('compose', function () {
|
||||
console.log('Preparing Composer ...');
|
||||
return composer('install');
|
||||
});
|
||||
|
||||
// Execute unit tests.
|
||||
gulp.task('test', ['compose'], function () {
|
||||
console.log('Running PHPUnit tests ...');
|
||||
return gulp.src('phpunit.xml')
|
||||
.pipe(phpunit('./vendor/bin/phpunit', {debug: false}));
|
||||
});
|
||||
|
||||
// Execute PHP Code Sniffer.
|
||||
gulp.task('test-cs', function (cb) {
|
||||
return exec('./vendor/bin/phpcs --config-set installed_paths vendor/wimg/php-compatibility,vendor/wp-coding-standards/wpcs', function (err, stdout, stderr) {
|
||||
console.log(stdout);
|
||||
console.log(stderr);
|
||||
if (null === err) {
|
||||
console.log('Running PHP Code Sniffer tests ...');
|
||||
// exec('./vendor/bin/phpcs --standard=phpcs.xml', function(err, stdout, stderr) {
|
||||
// console.log(stdout);
|
||||
// console.log(stderr);
|
||||
// });
|
||||
gulp.src(['statify-blacklist.php', 'inc/**/*.php'])
|
||||
.pipe(phpcs({bin: './vendor/bin/phpcs', standard: 'phpcs.xml'}))
|
||||
.pipe(phpcs.reporter('log'));
|
||||
}
|
||||
cb(err);
|
||||
});
|
||||
});
|
||||
|
||||
// Bundle files as required for plugin distribution..
|
||||
gulp.task('bundle', ['clean'], function () {
|
||||
console.log('Collecting files for package dist/' + config.name + config.version + ' ...');
|
||||
return gulp.src(['**/*.php', '!RoboFile.php', '!test/**', '!vendor/**', 'README.md', 'LICENSE.md'], {base: './'})
|
||||
.pipe(copy('./dist/' + config.name + '.' + config.version + '/' + config.name));
|
||||
});
|
||||
|
||||
// Create a ZIP package of the relevant files for plugin distribution.
|
||||
gulp.task('package', ['bundle'], function () {
|
||||
console.log('Building package dist/' + config.name + config.version + '.zip ...');
|
||||
return gulp.src('./dist/' + config.name + '.' + config.version + '/**')
|
||||
.pipe(zip(config.name + '.' + config.version + '.zip'))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean', 'compose', 'test', 'test-cs', 'bundle', 'package']);
|
14
package.json
14
package.json
@ -1,17 +1,7 @@
|
||||
{
|
||||
"name": "statify-blacklist",
|
||||
"version": "1.4.3",
|
||||
"version": "1.5.0-alpha",
|
||||
"description": "A blacklist extension for the famous Statify WordPress plugin",
|
||||
"author": "Stefan Kalscheuer",
|
||||
"license": "GPL-2.0+",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-clean": "^0.3.2",
|
||||
"gulp-copy": "^1.0.1",
|
||||
"gulp-zip": "^4.0.0",
|
||||
"gulp-composer": "^0.4.4",
|
||||
"gulp-phpunit": "^0.24.1",
|
||||
"gulp-phpcs": "^2.1.0",
|
||||
"child_process": "^1.0.2"
|
||||
}
|
||||
"license": "GPL-2.0+"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user