fix gulp tasks for extensions-build
This commit is contained in:
parent
de05781729
commit
c4cfb09a3c
2 changed files with 44 additions and 15 deletions
|
@ -34,11 +34,17 @@ var tasks = compilations.map(function(tsconfigFile) {
|
|||
|
||||
var globRelativeDirname = path.dirname(tsconfigFile);
|
||||
var name = globRelativeDirname.replace(/\//g, '-');
|
||||
|
||||
// Tasks
|
||||
var clean = 'clean-extension:' + name;
|
||||
var compile = 'compile-extension:' + name;
|
||||
var compileBuild = 'compile-build-extension:' + name;
|
||||
var watch = 'watch-extension:' + name;
|
||||
|
||||
// Build Tasks
|
||||
var cleanBuild = 'clean-extension-build:' + name;
|
||||
var compileBuild = 'compile-extension-build:' + name;
|
||||
var watchBuild = 'watch-extension-build:' + name;
|
||||
|
||||
var pipeline = (function () {
|
||||
var reporter = quiet ? null : createReporter();
|
||||
var compilation = tsb.create(options, null, null, quiet ? null : function (err) { reporter(err.toString()); });
|
||||
|
@ -91,14 +97,6 @@ var tasks = compilations.map(function(tsconfigFile) {
|
|||
.pipe(gulp.dest(out));
|
||||
});
|
||||
|
||||
gulp.task(compileBuild, [clean], function () {
|
||||
var input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline(true))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
|
||||
gulp.task(watch, [clean], function () {
|
||||
var input = gulp.src(src, srcOpts);
|
||||
var watchInput = watcher(src, srcOpts);
|
||||
|
@ -108,15 +106,41 @@ var tasks = compilations.map(function(tsconfigFile) {
|
|||
.pipe(gulp.dest(out));
|
||||
});
|
||||
|
||||
gulp.task(cleanBuild, function (cb) {
|
||||
rimraf(out, cb);
|
||||
});
|
||||
|
||||
gulp.task(compileBuild, [clean], function () {
|
||||
var input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline(true))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
|
||||
gulp.task(watchBuild, [clean], function () {
|
||||
var input = gulp.src(src, srcOpts);
|
||||
var watchInput = watcher(src, srcOpts);
|
||||
|
||||
return watchInput
|
||||
.pipe(util.incremental(function () { return pipeline(true); }, input))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
|
||||
return {
|
||||
clean: clean,
|
||||
compile: compile,
|
||||
watch: watch,
|
||||
cleanBuild: cleanBuild,
|
||||
compileBuild: compileBuild,
|
||||
watch: watch
|
||||
watchBuild: watchBuild
|
||||
};
|
||||
});
|
||||
|
||||
gulp.task('clean-extensions', tasks.map(function (t) { return t.clean; }));
|
||||
gulp.task('compile-extensions', tasks.map(function (t) { return t.compile; }));
|
||||
gulp.task('compile-build-extensions', tasks.map(function (t) { return t.compileBuild; }));
|
||||
gulp.task('watch-extensions', tasks.map(function (t) { return t.watch; }));
|
||||
gulp.task('watch-extensions', tasks.map(function (t) { return t.watch; }));
|
||||
|
||||
gulp.task('clean-extensions-build', tasks.map(function (t) { return t.cleanBuild; }));
|
||||
gulp.task('compile-extensions-build', tasks.map(function (t) { return t.compileBuild; }));
|
||||
gulp.task('watch-extensions-build', tasks.map(function (t) { return t.watchBuild; }));
|
11
gulpfile.js
11
gulpfile.js
|
@ -105,9 +105,9 @@ gulp.task('compile-client', ['clean-client'], compileTask('out', false));
|
|||
gulp.task('watch-client', ['clean-client'], watchTask('out', false));
|
||||
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
gulp.task('clean-build', util.rimraf('out-build'));
|
||||
gulp.task('compile-build', ['clean-build'], compileTask('out-build', true));
|
||||
gulp.task('watch-build', ['clean-build'], watchTask('out-build', true));
|
||||
gulp.task('clean-client-build', util.rimraf('out-build'));
|
||||
gulp.task('compile-client-build', ['clean-client-build'], compileTask('out-build', true));
|
||||
gulp.task('watch-client-build', ['clean-client-build'], watchTask('out-build', true));
|
||||
|
||||
// Default
|
||||
gulp.task('default', ['compile']);
|
||||
|
@ -117,6 +117,11 @@ gulp.task('clean', ['clean-client', 'clean-extensions']);
|
|||
gulp.task('compile', ['compile-client', 'compile-extensions']);
|
||||
gulp.task('watch', ['watch-client', 'watch-extensions']);
|
||||
|
||||
// All Build
|
||||
gulp.task('clean-build', ['clean-client-build', 'clean-extensions-build']);
|
||||
gulp.task('compile-build', ['compile-client-build', 'compile-extensions-build']);
|
||||
gulp.task('watch-build', ['watch-client-build', 'watch-extensions-build']);
|
||||
|
||||
gulp.task('test', function () {
|
||||
return gulp.src('test/all.js')
|
||||
.pipe(mocha({ ui: 'tdd', delay: true }))
|
||||
|
|
Loading…
Reference in a new issue