-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
102 lines (79 loc) · 1.9 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
_ = 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:
dev:
NODE_ENV: "development"
test:
NODE_ENV: "test"
codo:
options:
undocumented: true
private: true
analytics: false
src: ['src/**/*.coffee']
mochaTest:
test:
options:
reporter: 'spec'
require: 'coffee-script/register'
src: ['test/**/*-tests.coffee']
mochacov:
options:
coveralls:
repoToken: "prOEjZYLBWKXz5mRxWsUUQHo6twKT2Vie"
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", [
'env:dev'
'codo'
'coffee'
'test'
]
grunt.registerTask "test", [
'env:test'
'mochaTest:test'
]
grunt.registerTask "testandcoverage", [
'env:test'
'mochaTest:test'
'mochacov'
]
grunt.registerTask 'deploy', [
'build'
'release'
]
grunt.registerTask 'default', ['build', 'watch']