-
Notifications
You must be signed in to change notification settings - Fork 19
/
Gruntfile.js
163 lines (151 loc) · 4.19 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
dirs: {
lang: 'languages',
},
makepot: {
target: {
options: {
domainPath: '/languages/', // Where to save the POT file.
mainFile: 'flowplayer.css', // Main project file.
potFilename: 'flowplayer5.pot', // Name of the POT file.
type: 'wp-plugin', // Type of project (wp-plugin or wp-theme).
exclude: ['build/.*'], // List of files or directories to ignore.
processPot: function( pot, options ) {
pot.headers['report-msgid-bugs-to'] = 'https://wordpress.org/support/plugin/flowplayer5';
pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;';
pot.headers['last-translator'] = 'Ulrich Pogson <ulrich@pogson.com>\n';
pot.headers['language-team'] = 'Ulrich Pogson <ulrich@pogson.com>\n';
pot.headers['x-poedit-basepath'] = '.\n';
pot.headers['x-poedit-language'] = 'English\n';
pot.headers['x-poedit-country'] = 'UNITED STATES\n';
pot.headers['x-poedit-sourcecharset'] = 'utf-8\n';
pot.headers['X-Poedit-KeywordsList'] = '__;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n';
pot.headers['x-textdomain-support'] = 'yes\n';
return pot;
}
}
}
},
exec: {
update_po_wti: { // Update WebTranslateIt translation - grunt exec:update_po_wti
cmd: 'wti pull',
cwd: 'languages/',
}
},
potomo: {
dist: {
options: {
poDel: true,
},
files: [{
expand: true,
cwd: '<%= dirs.lang %>/',
src: ['*.po'],
dest: '<%= dirs.lang %>/',
ext: '.mo',
nonull: true
}]
}
},
// Copy the plugin into the build directory
copy: {
main: {
src: [
'**',
'!node_modules/**',
'!build/**',
'!.git/**',
'!Gruntfile.js',
'!package.json',
'!composer.json',
'!.gitignore',
'!.gitmodules',
'!**/.wti',
'!*.xml',
'!*.yml',
'!**/*~'
],
dest: 'build/'
}
},
uglify: {
options: {
mangle: false
},
admin: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'admin/assets/js/', // Src matches are relative to this path.
src: ['*.js', '!*.min.js'], // Actual pattern(s) to match.
dest: 'admin/assets/js/', // Destination path prefix.
ext: '.min.js', // Dest filepaths will have this extension.
},
]
},
drive: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'frontend/assets/drive/', // Src matches are relative to this path.
src: ['*.js', '!*.min.js'], // Actual pattern(s) to match.
dest: 'frontend/assets/drive/', // Destination path prefix.
ext: '.min.js', // Dest filepaths will have this extension.
},
]
},
magnific_popup: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'frontend/assets/magnific-popup/', // Src matches are relative to this path.
src: ['*.js', '!*.min.js'], // Actual pattern(s) to match.
dest: 'frontend/assets/magnific-popup/', // Destination path prefix.
ext: '.min.js', // Dest filepaths will have this extension.
},
]
}
},
concat_css: {
options: {
// Task-specific options go here.
},
all: {
src: ['frontend/assets/css/public.css', 'frontend/assets/drive/*.css', 'frontend/assets/magnific-popup/magnific-popup.css'],
dest: 'frontend/assets/css/public-concat.css'
},
},
cssmin: {
admin: {
expand: true,
cwd: 'admin/assets/css/',
src: ['*.css', '!*.min.css'],
dest: 'admin/assets/css/',
ext: '.min.css'
},
frontend: {
expand: true,
cwd: 'frontend/assets/css/',
src: ['*.css', '!*.min.css'],
dest: 'frontend/assets/css/',
ext: '.min.css'
},
magnific_popup: {
expand: true,
cwd: 'frontend/assets/magnific-popup/',
src: ['*.css', '!*.min.css'],
dest: 'frontend/assets/magnific-popup/',
ext: '.min.css'
},
flowplayer: {
expand: true,
cwd: 'frontend/assets/css/',
src: ['*.css', '!*.min.css'],
dest: 'frontend/assets/css/',
ext: '.min.css'
}
},
});
};