From 6117a7037bc927bbac71e885bba272f061cde091 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Mon, 5 Oct 2015 16:28:53 -0700 Subject: [PATCH] chore(build): copy bundles so they can be used with e2e tests --- gulpfile.js | 16 ++++++++++++++++ tools/broccoli/trees/browser_tree.ts | 3 ++- tools/broccoli/trees/dart_tree.ts | 1 + tools/broccoli/trees/node_tree.ts | 3 ++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6a5c31d84a..eb8e3e9bdd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1260,6 +1260,21 @@ gulp.task('!bundle.web_worker.js.dev.deps', ['!bundle.web_worker.js.dev'], funct addDevDependencies("web_worker/worker.dev.js"))); }); +// We need to duplicate the deps of bundles.js so that this task runs after +// all the bundle files are created. +gulp.task('!bundle.copy', [ + '!bundle.js.prod.deps', + '!bundle.js.dev.deps', + '!bundle.js.min.deps', + '!bundle.web_worker.js.dev.deps', + '!bundle.js.sfx.dev.deps', + '!router.bundle.js.dev' +], function () { + return merge2( + gulp.src('dist/js/bundle/*').pipe(gulp.dest('dist/js/prod/es5/bundle')), + gulp.src('dist/js/bundle/*').pipe(gulp.dest('dist/js/dev/es5/bundle'))); +}); + gulp.task('bundles.js', [ '!bundle.js.prod.deps', '!bundle.js.dev.deps', @@ -1267,6 +1282,7 @@ gulp.task('bundles.js', [ '!bundle.web_worker.js.dev.deps', '!bundle.js.sfx.dev.deps', '!router.bundle.js.dev', + '!bundle.copy', '!test.bundle.js.dev']); gulp.task('build.js', ['build.js.dev', 'build.js.prod', 'build.js.cjs', 'bundles.js', 'benchpress.bundle']); diff --git a/tools/broccoli/trees/browser_tree.ts b/tools/broccoli/trees/browser_tree.ts index bdd3313d86..47f9515250 100644 --- a/tools/broccoli/trees/browser_tree.ts +++ b/tools/broccoli/trees/browser_tree.ts @@ -165,7 +165,8 @@ module.exports = function makeBrowserTree(options, destinationPath) { return funnels; } - var htmlTree = new Funnel(modulesTree, {include: ['*/src/**/*.html'], destDir: '/'}); + var htmlTree = new Funnel(modulesTree, + {include: ['*/src/**/*.html', '**/examples/**/*.html'], destDir: '/'}); htmlTree = replace(htmlTree, { files: ['examples*/**/*.html'], patterns: [ diff --git a/tools/broccoli/trees/dart_tree.ts b/tools/broccoli/trees/dart_tree.ts index c9c11859e3..ed7f80b1fa 100644 --- a/tools/broccoli/trees/dart_tree.ts +++ b/tools/broccoli/trees/dart_tree.ts @@ -15,6 +15,7 @@ import replace from '../broccoli-replace'; var global_excludes = [ 'angular2/http*', + 'angular2/examples/*/ts/**/*', 'angular2/src/http/**/*', 'angular2/test/http/**/*', 'examples/src/http/**/*', diff --git a/tools/broccoli/trees/node_tree.ts b/tools/broccoli/trees/node_tree.ts index e0b7c45c9c..fd20621f17 100644 --- a/tools/broccoli/trees/node_tree.ts +++ b/tools/broccoli/trees/node_tree.ts @@ -26,7 +26,8 @@ module.exports = function makeNodeTree(destinationPath) { 'angular2/test/core/compiler/xhr_impl_spec.ts', 'angular2/test/core/forms/**', 'angular2/test/tools/tools_spec.ts', - 'angular1_router/**' + 'angular1_router/**', + 'angular2/examples/**/!(*_spec.ts)', ] });