2014-10-31 13:48:53 +00:00
|
|
|
path = require('path')
|
2014-10-31 13:37:29 +00:00
|
|
|
gulp = require('gulp')
|
2014-12-30 13:44:03 +00:00
|
|
|
coffee = require('gulp-coffee')
|
2014-10-31 13:48:53 +00:00
|
|
|
coffeelint = require('gulp-coffeelint')
|
2014-12-30 17:12:18 +00:00
|
|
|
shell = require('gulp-shell')
|
|
|
|
packageJSON = require('./package.json')
|
2014-10-31 13:37:29 +00:00
|
|
|
|
|
|
|
OPTIONS =
|
2014-10-31 13:50:50 +00:00
|
|
|
config:
|
|
|
|
coffeelint: path.join(__dirname, 'coffeelint.json')
|
|
|
|
files:
|
|
|
|
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
|
2014-11-26 13:20:36 +00:00
|
|
|
app: [ 'lib/**/*.coffee', '!lib/**/*.spec.coffee' ]
|
2014-12-24 19:12:31 +00:00
|
|
|
directories:
|
2014-12-30 13:44:03 +00:00
|
|
|
build: 'build/'
|
2014-12-24 19:12:31 +00:00
|
|
|
|
2016-01-21 14:16:54 +00:00
|
|
|
gulp.task 'coffee', [ 'lint' ], ->
|
2014-12-30 13:44:03 +00:00
|
|
|
gulp.src(OPTIONS.files.app)
|
|
|
|
.pipe(coffee())
|
|
|
|
.pipe(gulp.dest(OPTIONS.directories.build))
|
|
|
|
|
2014-10-31 13:48:53 +00:00
|
|
|
gulp.task 'lint', ->
|
2014-10-31 13:50:50 +00:00
|
|
|
gulp.src(OPTIONS.files.coffee)
|
|
|
|
.pipe(coffeelint({
|
|
|
|
optFile: OPTIONS.config.coffeelint
|
|
|
|
}))
|
|
|
|
.pipe(coffeelint.reporter())
|
2014-10-31 13:48:53 +00:00
|
|
|
|
2014-12-24 19:12:31 +00:00
|
|
|
gulp.task 'build', [
|
2015-02-26 15:46:57 +00:00
|
|
|
'coffee'
|
2014-12-24 19:12:31 +00:00
|
|
|
]
|
|
|
|
|
2016-01-21 14:16:54 +00:00
|
|
|
gulp.task 'watch', [ 'lint', 'coffee' ], ->
|
2015-08-04 14:00:09 +00:00
|
|
|
gulp.watch([ OPTIONS.files.coffee ], [ 'coffee' ])
|