forked from ProjectMakeIt/Remote-Sign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.coffee
57 lines (51 loc) · 1.38 KB
/
Gulpfile.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
gulp = require 'gulp'
mocha = require 'gulp-mocha'
istanbul = require 'gulp-coffee-istanbul'
coveralls = require 'gulp-coveralls'
coffeelint = require 'gulp-coffeelint'
coffee = require 'gulp-coffee'
nodemon = require 'gulp-nodemon'
livereload = require 'gulp-livereload'
cached = require 'gulp-cached'
gulp.task 'default', ['test', 'lint', 'build', 'watch', 'run']
gulp.task 'watch', ['build', 'test', 'lint'], ->
livereload.listen
port: 8000
gulp.watch 'src/**/*.coffee', ['test', 'lint', 'build']
gulp.task 'run', ['watch'], ->
console.log "launching server"
nodemon
script: 'build/server/app.js'
watch: 'build/server'
gulp.task 'build', ->
gulp.src 'src/**/*.coffee'
.pipe coffee()
.pipe gulp.dest 'build'
.pipe livereload()
gulp.task 'test', (done) ->
gulp.src 'src/**/*.coffee'
.pipe istanbul
includeUntested: true
.pipe istanbul.hookRequire()
.on 'finish', ->
if process.env.CI
reporter = 'spec'
else
reporter = 'nyan'
gulp.src 'tests/**/*.coffee'
.pipe mocha
reporter:reporter
.pipe istanbul.writeReports()
.on 'end', () ->
if process.env.CI
gulp.src 'coverage/**/lcov.info'
.pipe coveralls()
.on 'finish', done
else
done()
return null
gulp.task 'lint', ->
gulp.src ['**/*.coffee','!node_modules/**/*']
.pipe coffeelint 'coffeelint.json'
.pipe coffeelint.reporter()
.pipe coffeelint.reporter 'fail'