/
Gruntfile.coffee
70 lines (56 loc) · 1.67 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
Path = require 'path'
module.exports = (grunt)->
require('grunt-recurse')(grunt, __dirname)
grunt.expandFileArg = (
prefix = '.',
base = '**',
postfix = '*test.coffee'
)->
part = (v)->"#{prefix}/#{v}#{postfix}"
files = grunt.option('files')
return part(base) unless files
files.split(',').map (v)-> part(v)
# grunt-recurse magic.
[
['.', 'src', 'features']
['.', 'src', 'server']
['.', 'src', 'client']
['.', 'src', 'deploy']
]
.map((dir)->Path.join.apply null, dir)
.map(grunt.grunt)
grunt.Config =
jshint:
options:
jshintrc: '.jshintrc'
files: [
'src/**/*.js'
'!src/client/assets/**'
]
coffeelint:
options:
grunt.file.readJSON '.coffeelintrc'
files: [
'src/**/*.coffee'
'Gruntfile.coffee'
]
clean:
all:
[ 'build/' ]
grunt.registerTask 'test',
'Run all non-component tests.',
[ 'testClient', 'testServer', 'features' ]
grunt.registerTask 'build',
'Prepare distributable components.',
[ 'client' ]
grunt.registerTask 'linting',
'Lint all files.',
[ 'jshint', 'coffeelint' ]
grunt.registerTask 'base',
'Perform component specific prep and test steps.',
[ 'clean:all', 'linting', 'client', 'server', 'deploy', 'features' ]
grunt.registerTask 'default',
'Perform all Prepare and Test tasks.',
[ 'base' ]
grunt.loadNpmTasks 'stassets'
grunt.finalize()