Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1265)

Unified Diff: pkg/docgen/lib/src/generator.dart

Issue 737033002: Let docgen detect a dart-sdk directory that's differently named, and do it correctly on bleeding ed… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: A much better implementation, actually use the --sdk value Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/docgen.dart ('k') | pkg/docgen/lib/src/package_helpers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/generator.dart
diff --git a/pkg/docgen/lib/src/generator.dart b/pkg/docgen/lib/src/generator.dart
index 3a050419cedb713496060f5344b1eb93adbeec37..2f1722c87cce4f8109084c2e2a38160878f60f74 100644
--- a/pkg/docgen/lib/src/generator.dart
+++ b/pkg/docgen/lib/src/generator.dart
@@ -61,7 +61,7 @@ Future<bool> generateDocumentation(List<String> files, {String packageRoot,
bool parseSdk: false, String introFileName: '',
out: DEFAULT_OUTPUT_DIRECTORY, List<String> excludeLibraries: const [], bool
includeDependentPackages: false, String startPage, String dartBinaryValue,
- String pubScriptValue, bool indentJSON: false}) {
+ String pubScriptValue, bool indentJSON: false, String sdk}) {
_excluded = excludeLibraries;
dartBinary = dartBinaryValue;
pubScript = pubScriptValue;
@@ -80,7 +80,7 @@ Future<bool> generateDocumentation(List<String> files, {String packageRoot,
}
return getMirrorSystem(allLibraries, includePrivate,
- packageRoot: updatedPackageRoot, parseSdk: parseSdk)
+ packageRoot: updatedPackageRoot, parseSdk: parseSdk, sdkRoot: sdk)
.then((MirrorSystem mirrorSystem) {
if (mirrorSystem.libraries.isEmpty) {
throw new StateError('No library mirrors were created.');
@@ -110,7 +110,8 @@ Future<bool> generateDocumentation(List<String> files, {String packageRoot,
/// Analyzes set of libraries by getting a mirror system and triggers the
/// documentation of the libraries.
Future<MirrorSystem> getMirrorSystem(List<Uri> libraries,
- bool includePrivate, {String packageRoot, bool parseSdk: false}) {
+ bool includePrivate, {String packageRoot, bool parseSdk: false,
+ String sdkRoot}) {
if (libraries.isEmpty) throw new StateError('No Libraries.');
includePrivateMembers = includePrivate;
@@ -118,10 +119,12 @@ Future<MirrorSystem> getMirrorSystem(List<Uri> libraries,
// Finds the root of SDK library based off the location of docgen.
// We have two different places to look, depending if we're in a development
// repo or in a built SDK, either sdk or dart-sdk respectively
- var root = rootDirectory;
- var sdkRoot = path.normalize(path.absolute(path.join(root, 'sdk')));
- if (!new Directory(sdkRoot).existsSync()) {
- sdkRoot = path.normalize(path.absolute(path.join(root, 'dart-sdk')));
+ if (sdkRoot == null) {
+ var root = rootDirectory;
+ sdkRoot = path.normalize(path.absolute(path.join(root, 'sdk')));
+ if (!new Directory(sdkRoot).existsSync()) {
+ sdkRoot = path.normalize(path.absolute(path.join(root, 'dart-sdk')));
+ }
}
logger.info('SDK Root: ${sdkRoot}');
return analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot);
« no previous file with comments | « pkg/docgen/lib/docgen.dart ('k') | pkg/docgen/lib/src/package_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698