-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
52 lines (49 loc) · 1.31 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var gulp = require('gulp');
var ts = require('gulp-typescript');
var mocha = require('gulp-mocha');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var coveralls = require('gulp-coveralls');
var cover = require('gulp-coverage');
var debug = require('gulp-debug');
var filter = require('gulp-filter');
gulp.task("copy_samples", function() {
return gulp.src("samples_html/**/*")
.pipe(gulp.dest("build/samples"));
});
gulp.task('default', ["copy_samples"], function () {
return gulp.src(['src/**/*.ts', "!src/tests/*"])
.pipe(ts({
noImplicitAny: true,
target: "ES5",
module: "amd"
}))
.pipe(gulp.dest('build'))
.pipe(uglify())
.pipe(filter("iris.js"))
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('build'));
});
gulp.task('test', function () {
return gulp.src(['src/**/*.ts', "!src/samples/**/*"])
.pipe(ts({
noImplicitAny: true,
target: "ES5",
module: "commonjs"
}))
.pipe(gulp.dest('./build_tests', { overwrite: true }))
.pipe(cover.instrument({
pattern: ['build_tests/*'],
debugDirectory: 'debug/info'
}))
.pipe(mocha())
.pipe(cover.gather())
.pipe(cover.format({
reporter: 'lcov'
}))
.pipe(coveralls())
.pipe(cover.format({
reporter: 'html'
}))
.pipe(gulp.dest('./testoutput'));
});