forked from cedaro/simple-image-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
99 lines (86 loc) · 2.13 KB
/
Gruntfile.js
File metadata and controls
99 lines (86 loc) · 2.13 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*global exports:false, module:false, require:false */
module.exports = function( grunt ) {
'use strict';
require('matchdep').filterDev('grunt-*').forEach( grunt.loadNpmTasks );
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
plugin: [
'Gruntfile.js',
'assets/js/*.js',
'!assets/js/*.min.js',
]
},
makepot: {
plugin: {
options: {
mainFile: 'simple-image-widget.php',
potHeaders: {
'report-msgid-bugs-to': 'http://wordpress.org/support/plugin/simple-image-widget',
'language': 'en',
'plural-forms': 'nplurals=2; plural=(n != 1);',
'x-poedit-basepath': '../',
'x-poedit-bookmarks': '',
'x-poedit-country': 'United States',
'x-poedit-keywordslist': '__;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;',
'x-poedit-searchpath-0': '.',
'x-poedit-sourcecharset': 'utf-8',
'x-textdomain-support': 'yes'
},
type: 'wp-plugin',
updateTimestamp: false
}
}
},
watch: {
js: {
files: ['<%= jshint.plugin %>'],
tasks: ['jshint']
}
}
});
grunt.registerTask('default', ['jshint', 'watch']);
/**
* Generate documentation using ApiGen.
*
* @link http://apigen.org/
*/
grunt.registerTask('apigen', function() {
var done = this.async();
grunt.util.spawn({
cmd: 'apigen',
args: [
'--source=.',
'--destination=docs',
'--exclude=*/.git*,*/docs/*,*/node_modules/*,*/tests/*',
'--title=Simple Image Widget Documentation',
'--main=SimpleImageWdiget',
'--report=docs/_report.xml'
],
opts: { stdio: 'inherit' }
}, done);
});
/**
* PHP Code Sniffer using WordPress Coding Standards.
*
* @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
*/
grunt.registerTask('phpcs', function() {
var done = this.async();
grunt.util.spawn({
cmd: 'phpcs',
args: [
'-p',
'-s',
'--standard=WordPress',
'--extensions=php',
'--ignore=*/node_modules/*,*/tests/*',
'--report-file=codesniffs.txt',
'.'
],
opts: { stdio: 'inherit' }
}, done);
});
};