-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.coffee
78 lines (69 loc) · 1.87 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
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# BDD tests on Node.js
mochaTest:
nodejs:
src: ['spec/*.coffee']
options:
reporter: 'spec'
require: 'coffee-script/register'
#grep: 'alt layout'
# Coding standards
coffeelint:
components: [
'*.coffee'
'lib/*.coffee'
]
options:
'max_line_length':
'level': 'ignore'
# Building for browser
browserify:
helloworld:
options:
browserifyOptions:
extensions: ['.coffee']
standalone: 'helloworld'
files:
'browser/dist/helloworld.js': ['examples/helloworld/index.coffee']
lib:
options:
browserifyOptions:
extensions: ['.coffee']
standalone: 'flowerflip'
files:
'browser/dist/flowerflip.js': ['index.coffee']
spec:
options:
browserifyOptions:
extensions: ['.coffee']
standalone: 'spec'
files:
'browser/dist/spec.js': ['spec/*.coffee']
# BDD tests on browser
mocha_phantomjs:
all:
options:
output: 'spec/result.xml'
reporter: 'spec'
failWithOutput: true
urls: ['spec/runner.html']
# Grunt plugins used for testing
@loadNpmTasks 'grunt-mocha-test'
@loadNpmTasks 'grunt-coffeelint'
@loadNpmTasks 'grunt-mocha-phantomjs'
# Grunt plugins for deploying layout filter
@loadNpmTasks 'grunt-browserify'
@registerTask 'build-helloworld', ['browserify:helloworld']
@registerTask 'build-lib', ['browserify:lib']
@registerTask 'build', ['build-lib', 'build-helloworld']
@registerTask 'test', [
'coffeelint'
'mochaTest'
'build'
'browserify:spec'
'mocha_phantomjs'
]
@registerTask 'default', ['test']