forked from Teamwork/node-auto-launch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
31 lines (26 loc) · 949 Bytes
/
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
gulp = require 'gulp'
$ = require('gulp-load-plugins')()
sourceDirectory = './src/'
testDirectory = './tests/'
scripts = sourceDirectory + '*.coffee'
tests = testDirectory + '*.coffee'
coffeeLintRules = './node_modules/teamwork-coffeelint-rules/coffeelint.json'
onCoffeelintFailure = (numberOfWarnings, numberOfErrors) =>
$.util.beep()
throw new Error """
CoffeeLint failure; see above.
Warning count: #{numberOfWarnings}.
Error count: #{numberOfErrors}.
"""
gulp.task 'default', ['compile']
gulp.task 'compile', =>
gulp.src(scripts)
.pipe($.coffeelint(optFile: coffeeLintRules))
.pipe($.coffeelint.reporter())
.pipe($.coffeelintThreshold 0, 0, onCoffeelintFailure)
.pipe($.coffee({bare:true}))
.pipe(gulp.dest('./dist'))
gulp.task 'test', ['compile'], =>
gulp.src(tests)
.pipe $.mocha
reporter: 'spec'