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

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

Issue 16915007: docgen working with a temporary link hack. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/bin/docgen.dart ('k') | pkg/docgen/packages/hack » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index 0d0ae24fa109f52ebcd26b96c2153ad95dd0270a..838d8d8d1bc50d99a38651206d8885402d4e27b7 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -20,13 +20,13 @@ import 'dart:async';
import 'package:markdown/markdown.dart' as markdown;
import 'package:args/args.dart';
import 'dart2yaml.dart';
-import 'package:compiler_unsupported/compiler.dart' as api;
-import 'package:compiler_unsupported/implementation/filenames.dart';
-import 'package:compiler_unsupported/implementation/mirrors/dart2js_mirror.dart'
+import 'package:hack/compiler/compiler.dart' as api;
Emily Fortuna 2013/06/21 20:27:37 Can you add a TODO(janicejl/amouravski) saying som
+import 'package:hack/compiler/implementation/filenames.dart';
+import 'package:hack/compiler/implementation/mirrors/dart2js_mirror.dart'
as dart2js;
-import 'package:compiler_unsupported/implementation/mirrors/mirrors.dart';
-import 'package:compiler_unsupported/implementation/mirrors/mirrors_util.dart';
-import 'package:compiler_unsupported/implementation/source_file_provider.dart';
+import 'package:hack/compiler/implementation/mirrors/mirrors.dart';
+import 'package:hack/compiler/implementation/mirrors/mirrors_util.dart';
+import 'package:hack/compiler/implementation/source_file_provider.dart';
import 'package:logging/logging.dart';
/// Logger for Dart Doc Generator.
@@ -145,10 +145,17 @@ class Docgen {
* Also initializes the command line arguments.
Bob Nystrom 2013/06/21 20:32:53 You can use "///" style doc comments for multiline
*/
Docgen({ArgResults argResults}) {
- outputToYaml = argResults["yaml"];
- outputToJson = argResults["json"];
- hidePrivate = argResults["hide-private"];
- sdk = argResults["sdk"];
+ if (argResults != null) {
+ outputToYaml = argResults["yaml"];
+ outputToJson = argResults["json"];
+ hidePrivate = argResults["hide-private"];
+ sdk = argResults["sdk"];
+ } else {
+ outputToYaml = true;
Emily Fortuna 2013/06/21 20:27:37 if you're already specifying default values from t
Bob Nystrom 2013/06/21 20:32:53 Alternatively, just pass these arguments directly
janicejl 2013/06/21 21:02:39 Done.
+ outputToJson = false;
+ hidePrivate = false;
+ sdk = true;
+ }
this.linkResolver = (name) =>
fixReference(name, _currentLibrary, _currentClass, _currentMember);
@@ -160,9 +167,17 @@ class Docgen {
*/
void analyze(List<Path> libraries) {
/// Assuming the dart executable is from the Dart SDK folder.
Bob Nystrom 2013/06/21 20:32:53 Just use a normal "//" comment here, not "///".
- var sdkRoot = new Path(new Options().executable).directoryPath
- .directoryPath;
- logger.info("SDK Root: ${sdkRoot.toString()}");
+
+ var sdkRoot = Platform.environment["DART_SDK"];
Emily Fortuna 2013/06/21 20:27:37 I'd be inclined to keep it the way you had it befo
janicejl 2013/06/21 21:02:39 I have kept it with a comment. I have also modifie
+ if (sdkRoot != null) {
+ logger.info("Using DART_SDK to find SDK at $sdkRoot");
+ sdkRoot = new Path(sdkRoot);
+ } else {
+ sdkRoot = new Path(new Options().executable).directoryPath
+ .append("dart-sdk");
+ logger.info("SDK Root: ${sdkRoot.toString()}");
+ }
+
Path packageDir = libraries.last.directoryPath.append("packages");
logger.info("Package Root: ${packageDir.toString()}");
getMirrorSystem(libraries, sdkRoot,
« no previous file with comments | « pkg/docgen/bin/docgen.dart ('k') | pkg/docgen/packages/hack » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698