OLD | NEW |
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 _writeToFile(buffer.toString(), 'index.txt'); | 240 _writeToFile(buffer.toString(), 'index.txt'); |
241 | 241 |
242 var index = new SplayTreeMap.fromIterable(filteredEntities, | 242 var index = new SplayTreeMap.fromIterable(filteredEntities, |
243 key: (e) => e.qualifiedName, value: (e) => e.typeName); | 243 key: (e) => e.qualifiedName, value: (e) => e.typeName); |
244 | 244 |
245 _writeToFile(encoder.convert(index), 'index.json'); | 245 _writeToFile(encoder.convert(index), 'index.json'); |
246 } | 246 } |
247 | 247 |
248 /// Helper method to serialize the given Indexable out to a file. | 248 /// Helper method to serialize the given Indexable out to a file. |
249 void _writeIndexableToFile(Indexable result, JsonEncoder encoder) { | 249 void _writeIndexableToFile(Indexable result, JsonEncoder encoder) { |
250 var outputFile = result.qualifiedName + '.json'; | 250 var outputFile = result.fileName + '.json'; |
251 var output = encoder.convert(result.toMap()); | 251 var output = encoder.convert(result.toMap()); |
252 _writeToFile(output, outputFile); | 252 _writeToFile(output, outputFile); |
253 } | 253 } |
254 | 254 |
255 /// Set the location of the ouput directory, and ensure that the location is | 255 /// Set the location of the ouput directory, and ensure that the location is |
256 /// available on the file system. | 256 /// available on the file system. |
257 void _ensureOutputDirectory(String outputDirectory) { | 257 void _ensureOutputDirectory(String outputDirectory) { |
258 _outputDirectory = outputDirectory; | 258 _outputDirectory = outputDirectory; |
259 var dir = new Directory(_outputDirectory); | 259 var dir = new Directory(_outputDirectory); |
260 if (dir.existsSync()) dir.deleteSync(recursive: true); | 260 if (dir.existsSync()) dir.deleteSync(recursive: true); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 * [Samples](http://www.dartlang.org/samples/) | 474 * [Samples](http://www.dartlang.org/samples/) |
475 * [A Tour of the Dart Libraries](http://www.dartlang.org/docs/dart-up-and-runn
ing/contents/ch03.html) | 475 * [A Tour of the Dart Libraries](http://www.dartlang.org/docs/dart-up-and-runn
ing/contents/ch03.html) |
476 | 476 |
477 This API reference is automatically generated from the source code in the | 477 This API reference is automatically generated from the source code in the |
478 [Dart project](https://code.google.com/p/dart/). | 478 [Dart project](https://code.google.com/p/dart/). |
479 If you'd like to contribute to this documentation, see | 479 If you'd like to contribute to this documentation, see |
480 [Contributing](https://code.google.com/p/dart/wiki/Contributing) | 480 [Contributing](https://code.google.com/p/dart/wiki/Contributing) |
481 and | 481 and |
482 [Writing API Documentation](https://code.google.com/p/dart/wiki/WritingApiDocume
ntation). | 482 [Writing API Documentation](https://code.google.com/p/dart/wiki/WritingApiDocume
ntation). |
483 """; | 483 """; |
OLD | NEW |