1 | module.exports = ->
|
2 |
|
3 | @initConfig
|
4 | pkg: @file.readJSON 'package.json'
|
5 |
|
6 |
|
7 | peg:
|
8 | fbp:
|
9 | grammar: 'grammar/fbp.peg'
|
10 | outputFile: 'lib/fbp.js'
|
11 |
|
12 |
|
13 | component_build:
|
14 | 'fbp':
|
15 | output: './browser/'
|
16 | config: './component.json'
|
17 | scripts: true
|
18 | styles: false
|
19 |
|
20 |
|
21 | uglify:
|
22 | options:
|
23 | report: 'min'
|
24 | noflo:
|
25 | files:
|
26 | './browser/fbp.min.js': ['./browser/fbp.js']
|
27 |
|
28 |
|
29 | watch:
|
30 | files: ['spec/*.coffee', 'grammar/*.peg']
|
31 | tasks: ['test']
|
32 |
|
33 |
|
34 | cafemocha:
|
35 | nodejs:
|
36 | src: ['spec/*.coffee']
|
37 |
|
38 |
|
39 | coffee:
|
40 | spec:
|
41 | options:
|
42 | bare: true
|
43 | expand: true
|
44 | cwd: 'spec'
|
45 | src: ['**.coffee']
|
46 | dest: 'spec'
|
47 | ext: '.js'
|
48 |
|
49 |
|
50 | mocha_phantomjs:
|
51 | all: ['spec/runner.html']
|
52 |
|
53 |
|
54 | @loadNpmTasks 'grunt-peg'
|
55 | @loadNpmTasks 'grunt-component-build'
|
56 | @loadNpmTasks 'grunt-contrib-uglify'
|
57 |
|
58 |
|
59 | @loadNpmTasks 'grunt-cafe-mocha'
|
60 | @loadNpmTasks 'grunt-contrib-coffee'
|
61 | @loadNpmTasks 'grunt-mocha-phantomjs'
|
62 | @loadNpmTasks 'grunt-contrib-watch'
|
63 |
|
64 | @registerTask 'build', ['peg', 'component_build', 'uglify']
|
65 | @registerTask 'test', ['build', 'coffee', 'cafemocha', 'mocha_phantomjs']
|
66 | @registerTask 'default', ['build']
|