-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
111 lines (106 loc) · 2.11 KB
/
Gruntfile.coffee
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
module.exports = (grunt)->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
coffee:
options:
bare: on
main:
files: [
{
expand: on
cwd: 'src'
src: '**/*.coffee'
dest: 'dest/'
ext: '.js'
}
]
copy:
main:
files: [
{
expand: on
cwd: 'src'
src: [
'**/*'
'!**/*.coffee'
'!**/*.js'
]
dest: 'dest/'
}
]
common:
files: [
{
expand: on
cwd: 'dest/lib'
src: 'common/**/*'
dest: 'dest/data/'
}
]
js:
files: [
{
expand: on
cwd: 'src'
src: [
'lib/beautify.js'
]
dest: 'dest/'
}
]
unicode:
main:
files:[
expand: on
src: 'dest/**/*.js'
]
watch:
coffee:
files: "<%= coffee.main.files.0.src %>"
tasks: [
'generate'
]
clean:
js: 'dest/**/*.js'
xpi: 'dest/<%= pkg.name %>.xpi'
dest: 'dest/'
shell:
options:
stdout: on
stderr: on
execOptions:
cwd: 'dest'
xpi:
command: 'cfx xpi'
run:
command: 'cfx run -p ../.tmp/profile'
init:
options:
execOptions:
cwd: '.'
command: [
'rm src/package.json src/README.md'
'ln -s ../package.json src/package.json'
'ln -s ../README.md src/README.md'
].join ';'
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
grunt.registerTask 'init', ['shell:init']
grunt.registerTask 'generate', [
'clean:js'
'coffee'
'copy:common'
'copy:js'
'unicode'
]
grunt.registerTask 'xpi', [
'clean:dest'
'copy:main'
'generate'
'shell:xpi'
]
grunt.registerTask 'default', [
'clean:dest'
'copy:main'
'generate'
'shell:run'
]