forked from pklink/ppma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·143 lines (140 loc) · 5.96 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
ppma: {
files: {
'js/ppma.min.js': [
'js/pagenav.js',
'js/import.js',
'js/login.js',
'js/sidebar.js',
'js/toggle-password.js',
'js/toggle-search.js',
'js/typeahead.js',
'js/update-entry.js',
'js/upload.js',
'js/copy-to-clipboard.js'
]
}
}
},
clean: {
release: [
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/build',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/demos',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/docs',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/requirements',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/tests',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/.gitignore',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/.mailmap',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/.travis.yml',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/CHANGELOG',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/composer.json',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/CONTRIBUTING.md',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/README',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/README.md',
'<%= pkg.name %>-<%= pkg.version %>/vendor/yiisoft/yii/UPGRADE',
'<%= pkg.name %>-<%= pkg.version %>/vendor/composer',
'<%= pkg.name %>-<%= pkg.version %>/vendor/bin',
'<%= pkg.name %>-<%= pkg.version %>/vendor/autoload.php',
'<%= pkg.name %>-<%= pkg.version %>/assets/*',
'<%= pkg.name %>-<%= pkg.version %>/protected/yiic',
'<%= pkg.name %>-<%= pkg.version %>/protected/yiic.bat',
'<%= pkg.name %>-<%= pkg.version %>/protected/yiic.php',
'<%= pkg.name %>-<%= pkg.version %>/protected/commands/',
'<%= pkg.name %>-<%= pkg.version %>/protected/messages/',
'<%= pkg.name %>-<%= pkg.version %>/protected/migrations/',
'<%= pkg.name %>-<%= pkg.version %>/protected/runtime/*',
'<%= pkg.name %>-<%= pkg.version %>/protected/tests/'
],
cleanup: [
'<%= pkg.name %>-<%= pkg.version %>/'
]
},
compress: {
zip: {
options: {
archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
},
expand: true,
src: ['<%= pkg.name %>-<%= pkg.version %>/**'],
dest: '/'
},
tar: {
options: {
archive: '<%= pkg.name %>-<%= pkg.version %>.tar.gz'
},
expand: true,
src: ['<%= pkg.name %>-<%= pkg.version %>/**'],
dest: '/'
}
},
copy: {
bower: {
files: [
{
expand: true,
cwd: 'bower_components/',
src: [
'zeroclipboard/dist/ZeroClipboard.min.map',
'zeroclipboard/dist/ZeroClipboard.min.js',
'zeroclipboard/dist/ZeroClipboard.swf'
],
dest: './js/'
}
]
},
release: {
files: [
{
expand: true,
src: [
'assets/**',
'css/**',
'js/zeroclipboard/dist/ZeroClipboard.min.map',
'js/zeroclipboard/dist/ZeroClipboard.min.js',
'js/zeroclipboard/dist/ZeroClipboard.swf',
'js/foundation.min.js',
'js/jquery-ui-1.9.2.custom.min.js',
'js/modernizr.foundation.js',
'js/ppma.min.js',
'protected/**',
'vendor/**',
'CHANGELOG',
'favicon.ico',
'index.php',
'LICENSE',
'README.md',
'robots.txt',
'UPGRADE'
],
dest: '<%= pkg.name %>-<%= pkg.version %>/'
}
]
}
},
touch: {
options: {
force: true,
mtime: true
},
release: {
src: [
'<%= pkg.name %>-<%= pkg.version %>/assets/ignore',
'<%= pkg.name %>-<%= pkg.version %>/protected/runtime/ignore'
]
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-touch');
// Default task(s).
grunt.registerTask('default', ['copy:bower', 'uglify']);
grunt.registerTask('release', ['uglify', 'copy:bower', 'copy:release', 'clean:release', 'touch:release', 'compress:zip', 'compress:tar', 'clean:cleanup']);
};