Add Gulp build task

This commit is contained in:
Juan Cruz Viotti 2014-11-24 10:33:44 -04:00
parent b90b803fcb
commit b1a5bb8902
3 changed files with 23 additions and 1 deletions

1
.gitignore vendored
View File

@ -26,3 +26,4 @@ build/Release
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
build

View File

@ -1,16 +1,22 @@
path = require('path')
gulp = require('gulp')
gutil = require('gulp-util')
coffee = require('gulp-coffee')
mocha = require('gulp-mocha')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
runSequence = require('run-sequence')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
app: [ 'lib/**/*.coffee' ]
tests: 'lib/**/*.spec.coffee'
json: 'lib/**/*.json'
dirs:
build: 'build/'
gulp.task 'test', ->
gulp.src(OPTIONS.files.tests, read: false)
@ -18,6 +24,18 @@ gulp.task 'test', ->
reporter: mochaNotifierReporter.decorate('landing')
}))
gulp.task 'coffee', ->
gulp.src(OPTIONS.files.app)
.pipe(coffee()).on('error', gutil.log)
.pipe(gulp.dest(OPTIONS.dirs.build))
gulp.task 'json', ->
gulp.src(OPTIONS.files.json)
.pipe(gulp.dest(OPTIONS.dirs.build))
gulp.task 'build', (callback) ->
runSequence [ 'test', 'lint' ], [ 'json', 'coffee' ], callback
gulp.task 'lint', ->
gulp.src(OPTIONS.files.coffee)
.pipe(coffeelint({

View File

@ -26,7 +26,10 @@
"chai-as-promised": "~4.1.1",
"chai-things": "~0.2.0",
"sinon": "~1.12.1",
"sinon-chai": "~2.6.0"
"sinon-chai": "~2.6.0",
"gulp-coffee": "~2.2.0",
"gulp-util": "~3.0.1",
"run-sequence": "~1.0.2"
},
"dependencies": {
"request": "~2.47.0",