forked from ollita7/kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (42 loc) · 1.24 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
var gulp = require('gulp'),
exec = require('child_process').exec,
gulpSequence = require('gulp-sequence'),
mocha = require('gulp-mocha'),
ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json', {});
gulp.task('publish', gulpSequence('compile', 'compile-tests', 'copy', 'execute-tests', 'publish-package'));
gulp.task('test', gulpSequence('compile-tests', 'execute-tests'));
gulp.task('compile', () => {
return gulp.src(['src/**/*.ts'])
.pipe(tsProject())
.pipe(gulp.dest("release"));
});
gulp.task('compile-tests', function (cb) {
exec('npm run compile', {
}, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})
gulp.task('copy', () => {
gulp.src(['package.json', 'README.md'])
.pipe(gulp.dest('release/'));
gulp.src(['src/resources/documentation-ui/index.html'])
.pipe(gulp.dest('release/resources/documentation-ui/'));
});
gulp.task('execute-tests', function () {
return gulp.src(['dist/samples/tests/*.test.js'], { read: false })
.pipe(mocha({
reporter: 'spec'
}));
});
gulp.task('publish-package', function (cb) {
exec('npm publish', {
cwd: 'release'
}, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})