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

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

Issue 19888005: removed docgen/test/single_library_test: Skip # Uses js_helper (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * **docgen** is a tool for creating machine readable representations of Dart 6 * **docgen** is a tool for creating machine readable representations of Dart
7 * code metadata, including: classes, members, comments and annotations. 7 * code metadata, including: classes, members, comments and annotations.
8 * 8 *
9 * docgen is run on a `.dart` file or a directory containing `.dart` files. 9 * docgen is run on a `.dart` file or a directory containing `.dart` files.
10 * 10 *
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (FileSystemEntity.typeSync(files.first) 76 if (FileSystemEntity.typeSync(files.first)
77 == FileSystemEntityType.DIRECTORY) { 77 == FileSystemEntityType.DIRECTORY) {
78 packageRoot = _findPackageRoot(files.first); 78 packageRoot = _findPackageRoot(files.first);
79 } 79 }
80 } 80 }
81 logger.info('Package Root: ${packageRoot}'); 81 logger.info('Package Root: ${packageRoot}');
82 82
83 linkResolver = (name) => 83 linkResolver = (name) =>
84 fixReference(name, _currentLibrary, _currentClass, _currentMember); 84 fixReference(name, _currentLibrary, _currentClass, _currentMember);
85 85
86 return getMirrorSystem(files, packageRoot, parseSdk: parseSdk) 86 return getMirrorSystem(files, packageRoot: packageRoot, parseSdk: parseSdk)
87 .then((MirrorSystem mirrorSystem) { 87 .then((MirrorSystem mirrorSystem) {
88 if (mirrorSystem.libraries.isEmpty) { 88 if (mirrorSystem.libraries.isEmpty) {
89 throw new StateError('No library mirrors were created.'); 89 throw new StateError('No library mirrors were created.');
90 } 90 }
91 _documentLibraries(mirrorSystem.libraries.values, 91 _documentLibraries(mirrorSystem.libraries.values,
92 includeSdk: includeSdk, includePrivate: includePrivate, 92 includeSdk: includeSdk, includePrivate: includePrivate,
93 outputToYaml: outputToYaml); 93 outputToYaml: outputToYaml);
94 94
95 return true; 95 return true;
96 }); 96 });
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 logger.info('Add to SDK: ${sdk.last}'); 142 logger.info('Add to SDK: ${sdk.last}');
143 } 143 }
144 }); 144 });
145 return sdk; 145 return sdk;
146 } 146 }
147 147
148 /** 148 /**
149 * Analyzes set of libraries by getting a mirror system and triggers the 149 * Analyzes set of libraries by getting a mirror system and triggers the
150 * documentation of the libraries. 150 * documentation of the libraries.
151 */ 151 */
152 Future<MirrorSystem> getMirrorSystem(List<String> args, String packageRoot, 152 Future<MirrorSystem> getMirrorSystem(List<String> args, {String packageRoot,
153 {bool parseSdk:false}) { 153 bool parseSdk:false}) {
154 var libraries = !parseSdk ? _listLibraries(args) : _listSdk(); 154 var libraries = !parseSdk ? _listLibraries(args) : _listSdk();
155 if (libraries.isEmpty) throw new StateError('No Libraries.'); 155 if (libraries.isEmpty) throw new StateError('No Libraries.');
156 // DART_SDK should be set to the root of the SDK library. 156 // DART_SDK should be set to the root of the SDK library.
157 var sdkRoot = Platform.environment['DART_SDK']; 157 var sdkRoot = Platform.environment['DART_SDK'];
158 if (sdkRoot != null) { 158 if (sdkRoot != null) {
159 logger.info('Using DART_SDK to find SDK at $sdkRoot'); 159 logger.info('Using DART_SDK to find SDK at $sdkRoot');
160 } else { 160 } else {
161 // If DART_SDK is not defined in the environment, 161 // If DART_SDK is not defined in the environment,
162 // assuming the dart executable is from the Dart SDK folder inside bin. 162 // assuming the dart executable is from the Dart SDK folder inside bin.
163 sdkRoot = path.dirname(path.dirname(new Options().executable)); 163 sdkRoot = path.join(path.dirname(path.dirname(path.dirname(path.dirname(
164 path.absolute(new Options().script))))), 'sdk');
164 logger.info('SDK Root: ${sdkRoot}'); 165 logger.info('SDK Root: ${sdkRoot}');
165 } 166 }
166
167 return _analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot); 167 return _analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot);
168 } 168 }
169 169
170 // TODO(janicejl): Should make docgen fail gracefully, or output a friendly 170 // TODO(janicejl): Should make docgen fail gracefully, or output a friendly
171 // error message letting them know why it is failing to create a mirror system. 171 // error message letting them know why it is failing to create a mirror system.
172 // If there is conflicting library names, should modify it with a hash at the 172 // If there is conflicting library names, should modify it with a hash at the
173 // end of it's library name. 173 // end of it's library name.
174 /** 174 /**
175 * Analyzes set of libraries and provides a mirror system which can be used 175 * Analyzes set of libraries and provides a mirror system which can be used
176 * for static inspection of the source code. 176 * for static inspection of the source code.
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 String name; 670 String name;
671 String type; 671 String type;
672 672
673 Generic(this.name, this.type); 673 Generic(this.name, this.type);
674 674
675 Map toMap() => { 675 Map toMap() => {
676 'name': name, 676 'name': name,
677 'type': type 677 'type': type
678 }; 678 };
679 } 679 }
OLDNEW
« no previous file with comments | « no previous file | pkg/docgen/test/single_library_test.dart » ('j') | pkg/docgen/test/single_library_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698