Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 5ea668c

Browse files
chalinfilipesilva
authored andcommitted
chore(dart): drop api and cheatsheet scripts and gulp tasks (#2970)
* chore(dart): drop the tools/dart-api-builder * chore(gulp): remove Dart cheatsheet and api tasks * chore(tools): remove tools/api-builder/dart-package * chore(gulp): drop pub task
1 parent 0bdda1d commit 5ea668c

File tree

13 files changed

+2
-790
lines changed

13 files changed

+2
-790
lines changed

gulpfile.js

Lines changed: 2 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ var _apiShredOptions = {
7777
logLevel: _dgeniLogLevel
7878
};
7979

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-
8980
var _excludePatterns = ['**/node_modules/**', '**/packages/**'];
9081

9182
var _excludeMatchers = _excludePatterns.map(function(excludePattern){
@@ -624,8 +615,7 @@ gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunker
624615
// Stop zipping examples Feb 28, 2016
625616
//gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers', '_zip-examples']);
626617

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']);
629619

630620
gulp.task('build-devguide-docs', ['_shred-devguide-examples', '_shred-devguide-shared-jade'], function() {
631621
return buildShredMaps(true);
@@ -639,50 +629,12 @@ gulp.task('build-js-api-docs', ['_shred-api-examples'], function() {
639629
return buildApiDocs('js');
640630
});
641631

642-
gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function() {
643-
return buildApiDocsForDart();
644-
});
645-
646632
// Using the --build flag will use systemjs.config.web.build.js (for preview builds)
647633
gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() {
648634
regularPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build });
649635
return embeddedPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build, targetSelf: argv.targetSelf });
650636
});
651637

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-
686638
gulp.task('git-changed-examples', ['_shred-devguide-examples'], function(){
687639
var after, sha, messageSuffix;
688640
if (argv.after) {
@@ -863,8 +815,7 @@ gulp.task('_shred-api-examples', ['_shred-clean-api'], function() {
863815
langs.forEach(lang => {
864816
if (lang === 'js') return; // JS is handled via TS.
865817
checkAngularProjectPath(ngPathFor(lang));
866-
const options = lang == 'dart' ? _apiShredOptionsForDart : _apiShredOptions;
867-
promises.push(docShredder.shred(options));
818+
promises.push(docShredder.shred(_apiShredOptions));
868819
});
869820
return Q.all(promises);
870821
});
@@ -1347,72 +1298,6 @@ function buildApiDocs(targetLanguage) {
13471298
}
13481299
}
13491300

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(/^(?!angular2)|testing|_|codegen|^angular2$/);
1389-
1390-
try {
1391-
checkAngularProjectPath(ngPathFor('dart'));
1392-
var destPath = dabInfo.ngIoDartApiDocPath;
1393-
var sourceDirs = fs.readdirSync(dabInfo.ngDartDocPath)
1394-
.filter(name => !name.match(/^index|^(?!angular2)|testing|codegen/))
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-
14161301
function buildShredMaps(shouldWrite) {
14171302
var options = {
14181303
devguideExamplesDir: _devguideShredOptions.examplesDir,

tools/api-builder/dart-package/index.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

tools/api-builder/dart-package/processors/loadDartDocData.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

tools/api-builder/dart-package/processors/loadDartDocHtml.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

tools/api-builder/dart-package/services/apiListDataFileService.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

tools/api-builder/dart-package/services/arrayFromIterable.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

tools/api-builder/dart-package/services/dartPkgConfigInfo.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

tools/api-builder/dart-package/services/logFactory.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)