@@ -451,6 +451,34 @@ gulp.task('remove-example-boilerplate', function() {
451
451
deleteExampleBoilerPlate ( ) ;
452
452
} ) ;
453
453
454
+ // Npm install Angular libraries into examples/node_modules,
455
+ // either release or current build packages
456
+ // Examples:
457
+ // gulp install-example-angular --build // use current build packages
458
+ // gulp install-example-angular // restore release packages
459
+ gulp . task ( 'install-example-angular' , installExampleAngular ) ;
460
+
461
+ function installExampleAngular ( ) {
462
+ var sources ;
463
+ var template ;
464
+ var libs = [
465
+ 'core' , 'common' , 'compiler' ,
466
+ 'platform-browser' , 'platform-browser-dynamic' ,
467
+ 'forms' , 'http' , 'router' ] ;
468
+
469
+ // Like: "angular/core-builds" or "@angular/core"
470
+ sources = libs . map ( lib => argv . build ? `angular/${ lib } -builds` : `@angular/${ lib } ` ) ;
471
+
472
+ gutil . log ( `Installing Angular npm packages from ${ argv . build ? 'BUILD' : 'RELEASE' } ` ) ;
473
+
474
+ var spawnInfo = spawnExt ( 'rm' , [ '-rf' , 'node_modules/@angular' ] , { cwd : EXAMPLES_PATH } ) ;
475
+ return spawnInfo . promise
476
+ . then ( ( ) => {
477
+ spawnInfo = spawnExt ( 'npm' , [ 'install' , ...sources ] , { cwd : EXAMPLES_PATH } ) ;
478
+ return spawnInfo . promise
479
+ } ) ;
480
+ }
481
+
454
482
// deletes boilerplate files that were added by copyExampleBoilerplate
455
483
// from locations where an example app is found
456
484
gulp . task ( '_delete-example-boilerplate' , deleteExampleBoilerPlate ) ;
@@ -602,7 +630,7 @@ gulp.task('link-checker', function(done) {
602
630
'*/dart/latest/api/*' ,
603
631
// Somehow the link checker sees ng1 {{...}} in the resource page; ignore it
604
632
'resources/%7B%7Bresource.url%7D%7D' ,
605
- // API docs have links directly into GitHub repo sources; these can
633
+ // API docs have links directly into GitHub repo sources; these can
606
634
// quickly become invalid, so ignore them for now:
607
635
'*/angular/tree/*'
608
636
] ;
@@ -786,7 +814,7 @@ function linkChecker(options) {
786
814
var outputFile = path . join ( process . cwd ( ) , 'link-checker-results.txt' ) ;
787
815
var header = 'Link checker results for: ' + siteUrl +
788
816
'\nStarted: ' + ( new Date ( ) ) . toLocaleString ( ) +
789
- '\nExcluded links (blc file globs): ' + blcOptions . excludedKeywords +
817
+ '\nExcluded links (blc file globs): ' + blcOptions . excludedKeywords +
790
818
'\nExcluded links (custom --exclude-bad regex): ' + excludeBad . toString ( ) + '\n\n' ;
791
819
gutil . log ( header ) ;
792
820
fs . writeFileSync ( outputFile , header ) ;
0 commit comments