import * as gulp from 'gulp' ; import * as util from 'gulp-util' ; import * as runSequence from 'run-sequence' ; import Config from './tools/config' ; import { loadTasks } from './tools/utils' ; loadTasks ( Config . SEED_TASKS_DIR ) ; loadTasks ( Config . PROJECT_TASKS_DIR ) ; gulp . task ( 'build.dev' , ( done ) => runSequence ( 'clean.once' , 'build.assets.dev' , 'build.html_css' , 'build.js.dev' , 'build.index.dev' , done ) ) ; gulp . task ( 'build.dev.watch' , ( done ) => runSequence ( 'build.dev' , 'watch.dev' , done ) ) ; gulp . task ( 'build.e2e' , ( done ) => runSequence ( 'clean.e2e' , 'tslint' , 'build.js.e2e' , done ) ) ; gulp . task ( 'build.prod' , ( done ) => runSequence ( 'check.tools' , 'clean.prod' , 'tslint' , 'build.assets.prod' , 'build.html_css' , 'copy.prod' , 'build.js.prod' , 'build.bundles' , 'build.bundles.app' , 'minify.bundles' , 'build.index.prod' , done ) ) ; gulp . task ( 'build.prod.exp' , ( done ) => runSequence ( 'check.tools' , 'clean.prod' , 'tslint' , 'build.assets.prod' , 'build.html_css' , 'copy.prod' , 'compile.ahead.prod' , 'build.js.prod.exp' , 'build.bundles' , 'build.bundles.app.exp' , 'minify.bundles' , 'build.index.prod' , done ) ) ; gulp . task ( 'build.test' , ( done ) => runSequence ( 'clean.once' , 'build.assets.dev' , 'build.html_css' , 'build.js.dev' , 'build.js.test' , 'build.index.dev' , done ) ) ; gulp . task ( 'test.watch' , ( done ) => runSequence ( 'build.test' , 'watch.test' , 'karma.watch' , done ) ) ; gulp . task ( 'serve.dev' , ( done ) => runSequence ( 'build.dev' , 'server.start' , 'watch.dev' , done ) ) ; gulp . task ( 'serve.e2e' , ( done ) => runSequence ( 'tslint' , 'build.dev' , 'build.js.e2e' , 'server.start' , 'watch.dev' , 'watch.e2e' , done ) ) ; gulp . task ( 'serve.prod' , ( done ) => runSequence ( 'build.prod' , 'server.prod' , done ) ) ; gulp . task ( 'serve.prod.exp' , ( done ) => runSequence ( 'build.prod.exp' , 'server.prod' , done ) ) ; gulp . task ( 'test' , ( done ) => runSequence ( 'build.test' , 'karma.run' , done ) ) ; gulp . task ( 'clean.i18n' , ( done ) => runSequence ( 'clear.files' , done ) ) ; let firstRun = true ; gulp . task ( 'clean.once' , ( done ) => { if ( firstRun ) { firstRun = false ; runSequence ( 'check.tools' , 'clean.dev' , 'clean.coverage' , done ) ; } else { util . log ( 'Skipping clean on rebuild' ) ; done ( ) ; } } ) ;