This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.coffee
66 lines (55 loc) · 1.59 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
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# CoffeeScript compilation
coffee:
spec:
options:
bare: true
expand: true
cwd: 'spec'
src: ['**.coffee']
dest: 'spec'
ext: '.js'
# Browser version building
noflo_browser:
build:
files:
'browser/flowcopter.js': ['package.json']
# JavaScript minification for the browser
uglify:
options:
report: 'min'
noflo:
files:
'./browser/flowcopter.min.js': ['./browser/flowcopter.js']
# Automated recompilation and testing when developing
watch:
files: ['spec/*.coffee', 'components/*.coffee']
tasks: ['test']
# BDD tests on Node.js
cafemocha:
nodejs:
src: ['spec/*.coffee']
options:
reporter: 'dot'
# Coding standards
coffeelint:
components: ['components/*.coffee']
# Grunt plugins used for building
@loadNpmTasks 'grunt-contrib-coffee'
@loadNpmTasks 'grunt-noflo-browser'
@loadNpmTasks 'grunt-contrib-uglify'
# Grunt plugins used for testing
@loadNpmTasks 'grunt-coffeelint'
# Our local tasks
@registerTask 'build', 'Build NoFlo for the chosen target platform', (target = 'all') =>
@task.run 'coffee'
if target is 'all' or target is 'browser'
@task.run 'noflo_browser'
@task.run 'uglify'
@registerTask 'test', 'Build NoFlo and run automated tests', (target = 'all') =>
@task.run 'coffeelint'
@task.run "build:#{target}"
@registerTask 'default', ['test']