Created
October 29, 2013 20:39
-
-
Save Melindrea/7222188 to your computer and use it in GitHub Desktop.
PHP tasks for grunt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' | |
module.exports = function (grunt) { | |
// show elapsed time at the end | |
require('time-grunt')(grunt); | |
// load all grunt tasks | |
require('load-grunt-tasks')(grunt); | |
// configurable paths | |
var yeomanConfig = { | |
app: 'app/src', | |
dist: 'public_html/assets', | |
php: 'app' | |
}; | |
grunt.initConfig({ | |
yeoman: yeomanConfig, | |
phplint: { | |
options: { | |
swapPath: '/tmp' | |
}, | |
all: [ | |
'<%= yeoman.php %>/**/*.php' | |
] | |
}, | |
phpcs: { | |
application: { | |
dir: '<%= yeoman.php %>' | |
}, | |
tests: { | |
dir: 'test/phpunit' | |
}, | |
options: { | |
bin: 'composer_components/bin/phpcs', | |
standard: 'PSR2', | |
ignore: 'database', | |
extensions: 'php' | |
} | |
}, | |
phpunit: { | |
classes: { | |
dir: 'test/phpunit/tests' | |
}, | |
options: { | |
bin: 'composer_components/bin/phpunit', | |
bootstrap: 'bootstrap/autoload.php', | |
staticBackup: false, | |
colors: true, | |
noGlobalsBackup: false | |
} | |
} | |
}); | |
grunt.registerTask('default', [ | |
'phplint', | |
'phpcs', | |
'phpunit' | |
]); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "php-for-grunt", | |
"version": "0.0.0", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"load-grunt-tasks": "~0.1.0", | |
"time-grunt": "~0.1.1", | |
"grunt-phplint": "~0.0.5", | |
"grunt-phpunit": "~0.3.0", | |
"grunt-phpcs": "~0.2.0" | |
}, | |
"engines": { | |
"node": ">=0.8.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment