This repository has been archived by the owner on Apr 26, 2018. It is now read-only.
/
Gruntfile.coffee
77 lines (66 loc) · 2 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
lib:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'lib'
ext: '.js'
dist:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'dist'
ext: '.js'
coffeelint:
options:
no_empty_param_list:
level: 'error'
max_line_length:
level: 'ignore'
src: ['src/*.coffee']
test: ['spec/*.coffee']
gruntfile: ['Gruntfile.coffee']
shell:
browserify:
command: 'node_modules/.bin/browserify -t coffeeify spec/spec-helper.coffee -o spec/spec-helper.js'
options:
stdout: true
stderr: true
failOnError: true
test:
command: 'node_modules/.bin/coffee spec/headless-spec-runner.coffee'
options:
stdout: true
stderr: true
failOnError: true
'update-atomdoc':
command: 'npm update grunt-atomdoc'
options:
stdout: true
stderr: true
failOnError: true
connect:
server:
options:
port: 1337
keepalive: true
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-atomdoc')
grunt.registerTask 'clean', ->
rm = (pathToDelete) ->
grunt.file.delete(pathToDelete) if grunt.file.exists(pathToDelete)
rm('lib')
rm('spec/spec-helper.js')
rm('api.json')
grunt.registerTask('lint', ['coffeelint'])
grunt.registerTask('test', ['default', 'shell:browserify', 'shell:test'])
grunt.registerTask('start', ['default', 'shell:browserify', 'connect'])
grunt.registerTask('bower', ['coffee:dist', 'lint'])
grunt.registerTask('prepublish', ['clean', 'coffee:lib', 'lint', 'shell:update-atomdoc', 'atomdoc'])
grunt.registerTask('default', ['coffee:lib', 'lint'])