-
Notifications
You must be signed in to change notification settings - Fork 48
/
Gruntfile.js
144 lines (133 loc) · 4.58 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
/*
* grunt-favicons
* https://github.com/gleero/grunt-favicons
*
* Copyright (c) 2013 Vladimir Perekladov
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: [
'tasks/favicons.js',
'Gruntfile.js'
],
options: {
jshintrc: '.jshintrc'
}
},
favicons: {
stage1: {
src: 'test/test.png',
dest: 'test/out'
},
stage2: {
options: {
html: 'test/out/test.html',
trueColor: true,
HTMLPrefix: "/images/icons/",
windowsTile: false,
precomposed: false,
appleTouchBackgroundColor: "#a0b4bb",
appleTouchPadding: 25,
firefox: true,
sharp: 1,
debug: true,
firefoxManifest: 'test/out/manifest.webapp',
androidHomescreen: true
},
src: 'test/test.png',
dest: 'test/out'
},
stage3: {
options: {
html: 'test/out/test.php',
HTMLPrefix: "<?= SITE_TEMPLATE_PATH; ?>/icons/",
windowsTile: true,
appleTouchPadding: 0,
tileColor: "none",
firefox: true,
firefoxRound: true,
coast: true
},
src: 'test/img.jpg',
dest: 'test/out'
},
stage4: {
options: {
html: 'test/out/test.html.twig',
HTMLPrefix: '{{ releaseDir }}/icons/',
trueColor: true,
precomposed: true,
appleTouchBackgroundColor: "#a0b4bb",
coast: true,
apple: false,
regular: false,
windowsTile: true,
tileBlackWhite: false,
tileColor: 'auto'
},
src: 'test/img.jpg',
dest: 'test/out'
},
stage5: {
options: {
html: 'test/out/test.html.indent',
trueColor: true,
HTMLPrefix: "/images/icons/",
windowsTile: false,
precomposed: false,
appleTouchBackgroundColor: "#a0b4bb",
appleTouchPadding: 25,
firefox: true,
sharp: 1,
debug: true,
firefoxManifest: 'test/out/manifest.webapp',
androidHomescreen: true,
indent: ' '
},
src: 'test/test.png',
dest: 'test/out'
}
},
copy: {
html: {
src: 'test/index.html',
dest: 'test/out/test.html'
},
php: {
src: 'test/index.html',
dest: 'test/out/test.php'
},
manifest: {
src: 'test/manifest.webapp',
dest: 'test/out/manifest.webapp'
},
indent: {
src: 'test/index.html',
dest: 'test/out/test.html.indent'
}
},
nodeunit: {
stage1: ['test/test_stage1.js'],
stage2: ['test/test_stage2.js'],
stage3: ['test/test_stage3.js'],
stage4: ['test/test_stage4.js'],
stage5: ['test/test_stage5.js']
},
clean: ['test/out']
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadTasks('tasks');
// Default options
grunt.registerTask('stage1', ['clean', 'copy', 'favicons:stage1', 'nodeunit:stage1']);
grunt.registerTask('stage2', ['clean', 'copy', 'favicons:stage2', 'nodeunit:stage2']);
grunt.registerTask('stage3', ['clean', 'copy:php', 'copy:manifest', 'favicons:stage3', 'nodeunit:stage3']);
grunt.registerTask('stage4', ['clean', 'favicons:stage4', 'nodeunit:stage4']);
grunt.registerTask('stage5', ['clean', 'copy', 'favicons:stage5', 'nodeunit:stage5']);
grunt.registerTask('test', ['jshint', 'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'clean']);
grunt.registerTask('default', ['test']);
};