forked from commercetools/sphere-stock-import
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
95 lines (85 loc) · 2.49 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
'use strict'
module.exports = (grunt)->
# project configuration
grunt.initConfig
# load package information
pkg: grunt.file.readJSON 'package.json'
meta:
banner: "/* ===========================================================\n" +
"# <%= pkg.name %> - v<%= pkg.version %>\n" +
"# ==============================================================\n" +
"# Copyright (c) 2013 <%= pkg.author.name %>\n" +
"# Licensed under the MIT license.\n" +
"*/\n"
coffeelint:
options:
indentation:
value: 2
level: "error"
no_trailing_semicolons:
level: "error"
no_trailing_whitespace:
level: "error"
max_line_length:
level: "ignore"
default: ["Gruntfile.coffee", "src/**/*.coffee"]
clean:
default: "lib"
test: "test"
coffee:
options:
bare: true
default:
expand: true
flatten: true
cwd: "src/coffee"
src: ["*.coffee"]
dest: "lib"
ext: ".js"
test:
expand: true
flatten: true
cwd: "src/spec"
src: ["*.spec.coffee"]
dest: "test"
ext: ".spec.js"
concat:
options:
banner: "<%= meta.banner %>"
default:
expand: true
flatten: true
cwd: "lib"
src: ["*.js"]
dest: "lib"
ext: ".js"
# watching for changes
watch:
default:
files: ["src/coffee/*.coffee"]
tasks: ["build"]
test:
files: ["src/**/*.coffee"]
tasks: ["test"]
shell:
options:
stdout: true
stderr: true
failOnError: true
jasmine:
command: "jasmine-node --captureExceptions test"
coverage:
command: "istanbul cover jasmine-node --captureExceptions test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
run:
command: "node lib/run.js stock.xml"
# load plugins that provide the tasks defined in the config
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-shell"
# register tasks
grunt.registerTask "build", ["clean", "coffeelint", "coffee", "concat"]
grunt.registerTask "test", ["build", "shell:jasmine"]
grunt.registerTask "coverage", ["build", "shell:coverage"]