@@ -108,20 +108,21 @@ var _exampleConfigFilename = 'example-config.json';
108
108
109
109
// Gulp flags:
110
110
//
111
- // --lang=[all | ts | js | dart | ( ts|js) | ( ts|js|dart) | ...]
111
+ // --lang=[all | ts | js | dart | ' ts|js' | ' ts|js|dart' | ...]
112
112
//
113
113
// This affects which language API docs and E2E tests are run. Can be 'all',
114
114
// or a regex pattern to match any one of 'ts', 'js', or 'dart'.
115
- // Default: '(ts|js)' except for check-deploy for which it is 'all'.
115
+ // Default: 'ts|js' except for the "full site build" tasks (see below),
116
+ // for which it is 'all'.
116
117
//
117
118
var lang , langs , buildDartApiDocs = false ;
118
119
function configLangs ( langOption ) {
119
120
const fullSiteBuildTasks = [ 'build-compile' , 'check-serve' , 'check-deploy' ] ;
120
121
const buildAllDocs = argv [ '_' ] &&
121
122
fullSiteBuildTasks . some ( ( task ) => argv [ '_' ] . indexOf ( task ) >= 0 ) ;
122
- const langDefault = buildAllDocs ? 'all' : '( ts|js) ' ;
123
+ const langDefault = buildAllDocs ? 'all' : 'ts|js' ;
123
124
lang = ( langOption || langDefault ) . toLowerCase ( ) ;
124
- if ( lang === 'all' ) lang = '( ts|js|dart) ' ;
125
+ if ( lang === 'all' ) lang = 'ts|js|dart' ;
125
126
langs = lang . match ( / \w + / g) ; // the languages in `lang` as an array
126
127
gutil . log ( 'Building docs for: ' + lang ) ;
127
128
if ( langs . indexOf ( 'dart' ) >= 0 ) {
@@ -161,10 +162,8 @@ gulp.task('run-e2e-tests', runE2e);
161
162
* Use it for repeated test runs (but not the FIRST run)
162
163
* e.g. gulp e2e --fast
163
164
*
164
- * --lang to filter by code language
165
+ * --lang to filter by code language (see above for details)
165
166
* e.g. gulp e2e --lang=ts // only TypeScript apps
166
- * default is (ts|js)
167
- * all means (ts|js|dart)
168
167
*/
169
168
function runE2e ( ) {
170
169
var promise ;
@@ -596,8 +595,16 @@ gulp.task('dartdoc', ['pub upgrade'], function() {
596
595
return true ;
597
596
}
598
597
checkAngularProjectPath ( ngRepoPath ) ;
598
+ const topLevelLibFilePath = path . resolve ( ngRepoPath , 'lib' , 'angular2.dart' ) ;
599
+ const tmpPath = topLevelLibFilePath + '.disabled' ;
600
+ if ( ! fs . existsSync ( topLevelLibFilePath ) ) throw new Error ( `Missing file: ${ topLevelLibFilePath } ` ) ;
601
+ fs . renameSync ( topLevelLibFilePath , tmpPath ) ;
602
+ gutil . log ( `Hiding top-level angular2 library: ${ topLevelLibFilePath } ` ) ;
599
603
const dartdoc = spawnExt ( 'dartdoc' , [ '--output' , 'doc/api' , '--add-crossdart' ] , { cwd : ngRepoPath } ) ;
600
- return dartdoc . promise ;
604
+ return dartdoc . promise . finally ( ( ) => {
605
+ gutil . log ( `Restoring top-level angular2 library: ${ topLevelLibFilePath } ` ) ;
606
+ fs . renameSync ( tmpPath , topLevelLibFilePath ) ;
607
+ } )
601
608
} ) ;
602
609
603
610
gulp . task ( 'pub upgrade' , [ ] , function ( ) {
0 commit comments