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

Side by Side Diff: dart/pkg/docgen/lib/src/generator.dart

Issue 838163002: Ensure packageRoot is non-null in docgen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 5 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library docgen.generator; 5 library docgen.generator;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 /// for static inspection of the source code. 267 /// for static inspection of the source code.
268 Future<MirrorSystem> analyzeLibraries(List<Uri> libraries, String 268 Future<MirrorSystem> analyzeLibraries(List<Uri> libraries, String
269 libraryRoot, {String packageRoot}) { 269 libraryRoot, {String packageRoot}) {
270 SourceFileProvider provider = new CompilerSourceFileProvider(); 270 SourceFileProvider provider = new CompilerSourceFileProvider();
271 api.DiagnosticHandler diagnosticHandler = (new FormattingDiagnosticHandler( 271 api.DiagnosticHandler diagnosticHandler = (new FormattingDiagnosticHandler(
272 provider) 272 provider)
273 ..showHints = false 273 ..showHints = false
274 ..showWarnings = false).diagnosticHandler; 274 ..showWarnings = false).diagnosticHandler;
275 Uri libraryUri = new Uri.file(appendSlash(libraryRoot)); 275 Uri libraryUri = new Uri.file(appendSlash(libraryRoot));
276 Uri packageUri = null; 276 Uri packageUri = null;
277 if (packageRoot != null) { 277 if (packageRoot == null) {
278 packageUri = new Uri.file(appendSlash(packageRoot)); 278 packageRoot = Platform.packageRoot;
279 } 279 }
280 packageUri = new Uri.file(appendSlash(packageRoot));
280 return dart2js.analyze(libraries, libraryUri, packageUri, 281 return dart2js.analyze(libraries, libraryUri, packageUri,
281 provider.readStringFromUri, diagnosticHandler, ['--preserve-comments', 282 provider.readStringFromUri, diagnosticHandler, ['--preserve-comments',
282 '--categories=Client,Server'])..catchError((error) { 283 '--categories=Client,Server'])..catchError((error) {
283 logger.severe('Error: Failed to create mirror system. '); 284 logger.severe('Error: Failed to create mirror system. ');
284 // TODO(janicejl): Use the stack trace package when bug is resolved. 285 // TODO(janicejl): Use the stack trace package when bug is resolved.
285 // Currently, a string is thrown when it fails to create a mirror 286 // Currently, a string is thrown when it fails to create a mirror
286 // system, and it is not possible to use the stack trace. BUG(#11622) 287 // system, and it is not possible to use the stack trace. BUG(#11622)
287 // To avoid printing the stack trace. 288 // To avoid printing the stack trace.
288 exit(1); 289 exit(1);
289 }); 290 });
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 * [Samples](http://www.dartlang.org/samples/) 478 * [Samples](http://www.dartlang.org/samples/)
478 * [A Tour of the Dart Libraries](http://www.dartlang.org/docs/dart-up-and-runn ing/contents/ch03.html) 479 * [A Tour of the Dart Libraries](http://www.dartlang.org/docs/dart-up-and-runn ing/contents/ch03.html)
479 480
480 This API reference is automatically generated from the source code in the 481 This API reference is automatically generated from the source code in the
481 [Dart project](https://code.google.com/p/dart/). 482 [Dart project](https://code.google.com/p/dart/).
482 If you'd like to contribute to this documentation, see 483 If you'd like to contribute to this documentation, see
483 [Contributing](https://code.google.com/p/dart/wiki/Contributing) 484 [Contributing](https://code.google.com/p/dart/wiki/Contributing)
484 and 485 and
485 [Writing API Documentation](https://code.google.com/p/dart/wiki/WritingApiDocume ntation). 486 [Writing API Documentation](https://code.google.com/p/dart/wiki/WritingApiDocume ntation).
486 """; 487 """;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698