From 50e922f37b8e2b3215d781e8e451863974dd86a2 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 13 Oct 2015 13:42:38 -0700 Subject: [PATCH] feat(build): add tasks to watch and recompile js and dart --- gulpfile.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 42efcd41cb..4797a7a8a9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -511,6 +511,10 @@ gulp.task('test.unit.js', ['build.js.dev'], function (done) { ); }); +gulp.task('watch.js.dev', ['build.js.dev'], function (done) { + watch('modules/**', ['!broccoli.js.dev']); +}); + gulp.task('test.unit.js.sauce', ['build.js.dev'], function (done) { var browserConf = getBrowsersFromCLI(); if (browserConf.isSauce) { @@ -597,6 +601,29 @@ gulp.task('test.unit.dart', function (done) { ); }); +gulp.task('watch.dart.dev', function (done) { + runSequence( + 'build/tree.dart', + 'build/pure-packages.dart', + '!build/pubget.angular2.dart', + '!build/change_detect.dart', + '!build/remove-pub-symlinks', + 'build.dart.material.css', + function(error) { + // if initial build failed (likely due to build or formatting step) then exit + // otherwise karma server doesn't start and we can't continue running properly + if (error) { + done(error); + return; + } + + watch(['modules/angular2/**'], { ignoreInitial: true }, [ + '!build/tree.dart' + ]); + } + ); +}); + gulp.task('!test.unit.dart/karma-run', function (done) { // run the run command in a new process to avoid duplicate logging by both server and runner from // a single process