This repository has been archived by the owner on Aug 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
112 lines (106 loc) · 2.22 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
110
111
112
/*
* This file is part of the makigas corewidgets platform.
* Copyright (C) 2013-2016 Dani Rodríguez
*/
'use strict';
module.exports = function (grunt) {
// Load grunt tasks in extra modules.
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// Load project configuration
pkg: grunt.file.readJSON('package.json'),
config: {
src: 'src',
dist: 'dist'
},
clean: {
dist: ['<%= config.dist %>']
},
compress: {
dist: {
options: {
archive: '<%= pkg.name %>.<%= pkg.version %>.zip'
},
expand: true,
cwd: '<%= config.dist %>',
src: '**/*',
dest: '<%= pkg.name %>/'
}
},
copy: {
dist: {
options: {
keepSpecialComments: 1
},
files: [{
expand: true,
dot: true,
cwd: '<%= config.src %>',
dest: '<%= config.dist %>',
src: '**/*.{html,php}'
},
{
expand: true,
dest: '<%= config.dist %>',
src: 'languages/*'
}]
}
},
rsync: {
staging: {
options: {
src: './<%= config.dist %>/',
dest: '/srv/www/makigas/htdocs/wp-content/plugins/corewidgets/',
host: 'vagrant@makigas.dev',
recursive: true,
delete: true
}
}
},
pot: {
options: {
text_domain: 'makigas-corewidgets',
dest: 'languages/',
keywords: [
'__:1',
'_e:1',
'_x:1,2c',
'esc_html__:1',
'esc_html_e:1',
'esc_html_x:1,2c',
'esc_attr__:1',
'esc_attr_e:1',
'esc_attr_x:1,2c',
'_ex:1,2c',
'_n:1,2',
'_nx:1,2,4c',
'_n_noop:1,2',
'_nx_noop:1,2,3c'
]
},
files: {
src: [ 'src/**/*.php' ],
expand: true
}
},
po2mo: {
files: {
src: 'languages/*.po',
expand: true
}
}
});
grunt.registerTask('build', [
'clean:dist',
'po2mo',
'copy:dist'
]);
grunt.registerTask('dist', [
'build',
'compress'
]);
grunt.registerTask('deploy', [
'build',
'rsync:staging'
]);
};