-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
31 lines (25 loc) · 855 Bytes
/
gulpfile.js
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
const gulp = require('gulp')
const haxe = require('gulp-haxe')
const sourcemaps = require('gulp-sourcemaps')
const shell = require('gulp-shell')
gulp.task('compile', function() {
return haxe('build.hxml')
//.pipe(sourcemaps.init())
//.pipe(uglify()) //uncomment this to uglify the output js
//.pipe(sourcemaps.write())
.pipe(gulp.dest('dest'))
.pipe(shell(["./compile-tests.sh"]))
})
gulp.task('watch', function() {
gulp.watch(['src/**/*.hx', 'test/**/*hx'], ['compile'])
})
gulp.task('compile-and-run-tests', function() {
return gulp.src('').pipe(
shell(["./compile-tests.sh && ava dest/test"])
)
})
gulp.task('watch-tests', function() {
gulp.watch(['test/**/*hx', 'src/**/*.hx'], ['compile-and-run-tests'])
})
gulp.task('default', ['compile', 'watch'])
gulp.task('test', ['compile-and-run-tests', 'watch-tests'])