-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gulpfile.coffee
41 lines (35 loc) · 1.14 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
coffee = require 'gulp-coffee'
coveralls = require 'gulp-coveralls'
gulp = require 'gulp'
gutil = require 'gulp-util'
istanbul = require 'gulp-istanbul'
mocha = require 'gulp-mocha'
path = require 'path'
uglify = require 'gulp-uglifyjs'
verb = require 'gulp-verb'
destDir = path.dirname require('./package.json').main
gulp.task 'docs', ->
# sadly, verb is broken
gulp.src ['.verbrc.md']
.pipe verb dest:'README.md'
.pipe gulp.dest './'
gulp.task 'test', ->
gulp.src './src/*.js'
.pipe istanbul()
.on 'finish',->
gulp.src './test/*.{js,coffee,litcoffee}', read:false
.pipe mocha
reporter: 'spec'
compilers: 'coffee:coffee-script/register'
.pipe istanbul.writeReports()
gulp.task 'coveralls', ['test'], ->
gulp.src 'coverage/**/lcov.info'
.pipe coveralls()
gulp.task 'compile',->
gulp.src './src/*.{coffee,litcoffee}'
.pipe coffee bare:false
.on 'error', gutil.log
.pipe gulp.dest destDir
.pipe uglify(path.basename(require('./package.json').main).replace('.js','.min.js'))
.pipe gulp.dest destDir
gulp.task 'default', ['compile','test', 'coveralls'] #, 'docs'