diff --git a/gulpfile.js b/gulpfile.js index 806a87fb69..872fafcfaa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -240,36 +240,47 @@ gulp.task('build/checkCircularDependencies', function (done) { done(); }); +function jsServeDev() { + return jsserve(gulp, gulpPlugins, { + path: CONFIG.dest.js.dev.es5, + port: 8000 + })(); +} + +function jsServeProd() { + return jsserve(gulp, gulpPlugins, { + path: CONFIG.dest.js.prod.es5, + port: 8001 + })(); +} + +function jsServeDartJs() { + return jsserve(gulp, gulpPlugins, { + path: CONFIG.dest.js.dart2js, + port: 8002 + })(); +} + // ------------------ // web servers gulp.task('serve.js.dev', ['build.js.dev'], function(neverDone) { watch('modules/**', { ignoreInitial: true }, '!broccoli.js.dev'); - - jsserve(gulp, gulpPlugins, { - path: CONFIG.dest.js.dev.es5, - port: 8000 - })(); + jsServeDev(); }); +gulp.task('serve.js.prod', jsServeProd); + gulp.task('serve.e2e.dev', ['build.js.dev', 'build.js.cjs', 'build.css.material'], function(neverDone) { - watch('modules/**', { ignoreInitial: true }, '!broccoli.js.dev'); - watch('modules/**', { ignoreInitial: true }, '!build.js.cjs'); - - jsserve(gulp, gulpPlugins, { - path: CONFIG.dest.js.dev.es5, - port: 8000 - })(); + watch('modules/**', { ignoreInitial: true }, ['!broccoli.js.dev', '!build.js.cjs']); + jsServeDev(); }); -gulp.task('serve.js.prod', jsserve(gulp, gulpPlugins, { - path: CONFIG.dest.js.prod.es5, - port: 8001 -})); +gulp.task('serve.e2e.prod', ['build.js.prod', 'build.js.cjs', 'build.css.material'], function(neverDone) { + watch('modules/**', { ignoreInitial: true }, ['!broccoli.js.prod', '!build.js.cjs']); + jsServeProd(); +}); -gulp.task('serve.js.dart2js', jsserve(gulp, gulpPlugins, { - path: CONFIG.dest.js.dart2js, - port: 8002 -})); +gulp.task('serve.js.dart2js', jsServeDartJs); gulp.task('serve/examples.dart', pubserve(gulp, gulpPlugins, { command: DART_SDK.PUB, @@ -668,6 +679,9 @@ gulp.task('!broccoli.js.dev', function() { return angularBuilder.rebuildBrowserDevTree(); }); +gulp.task('!broccoli.js.prod', function() { + return angularBuilder.rebuildBrowserProdTree(); +}); gulp.task('build.js.dev', ['build/clean.js'], function(done) { runSequence( @@ -678,8 +692,8 @@ gulp.task('build.js.dev', ['build/clean.js'], function(done) { ); }); -gulp.task('build.js.prod', ['build.tools'], function() { - return angularBuilder.rebuildBrowserProdTree(); +gulp.task('build.js.prod', ['build.tools'], function(done) { + runSequence('!broccoli.js.prod', sequenceComplete(done)); }); diff --git a/protractor-js-prod.conf.js b/protractor-js-prod.conf.js new file mode 100644 index 0000000000..0ec762bb45 --- /dev/null +++ b/protractor-js-prod.conf.js @@ -0,0 +1,3 @@ +var data = module.exports = require('./protractor-shared.js'); +var config = data.config; +config.baseUrl = 'http://localhost:8001/';