-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
58 lines (50 loc) · 1.28 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module.exports = function( grunt ) { //The wrapper function
require( 'load-grunt-tasks' )( grunt );
// Project configuration & task configuration
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
wp_readme_to_markdown: {
convert:{
files: {
'README.md': 'readme.txt'
},
options: {
'screenshot_url': 'https://ps.w.org/{plugin}/assets/{screenshot}.png',
'post_convert': function ( readme ) {
readme = '[![Build Status](https://travis-ci.org/gitlost/pap-texturize.png?branch=master)](https://travis-ci.org/gitlost/pap-texturize)\n' + readme;
return readme;
}
}
}
},
compress: {
main: {
options: {
archive: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip',
mode: 'zip'
},
files: [
{
src: [
'../pap-texturize/readme.txt',
'../pap-texturize/pap-texturize.php',
]
}
]
}
},
phpunit: {
classes: {
dir: 'tests/'
},
options: {
bin: 'WP_TESTS_DIR=/var/www/wordpress-develop/tests/phpunit phpunit',
configuration: 'phpunit.xml'
}
},
} );
// Default task(s), executed when you run 'grunt'
grunt.registerTask( 'default', [ 'wp_readme_to_markdown', 'compress' ] );
// Creating a custom task
grunt.registerTask( 'test', [ 'phpunit' ] );
};