mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 17:33:18 +00:00
Add Gulp build task
This commit is contained in:
parent
b90b803fcb
commit
b1a5bb8902
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||
|
@ -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({
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user