1 | module.exports = (grunt) ->
|
2 | pkg = grunt.file.readJSON('package.json')
|
3 | coffeelintConfig = grunt.file.readJSON('coffeelint-config.json')
|
4 |
|
5 | grunt.initConfig
|
6 |
|
7 | coffeelint:
|
8 | main:
|
9 | files:
|
10 | src: ['test/**/*.coffee', 'src/**/*.coffee']
|
11 | options: coffeelintConfig
|
12 |
|
13 | watch:
|
14 | main:
|
15 | files: ['test/**', 'src/**', 'libs/**']
|
16 | tasks: ['coffeelint', 'mochaTest']
|
17 |
|
18 | mochaTest:
|
19 | main:
|
20 | options:
|
21 | reporter: 'nyan'
|
22 | src: ['test/**/*.spec.coffee']
|
23 |
|
24 |
|
25 |
|
26 | tasks =
|
27 | build: ['test']
|
28 | default: ['testWatch']
|
29 | test: ['coffeelint', 'mochaTest']
|
30 | testWatch: ['test', 'watch']
|
31 |
|
32 | grunt.registerTask taskName, taskArray for taskName, taskArray of tasks
|
33 |
|
34 |
|
35 | grunt.loadNpmTasks name for name of pkg.devDependencies when name[0..5] is 'grunt-'
|
36 |
|