From f49b611231979ae6d60b483d95080388b8b47769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Rodri=CC=81guez?= Date: Tue, 30 Aug 2016 23:45:17 +0200 Subject: [PATCH] chore: be able to install builds versions by tag closes #2224 --- gulpfile.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4cf7e79b5c..7a3e0751f5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -524,7 +524,10 @@ gulp.task('remove-example-boilerplate', function() { // either release or current build packages // Examples: // gulp install-example-angular --build // use current build packages +// gulp install-example-angular --build=2.0.0-b43f954 // use tagged packages // gulp install-example-angular // restore release packages +// +// Find the tags here: https://github.com/angular/core-builds/releases gulp.task('install-example-angular', installExampleAngular); function installExampleAngular() { @@ -535,14 +538,28 @@ function installExampleAngular() { 'platform-browser', 'platform-browser-dynamic', 'forms', 'http', 'router', 'upgrade']; + var build = argv.build; + if (build) { + if (typeof build === 'string') { + build = (build[0]==='#' ? '' : '#') + build; + } else { + build = ''; + } + } else{ + build = 'npm'; + } // Like: "angular/core-builds" or "@angular/core" - sources = libs.map( lib => argv.build ? `angular/${lib}-builds` : `@angular/${lib}`); + sources = libs.map( lib => { + return build === 'npm' + ? `@angular/${lib}` + : `git+https://github.com/angular/${lib}-builds${build}`; + }); if (argv.build) { sources.push('@angular/tsc-wrapped');} // tsc-wrapped needed for builds sources.push('@angular/router-deprecated'); - gutil.log(`Installing Angular npm packages from ${argv.build ? 'BUILD' : 'RELEASE'}`); + gutil.log(`Installing Angular packages from ${build === 'npm' ? 'NPM' : 'BUILD ' + build}`); var spawnInfo = spawnExt('rm', ['-rf', 'node_modules/@angular'], { cwd: EXAMPLES_PATH}); return spawnInfo.promise