-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGruntfile.js
More file actions
105 lines (96 loc) · 3 KB
/
Copy pathGruntfile.js
File metadata and controls
105 lines (96 loc) · 3 KB
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
/*jshint node: true */
"use strict";
module.exports = function (grunt) {
var pkgInfo = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkgInfo,
jshint: {
options: {
jshintrc: ".jshintrc"
},
files: {
src: [
'Gruntfile.js',
'lib/*.js',
'owax_bookmarklet/src/*.js',
'owax_ch/app/*.js',
'owax_ch/app/lib/*.js',
'!owax_ch/app/lib/colorInspector.js',
'!owax_ch/app/lib/rainbowColor.js',
'owax_ff/app/**/*.js',
'!owax_ff/app/content/scripts/colorInspector.js',
'!owax_ff/app/content/scripts/rainbowColor.js'
]
}
},
qunit: {
all: ['test/*.test.html']
},
json: {
files: {
src: ['owax_bookmarklet/_locales/ko/messages.json'],
dest: 'owax_bookmarklet/dist/locale_ko.js',
namespace: 'achecker_locale'
}
},
concat: {
openwax: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
src: [
'lib/Section.js',
'lib/Sections.js',
'lib/Score.js'
],
dest: 'release/OpenWAX-' + pkgInfo.version + '.js'
},
bookmarklet: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
src: [
'owax_bookmarklet/lib/Section.js',
'owax_bookmarklet/lib/Sections.js',
'owax_bookmarklet/lib/Score.js',
'owax_bookmarklet/dist/locale_ko.js',
'owax_bookmarklet/lib/i18n.js',
'owax_bookmarklet/src/app.js'
],
dest: 'owax_bookmarklet/dist/built.js'
}
},
exec: {
chrome: {
command: 'cd owax_ch; zip -r ../release/chrome-app-' + pkgInfo.version + '.zip app/*; cd ..'
},
firefox: {
command: 'cd owax_ff/app; zip -r ../../release/firefox-app-' + pkgInfo.version + '.xpi . -i \\*.xul -i \\*.js -i \\*.html -i \\*.properties -i \\*.dtd -i \\*.css -i \\*.png -i \\*.manifest -i \\*.rdf -x test\\* -x sample\\* -x template\\* -x \\*sample.html; cd ../..'
}
},
uglify: {
bookmarklet: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
src: ['owax_bookmarklet/dist/built.js'],
dest: 'owax_bookmarklet/dist/built.min.js'
}
}
});
// load plugins
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-json');
// default task
grunt.registerTask('default', ['jshint', 'qunit', 'json', 'concat', 'uglify', 'exec']);
};