forked from jghazally/WP-e-Commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
92 lines (82 loc) · 2.43 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
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
/*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',
'wpsc-admin/js/*.js',
'wpsc-components/marketplace-core-v1/static/*.js',
'wpsc-components/merchant-core-v3/gateways/*.js',
'wpsc-components/theme-engine-v2/admin/js/*.js',
'wpsc-components/theme-engine-v2/theming/assets/js/*.js',
'wpsc-components/merchant-core-v3/*.js',
'wpsc-core/js/*.js',
'!wpsc-core/js/tinymce/*.js',
'!wpsc-core/js/*-min.js',
'!wpsc-core/js/jquery*.js',
'!wpsc-admin/js/admin-legacy.js',
'!wpsc-admin/js/jquery-*.js'
]
},
makepot: {
target: {
options: {
domainPath: '/wpsc-languages/', // Where to save the POT file.
exclude: [
'tesst/.*',
'bin/.*',
'images/.*'
],
mainFile: 'wp-shopping-cart.php', // Main project file.
potFilename: 'wpsc.pot', // Name of the POT file.
potHeaders: {
poedit: true, // Includes common Poedit headers.
'x-poedit-keywordslist': true // Include a list of all possible gettext functions.
},
type: 'wp-plugin', // Type of project (wp-plugin or wp-theme).
updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
processPot: function( pot, options ) {
pot.headers['report-msgid-bugs-to'] = 'https://wpecommerce.org/';
pot.headers['last-translator'] = 'WP-Translations (http://wp-translations.org/)';
pot.headers['language-team'] = 'WP-Translations <[email protected]>';
pot.headers['language'] = 'en_US';
return pot;
}
}
}
},
watch: {
js: {
files: ['<%= jshint.plugin %>'],
tasks: ['jshint']
}
}
});
grunt.registerTask('default', ['jshint', 'watch', 'makepot']);
/**
* 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);
});
};