diff --git a/slush/default/templates/Gulpfile.js b/slush/default/templates/Gulpfile.js index 574691c..0a126ae 100644 --- a/slush/default/templates/Gulpfile.js +++ b/slush/default/templates/Gulpfile.js @@ -3,38 +3,23 @@ var gulp = require('gulp'); var shell = require('gulp-shell'); var mkdirp = require('mkdirp'); -var watching = false; - -gulp.on('err', function errHandler(err) { - process.emit('exit', err.err); -}); - -process.on('exit', function(err) { - process.nextTick(function() { - if(!watching){ - process.exit(err.code); - } - }); -}); - -gulp.task('create-artifacts-dir', function() { +function createArtifactDirs() { mkdirp('artifacts/js'); mkdirp('artifacts/test'); -}); - -gulp.task('build-js', shell.task('haxe targets/js.hxml')); +} -gulp.task('build', ['create-artifacts-dir', 'build-js']); +function watch() { + var watchDirs = ['src/**/*.hx', 'test/**/*.hx', 'targets/**']; + gulp.watch(watchDirs, ['test']); +} -gulp.task('test', function() { - return gulp - .src('') - .pipe(shell('haxelib run munit test -result-exit-code')); -}); +gulp.task('create-artifacts-dir', createArtifactDirs); +gulp.task('build-js', shell.task('haxe targets/js.hxml')); +gulp.task('test', shell.task('haxelib run munit test -result-exit-code')); +gulp.task('test-coverage', shell.task('haxelib run munit test -coverage -result-exit-code')); -gulp.task('test-coverage', shell.task('haxelib run munit test -coverage')); +gulp.task('watch', watch); -gulp.task('watch', function() { - watching = true; - gulp.watch(['src/**/*.hx', 'test/**/*.hx', 'targets/**'], ['test']); -}); +gulp.task('build', ['create-artifacts-dir', 'build-js']); +gulp.task('ci', ['test-coverage', 'build']); +gulp.task('default', ['ci']); diff --git a/slush/default/templates/_travis.yml b/slush/default/templates/_travis.yml index c151ced..f46714a 100644 --- a/slush/default/templates/_travis.yml +++ b/slush/default/templates/_travis.yml @@ -1,8 +1,4 @@ language: haxe -cache: - apt: true - directories: - - node_modules before_install: - npm install @@ -10,12 +6,7 @@ before_install: install: true -before_script: - - gulp create-artifacts-dir - - gulp test - -hxml: - - targets/js.hxml +script: gulp #whitelist only the master branch branches: