| OLD | NEW |
| 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 /// **docgen** is a tool for creating machine readable representations of Dart | 5 /// **docgen** is a tool for creating machine readable representations of Dart |
| 6 /// code metadata, including: classes, members, comments and annotations. | 6 /// code metadata, including: classes, members, comments and annotations. |
| 7 /// | 7 /// |
| 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. | 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. |
| 9 /// | 9 /// |
| 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] | 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 } | 716 } |
| 717 | 717 |
| 718 /// Serve up our generated documentation for viewing in a browser. | 718 /// Serve up our generated documentation for viewing in a browser. |
| 719 static void _clone() { | 719 static void _clone() { |
| 720 // If the viewer code is already there, then don't clone again. | 720 // If the viewer code is already there, then don't clone again. |
| 721 if (_dartdocViewerDir.existsSync()) { | 721 if (_dartdocViewerDir.existsSync()) { |
| 722 _moveDirectoryAndServe(); | 722 _moveDirectoryAndServe(); |
| 723 } | 723 } |
| 724 else { | 724 else { |
| 725 var processResult = Process.runSync('git', ['clone', '-b', 'master', | 725 var processResult = Process.runSync('git', ['clone', '-b', 'master', |
| 726 'git://github.com/dart-lang/dartdoc-viewer.git'], | 726 'https://github.com/dart-lang/dartdoc-viewer.git'], |
| 727 runInShell: true); | 727 runInShell: true); |
| 728 | 728 |
| 729 if (processResult.exitCode == 0) { | 729 if (processResult.exitCode == 0) { |
| 730 /// Move the generated json/yaml docs directory to the dartdoc-viewer | 730 /// Move the generated json/yaml docs directory to the dartdoc-viewer |
| 731 /// directory, to run as a webpage. | 731 /// directory, to run as a webpage. |
| 732 var processResult = Process.runSync(_Generator._pubScript, | 732 var processResult = Process.runSync(_Generator._pubScript, |
| 733 ['upgrade'], runInShell: true, | 733 ['upgrade'], runInShell: true, |
| 734 workingDirectory: viewerCodePath); | 734 workingDirectory: viewerCodePath); |
| 735 print('process output: ${processResult.stdout}'); | 735 print('process output: ${processResult.stdout}'); |
| 736 print('process stderr: ${processResult.stderr}'); | 736 print('process stderr: ${processResult.stderr}'); |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 .map((e) => originalMirror.getField(e.simpleName).reflectee) | 2308 .map((e) => originalMirror.getField(e.simpleName).reflectee) |
| 2309 .where((e) => e != null) | 2309 .where((e) => e != null) |
| 2310 .toList(); | 2310 .toList(); |
| 2311 } | 2311 } |
| 2312 | 2312 |
| 2313 Map toMap() => { | 2313 Map toMap() => { |
| 2314 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName, | 2314 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName, |
| 2315 'parameters': parameters | 2315 'parameters': parameters |
| 2316 }; | 2316 }; |
| 2317 } | 2317 } |
| OLD | NEW |