-
Notifications
You must be signed in to change notification settings - Fork 55
/
Gruntfile.js
109 lines (104 loc) · 2.12 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* global module */
module.exports = function(grunt) {
var cfg = {
pkg: grunt.file.readJSON('package.json'),
phplint: {
files: [
'*.php',
'**/*.php'
]
},
jshint: {
options: grunt.file.readJSON('.jshintrc'),
src: [
'js/**/*.js',
'modules/**/*.js',
// External libraries:
'!js/utils/caret.js',
'!js/utils/cocktail.js',
'!js/utils/enquire.js',
'!js/utils/jquery.highlight.js',
'!js/utils/jquery.hotkeys.js',
'!js/utils/jquery.placeholder.js',
'!js/utils/moment.js'
]
},
sass: {
options: {
'outputStyle': 'expanded',
implementation: require('sass'),
},
dist: {
files: {
'css/style.css': 'css/style.scss'
}
}
},
makepot: {
o2: {
options: {
domainPath: '/languages',
exclude: [
'node_modules'
],
mainFile: 'o2.php',
potFilename: 'o2.pot'
}
}
},
addtextdomain: {
o2: {
options: {
textdomain: 'o2'
},
files: {
src: [
'*.php',
'**/*.php',
'!node_modules/**'
]
}
}
},
rtlcss: {
o2: {
src: 'css/style.css',
dest: 'css/style-rtl.css'
},
modules: {
expand: true,
cwd: 'modules',
dest: 'modules/',
ext: '-rtl.css',
src: ['**/css/style.css']
}
},
phpunit: {
'default': {
cmd: 'phpunit',
args: ['-c', 'phpunit.xml.dist']
}
}
};
grunt.initConfig( cfg );
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-wp-i18n');
grunt.loadNpmTasks('grunt-rtlcss');
grunt.registerTask('default', [
'phplint',
'jshint',
'sass',
'rtlcss'
]);
grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests.', function() {
grunt.util.spawn({
cmd: this.data.cmd,
args: this.data.args,
opts: {stdio: 'inherit'}
}, this.async());
});
grunt.registerTask( 'travis:lint', 'Runs code linting Travis CI tasks', [ 'phplint', 'jshint' ] );
grunt.registerTask( 'travis:phpunit', 'Runs PHPUnit Travis CI tasks.', 'phpunit' );
};