-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
57 lines (48 loc) · 1.47 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
path = require "path"
module.exports = (grunt) ->
karmaCfg =
default:
options:
browsers: ["Chrome"]
files: ["test/jquery*.js", "test/fakeExt.coffee", "ext/linktoid.js", "test/*.css", "test/*.html", "test/*_spec.coffee"]
singleRun: not grunt.option "debug"
timeout: 120000
preprocessors:
"**/*.coffee": ["coffee"]
frameworks: ["jasmine"]
coffeeCfg =
compile:
files:
"ext/linktoid.js": "src/linktoid.coffee"
compressCfg =
public:
options:
archive: "dist/<%= pkg.name %>-<%= manifest.version %>.zip"
files: [
expand: true
cwd: "ext/"
src: ["**", "!.gitignore"]
dest: ""
]
zipToCrxCfg =
options:
privateKey: path.join process.env.USERPROFILE, ".keys", "LinkToId.pem"
default:
src: "dist/*.zip"
dest: "dist/"
cfg =
karma: karmaCfg
coffee: coffeeCfg
compress: compressCfg
zip_to_crx: zipToCrxCfg
pkg: grunt.file.readJSON "package.json"
manifest: grunt.file.readJSON "ext/manifest.json"
grunt.initConfig cfg
grunt.loadNpmTasks "grunt-karma"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-compress"
grunt.loadNpmTasks "grunt-zip-to-crx"
grunt.registerTask "compile", ["coffee"]
grunt.registerTask "test", ["compile", "karma"]
grunt.registerTask "package", ["compile", "compress"]
grunt.registerTask "crx", ["package", "zip_to_crx"]