@@ -77,15 +77,6 @@ var _apiShredOptions = {
77
77
logLevel : _dgeniLogLevel
78
78
} ;
79
79
80
- const relDartDocApiDir = path . join ( 'doc' , 'api' ) ;
81
- var _apiShredOptionsForDart = {
82
- lang : 'dart' ,
83
- examplesDir : path . resolve ( ANGULAR_PROJECT_PATH + '2_api_examples' ) ,
84
- fragmentsDir : path . join ( DOCS_PATH , '_fragments/_api' ) ,
85
- zipDir : path . join ( RESOURCES_PATH , 'zips/api' ) ,
86
- logLevel : _dgeniLogLevel
87
- } ;
88
-
89
80
var _excludePatterns = [ '**/node_modules/**' , '**/packages/**' ] ;
90
81
91
82
var _excludeMatchers = _excludePatterns . map ( function ( excludePattern ) {
@@ -624,8 +615,7 @@ gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunker
624
615
// Stop zipping examples Feb 28, 2016
625
616
//gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers', '_zip-examples']);
626
617
627
- gulp . task ( 'build-api-docs' , [ 'build-js-api-docs' , 'build-ts-api-docs' ]
628
- . concat ( buildDartApiDocs ? [ 'build-dart-api-docs' , 'build-dart-cheatsheet' ] : [ ] ) ) ;
618
+ gulp . task ( 'build-api-docs' , [ 'build-js-api-docs' , 'build-ts-api-docs' ] ) ;
629
619
630
620
gulp . task ( 'build-devguide-docs' , [ '_shred-devguide-examples' , '_shred-devguide-shared-jade' ] , function ( ) {
631
621
return buildShredMaps ( true ) ;
@@ -639,50 +629,12 @@ gulp.task('build-js-api-docs', ['_shred-api-examples'], function() {
639
629
return buildApiDocs ( 'js' ) ;
640
630
} ) ;
641
631
642
- gulp . task ( 'build-dart-api-docs' , [ '_shred-api-examples' , 'dartdoc' ] , function ( ) {
643
- return buildApiDocsForDart ( ) ;
644
- } ) ;
645
-
646
632
// Using the --build flag will use systemjs.config.web.build.js (for preview builds)
647
633
gulp . task ( 'build-plunkers' , [ '_copy-example-boilerplate' ] , function ( ) {
648
634
regularPlunker . buildPlunkers ( EXAMPLES_PATH , LIVE_EXAMPLES_PATH , { errFn : gutil . log , build : argv . build } ) ;
649
635
return embeddedPlunker . buildPlunkers ( EXAMPLES_PATH , LIVE_EXAMPLES_PATH , { errFn : gutil . log , build : argv . build , targetSelf : argv . targetSelf } ) ;
650
636
} ) ;
651
637
652
- gulp . task ( 'build-dart-cheatsheet' , [ ] , function ( ) {
653
- return buildDartCheatsheet ( ) ;
654
- } ) ;
655
-
656
- gulp . task ( 'dartdoc' , [ 'pub upgrade' ] , function ( ) {
657
- const ngRepoPath = ngPathFor ( 'dart' ) ;
658
- if ( argv . fast && fs . existsSync ( path . resolve ( ngRepoPath , relDartDocApiDir ) ) ) {
659
- gutil . log ( `Skipping dartdoc: --fast flag enabled and api dir exists (${ relDartDocApiDir } )` ) ;
660
- return true ;
661
- }
662
- checkAngularProjectPath ( ngRepoPath ) ;
663
- const topLevelLibFilePath = path . resolve ( ngRepoPath , 'lib' , 'angular2.dart' ) ;
664
- const tmpPath = topLevelLibFilePath + '.disabled' ;
665
- renameIfExistsSync ( topLevelLibFilePath , tmpPath ) ;
666
- gutil . log ( `Hiding top-level angular2 library: ${ topLevelLibFilePath } ` ) ;
667
- // Remove dartdoc '--add-crossdart' flag while we are fixing links to API pages.
668
- const dartdoc = spawnExt ( 'dartdoc' , [ '--output' , relDartDocApiDir ] , { cwd : ngRepoPath } ) ;
669
- return dartdoc . promise . finally ( ( ) => {
670
- gutil . log ( `Restoring top-level angular2 library: ${ topLevelLibFilePath } ` ) ;
671
- renameIfExistsSync ( tmpPath , topLevelLibFilePath ) ;
672
- } )
673
- } ) ;
674
-
675
- gulp . task ( 'pub upgrade' , [ ] , function ( ) {
676
- const ngRepoPath = ngPathFor ( 'dart' ) ;
677
- if ( argv . fast && fs . existsSync ( path . resolve ( ngRepoPath , 'packages' ) ) ) {
678
- gutil . log ( 'Skipping pub upgrade: --fast flag enabled and "packages" dir exists' ) ;
679
- return true ;
680
- }
681
- checkAngularProjectPath ( ngRepoPath ) ;
682
- const pubUpgrade = spawnExt ( 'pub' , [ 'upgrade' ] , { cwd : ngRepoPath } ) ;
683
- return pubUpgrade . promise ;
684
- } ) ;
685
-
686
638
gulp . task ( 'git-changed-examples' , [ '_shred-devguide-examples' ] , function ( ) {
687
639
var after , sha , messageSuffix ;
688
640
if ( argv . after ) {
@@ -863,8 +815,7 @@ gulp.task('_shred-api-examples', ['_shred-clean-api'], function() {
863
815
langs . forEach ( lang => {
864
816
if ( lang === 'js' ) return ; // JS is handled via TS.
865
817
checkAngularProjectPath ( ngPathFor ( lang ) ) ;
866
- const options = lang == 'dart' ? _apiShredOptionsForDart : _apiShredOptions ;
867
- promises . push ( docShredder . shred ( options ) ) ;
818
+ promises . push ( docShredder . shred ( _apiShredOptions ) ) ;
868
819
} ) ;
869
820
return Q . all ( promises ) ;
870
821
} ) ;
@@ -1347,72 +1298,6 @@ function buildApiDocs(targetLanguage) {
1347
1298
}
1348
1299
}
1349
1300
1350
-
1351
- function buildDartCheatsheet ( ) {
1352
- 'use strict' ;
1353
- const ALLOWED_LANGUAGES = [ 'ts' , 'js' , 'dart' ] ;
1354
- const lang = 'dart' ;
1355
- const vers = 'latest' ;
1356
- checkAngularProjectPath ( ngPathFor ( lang ) ) ;
1357
- try {
1358
- const pkg = new Package ( 'dartApiDocs' , [ require ( path . resolve ( TOOLS_PATH , 'dart-api-builder' ) ) ] ) ;
1359
- pkg . config ( function ( log , targetEnvironments , writeFilesProcessor ) {
1360
- log . level = _dgeniLogLevel ;
1361
- ALLOWED_LANGUAGES . forEach ( function ( target ) { targetEnvironments . addAllowed ( target ) ; } ) ;
1362
- targetEnvironments . activate ( lang ) ;
1363
- const outputPath = path . join ( lang , vers , 'can-be-any-name-read-comment-below' ) ;
1364
- // Note: cheatsheet data gets written to: outputPath + '/../guide';
1365
- writeFilesProcessor . outputFolder = outputPath ;
1366
- } ) ;
1367
- var dgeni = new Dgeni ( [ pkg ] ) ;
1368
- return dgeni . generate ( ) ;
1369
- } catch ( err ) {
1370
- console . error ( err ) ;
1371
- console . error ( err . stack ) ;
1372
- throw err ;
1373
- }
1374
- }
1375
-
1376
-
1377
- function buildApiDocsForDart ( ) {
1378
- const vers = 'latest' ;
1379
- const dab = require ( './tools/dart-api-builder/dab' ) ( ANGULAR_IO_PROJECT_PATH ) ;
1380
- const log = dab . log ;
1381
-
1382
- log . level = _dgeniLogLevel ;
1383
- const dabInfo = dab . dartPkgConfigInfo ;
1384
- dabInfo . ngIoDartApiDocPath = path . join ( DOCS_PATH , 'dart' , vers , 'api' ) ;
1385
- dabInfo . ngDartDocPath = path . join ( ngPathFor ( 'dart' ) , relDartDocApiDir ) ;
1386
- // Exclude API entries for developer/internal libraries. Also exclude entries for
1387
- // the top-level catch all "angular2" library (otherwise every entry appears twice).
1388
- dabInfo . excludeLibRegExp = new RegExp ( / ^ (? ! a n g u l a r 2 ) | t e s t i n g | _ | c o d e g e n | ^ a n g u l a r 2 $ / ) ;
1389
-
1390
- try {
1391
- checkAngularProjectPath ( ngPathFor ( 'dart' ) ) ;
1392
- var destPath = dabInfo . ngIoDartApiDocPath ;
1393
- var sourceDirs = fs . readdirSync ( dabInfo . ngDartDocPath )
1394
- . filter ( name => ! name . match ( / ^ i n d e x | ^ (? ! a n g u l a r 2 ) | t e s t i n g | c o d e g e n / ) )
1395
- . map ( name => path . join ( dabInfo . ngDartDocPath , name ) ) ;
1396
- log . info ( `Building Dart API pages for ${ sourceDirs . length } libraries` ) ;
1397
-
1398
- return copyFiles ( sourceDirs , [ destPath ] ) . then ( ( ) => {
1399
- log . debug ( 'Finished copying' , sourceDirs . length , 'directories from' , dabInfo . ngDartDocPath , 'to' , destPath ) ;
1400
-
1401
- const apiEntries = dab . loadApiDataAndSaveToApiListFile ( ) ;
1402
- const tmpDocsPath = path . resolve ( path . join ( process . env . HOME , 'tmp/docs.json' ) ) ;
1403
- if ( argv . dumpDocsJson ) fs . writeFileSync ( tmpDocsPath , JSON . stringify ( apiEntries , null , 2 ) ) ;
1404
- dab . createApiDataAndJadeFiles ( apiEntries ) ;
1405
- } ) . catch ( ( err ) => {
1406
- console . error ( err ) ;
1407
- } ) ;
1408
-
1409
- } catch ( err ) {
1410
- console . error ( err ) ;
1411
- console . error ( err . stack ) ;
1412
- throw err ;
1413
- }
1414
- }
1415
-
1416
1301
function buildShredMaps ( shouldWrite ) {
1417
1302
var options = {
1418
1303
devguideExamplesDir : _devguideShredOptions . examplesDir ,
0 commit comments