forked from microsoft/azure-pipelines-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 loc) · 1.2 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
var gulp = require('gulp');
var gutil = require('gulp-util');
var child_process = require('child_process');
var process = require('process');
function make (target, cb) {
var cl = ('node make.js ' + target + ' ' + process.argv.slice(3).join(' ')).trim();
console.log('------------------------------------------------------------');
console.log('> ' + cl);
console.log('------------------------------------------------------------');
try {
child_process.execSync(cl, { cwd: __dirname, stdio: 'inherit' });
}
catch (err) {
var msg = err.output ? err.output.toString() : err.message;
console.error(msg);
cb(new gutil.PluginError(msg));
return false;
}
return true;
}
gulp.task('build', function (cb) {
make('build', cb);
});
gulp.task('default', ['build']);
gulp.task('test', function (cb) {
make('test', cb);
make('testLegacy', cb);
});
gulp.task('package', function (cb) {
var publish = process.argv.filter(function (arg) { return arg == '--server' }).length > 0;
make('build', cb) &&
make('package', cb) &&
make('test', cb) &&
make('testLegacy', cb) &&
publish &&
make('publish', cb);
});