-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
85 lines (81 loc) · 2.21 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const gulp = require('gulp');
const ts = require('gulp-typescript');
const jasmine = require('gulp-jasmine');
const clean = require('gulp-clean');
const runSequence = require('run-sequence');
var exec = require('child_process').exec;
var sort = require('gulp-sort');
const merge = require('merge2');
gulp.task('clean', function(next) {
runSequence('clean:extension', 'clean:webview', next);
});
gulp.task('clean:spec', function() {
const task1 = gulp.src('out/spec', {
read: false
}).pipe(clean());
return merge(task1);
});
gulp.task('clean:extension', function() {
const task1 = gulp.src('out', {
read: false
}).pipe(clean());
return merge(task1);
});
gulp.task('clean:webview', function() {
const task1 = gulp.src('ng', {
read: false
}).pipe(clean());
return merge(task1);
});
gulp.task('build-extension', function(cb) {
exec('./node_modules/typescript/bin/tsc -p ./', function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('build-webview', function(cb) {
exec('ng build --prod --aot --build-optimizer --output-hashing none', {
cwd: "./ngsrc"
}, function(err, stdout, stderr) {
cb(err);
});
});
gulp.task('cassandra-start', function(cb) {
exec('npm run cassandra-start', {
// cwd: "./ngsrc"
}, function(err, stdout, stderr) {
cb(err);
});
});
gulp.task('cassandra-stop', function(cb) {
exec('npm run cassandra-stop', {
// cwd: "./ngsrc"
}, function(err, stdout, stderr) {
cb(err);
});
});
gulp.task('test:run', function() {
return gulp.src('out/spec/tests/*.spec.js')
.pipe(sort({
asc: true
}))
.pipe(jasmine({
verbose: true,
config: {
random: false,
helpers: [
'out/spec/tests/helpers/**/*.js'
]
}
}))
});
gulp.task('test', [], function(next) {
runSequence('clean:spec', 'build-extension', 'test:run', next);
});
gulp.task('default', [], function(cb) {
cb();
});
gulp.task('build', [], function(cb) {
runSequence('clean', 'build-extension', 'build-webview', cb);
});