@@ -16,7 +16,7 @@ var merge = require('merge');
1616var merge2 = require ( 'merge2' ) ;
1717var path = require ( 'path' ) ;
1818var semver = require ( 'semver' ) ;
19- var watch = require ( 'gulp- watch' ) ;
19+ var watch = require ( './tools/build/ watch' ) ;
2020
2121var clean = require ( './tools/build/clean' ) ;
2222var transpile = require ( './tools/build/transpile' ) ;
@@ -222,9 +222,7 @@ gulp.task('build/checkCircularDependencies', function (done) {
222222// ------------------
223223// web servers
224224gulp . task ( 'serve.js.dev' , [ 'build.js.dev' ] , function ( neverDone ) {
225- watch ( 'modules/**' , function ( ) {
226- gulp . start ( '!broccoli.js.dev' ) ;
227- } ) ;
225+ watch ( 'modules/**' , '!broccoli.js.dev' ) ;
228226
229227 jsserve ( gulp , gulpPlugins , {
230228 path : CONFIG . dest . js . dev . es5 ,
@@ -304,7 +302,7 @@ function createDocsTasks(publicBuild) {
304302
305303 gulp . task ( taskPrefix , [ taskPrefix + '/assets' , taskPrefix + '/app' , taskPrefix + '/dgeni' ] ) ;
306304 gulp . task ( taskPrefix + '/watch' , function ( ) {
307- return watch ( 'docs/app/**/*' , [ taskPrefix + '/app' ] ) ;
305+ return watch ( 'docs/app/**/*' , { ignoreInitial : false } , [ taskPrefix + '/app' ] ) ;
308306 } ) ;
309307
310308 gulp . task ( taskPrefix + '/test' , function ( done ) {
@@ -372,20 +370,17 @@ gulp.task('test.unit.js', ['build.js.dev'], function (neverDone) {
372370 'check-format'
373371 ) ;
374372
375- watch ( 'modules/**' , function ( ) {
376- runSequence (
377- '!broccoli.js.dev' ,
378- '!test.unit.js/karma-run'
379- ) ;
380- } ) ;
373+ watch ( 'modules/**' , [
374+ '!broccoli.js.dev' ,
375+ '!test.unit.js/karma-run'
376+ ] ) ;
381377} ) ;
382378
383379gulp . task ( 'watch.js.dev' , [ 'build.js.dev' ] , function ( neverDone ) {
384- watch ( 'modules/**' , function ( ) {
385- runSequence (
386- '!broccoli.js.dev'
387- ) ;
388- } ) ;
380+ watch ( 'modules/**' , [
381+ '!broccoli.js.dev' ,
382+ '!test.unit.js/karma-run' ,
383+ ] ) ;
389384} ) ;
390385
391386
@@ -404,19 +399,16 @@ gulp.task('!test.unit.js/karma-run', function(done) {
404399
405400
406401gulp . task ( 'test.unit.dart' , [ 'build/tree.dart' ] , function ( done ) {
407-
408402 runSequence (
409403 '!test.unit.dart/karma-server' ,
410404 '!test.unit.dart/karma-run'
411405 ) ;
412406
413- watch ( 'modules/angular2/**' , function ( ) {
414- runSequence (
415- '!build/tree.dart' ,
416- 'build/format.dart' ,
417- '!test.unit.dart/karma-run'
418- ) ;
419- } ) ;
407+ watch ( 'modules/angular2/**' , [
408+ '!build/tree.dart' ,
409+ 'build/format.dart' ,
410+ '!test.unit.dart/karma-run'
411+ ] ) ;
420412} ) ;
421413
422414gulp . task ( '!test.unit.dart/karma-run' , function ( done ) {
@@ -454,37 +446,29 @@ gulp.task('test.unit.cjs/ci', function(done) {
454446
455447
456448gulp . task ( 'test.unit.cjs' , [ 'build/clean.js' , 'build.tools' ] , function ( done ) {
457- function buildAndTest ( ) {
458- runSequence (
459- '!build.js.cjs' ,
460- 'test.unit.cjs/ci'
461- ) ;
462- }
449+ var buildAndTest = [
450+ '!build.js.cjs' ,
451+ 'test.unit.cjs/ci'
452+ ] ;
463453
464- buildAndTest ( ) ;
465-
466- watch ( 'modules/**' , buildAndTest ) ;
454+ watch ( 'modules/**' , { ignoreInitial : false } , buildAndTest ) ;
467455} ) ;
468456
469457
470458gulp . task ( 'test.unit.tools/ci' , function ( done ) {
471459 fork ( './tools/traceur-jasmine' , [ 'dist/tools/**/*.spec.js' ] , {
472460 stdio : 'inherit'
473- } ) . on ( 'close' , done ) ;
461+ } ) . on ( 'close' , done . bind ( null , null ) ) ;
474462} ) ;
475463
476464
477465gulp . task ( 'test.unit.tools' , [ 'build/clean.tools' ] , function ( done ) {
478- function buildAndTest ( ) {
479- runSequence (
480- '!build.tools' ,
481- 'test.unit.tools/ci'
482- ) ;
483- }
484-
485- buildAndTest ( ) ;
466+ var buildAndTest = [
467+ '!build.tools' ,
468+ 'test.unit.tools/ci'
469+ ] ;
486470
487- watch ( 'tools/**' , buildAndTest ) ;
471+ watch ( [ 'tools/**' , '!tools/**/test-fixtures/**' ] , { ignoreInitial : false } , buildAndTest ) ;
488472} ) ;
489473
490474
0 commit comments