forked from Kyusung4698/node-auto-launch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.coffee
33 lines (27 loc) · 977 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
32
33
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 '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', gulp.series('compile', =>
gulp.src(tests)
.pipe $.mocha
reporter: 'spec'
)
gulp.task 'default', gulp.series('compile')