-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
57 lines (53 loc) · 1.17 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
module.exports = function (grunt) {
grunt.initConfig({
// Define variables
pkg: grunt.file.readJSON('package.json'),
// COPY FILES - Copy needed files from build to trunk
copy: {
options: {
process(content) {
if (typeof content !== 'string') {
return content;
}
return grunt.template.process(content);
},
},
build: {
expand: true,
cwd: 'src',
src: ['**/*.md', '**/*.txt', '**/*.svg', '**/*.po', '**/*.pot', '**/*.tmpl.html', '**/*.php'],
dest: 'trunk/',
filter: 'isFile'
},
build_stream: {
expand: true,
options: {
encoding: null
},
cwd: 'src',
src: ['**/*.mo', 'img/**/*', 'fonts/**/*'],
dest: 'trunk/',
filter: 'isFile'
},
},
// COMPRESS - Create a zip file from a new trunk
compress: {
main: {
options: {
archive: 'dist/plugin/<%= pkg.name %>.<%= pkg.version %>.zip',
},
files: [
{
src: ['**'],
cwd: 'trunk',
expand: true,
dest: '<%= pkg.name %>'
},
],
},
},
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('release', ['copy', 'compress']);
};