-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
89 lines (70 loc) · 1.72 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
_ = require 'underscore'
coffeeRename = (destBase, destPath) ->
destPath = destPath.replace 'src/',''
destBase + destPath.replace /\.coffee$/, '.js'
module.exports = (grunt) ->
filterGrunt = ->
gruntFiles = require("matchdep").filterDev("grunt-*")
_.reject gruntFiles, (x) -> x is 'grunt-cli'
filterGrunt().forEach grunt.loadNpmTasks
config =
coffee:
compile:
options:
sourceMap: true
files: grunt.file.expandMapping(['src/**/*.coffee'], 'lib/', {rename: coffeeRename })
shell:
options:
stdout: true
npm_install:
command: "npm install"
release: {}
env:
test:
NODE_ENV: "test"
mochaTest:
test:
options:
reporter: 'spec'
require: 'coffee-script/register'
timeout: 10000
src: ['test/**/*-tests.coffee']
mochacov:
options:
coveralls:
repoToken: "55q8XphkrUC3SncPYMl9zYX8uqcm8WtQw"
require: ['coffee-script/register','should']
all: ['test/**/*-tests.coffee']
config.watch =
scripts:
files: ['src/**/*.coffee']
tasks: ['build']
options:
livereload: false
tests:
files: ['test/**/*.coffee']
tasks: ['build']
options:
livereload: false
grunt.initConfig config
grunt.registerTask "install", [
"shell:npm_install"
]
grunt.registerTask "build", [
'coffee'
'test'
]
grunt.registerTask "test", [
'env:test'
'mochaTest:test'
]
grunt.registerTask "testandcoverage", [
'env:test'
'mochaTest:test'
'mochacov'
]
grunt.registerTask 'deploy', [
'test'
'release'
]
grunt.registerTask 'default', ['build', 'watch']