| 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 /** | 5 /** |
| 6 * A library for extracting the documentation from the various HTML libraries | 6 * A library for extracting the documentation from the various HTML libraries |
| 7 * ([dart:html], [dart:svg], [dart:web_audio], [dart:indexed_db]) and saving | 7 * ([dart:html], [dart:svg], [dart:web_audio], [dart:indexed_db]) and saving |
| 8 * those documentation comments to a JSON file. | 8 * those documentation comments to a JSON file. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 return analyze(paths, libPath, options: ['--preserve-comments']) | 59 return analyze(paths, libPath, options: ['--preserve-comments']) |
| 60 .then((MirrorSystem mirrors) { | 60 .then((MirrorSystem mirrors) { |
| 61 var convertedJson = _generateJsonFromLibraries(mirrors); | 61 var convertedJson = _generateJsonFromLibraries(mirrors); |
| 62 return _exportJsonToFile(convertedJson, jsonPath); | 62 return _exportJsonToFile(convertedJson, jsonPath); |
| 63 }); | 63 }); |
| 64 } | 64 } |
| 65 | 65 |
| 66 Future<bool> _exportJsonToFile(Map convertedJson, Path jsonPath) { | 66 Future<bool> _exportJsonToFile(Map convertedJson, Path jsonPath) { |
| 67 return new Future.of(() { | 67 return new Future.sync(() { |
| 68 final jsonFile = new File.fromPath(jsonPath); | 68 final jsonFile = new File.fromPath(jsonPath); |
| 69 var writeJson = prettySerialize(convertedJson); | 69 var writeJson = prettySerialize(convertedJson); |
| 70 | 70 |
| 71 var outputStream = jsonFile.openWrite(); | 71 var outputStream = jsonFile.openWrite(); |
| 72 outputStream.writeln(writeJson); | 72 outputStream.writeln(writeJson); |
| 73 outputStream.close(); | 73 outputStream.close(); |
| 74 return outputStream.done.then((_) => false); | 74 return outputStream.done.then((_) => false); |
| 75 }); | 75 }); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 for (var s in tags.reflectee.split(',')) { | 184 for (var s in tags.reflectee.split(',')) { |
| 185 domNames.add(s.trim()); | 185 domNames.add(s.trim()); |
| 186 } | 186 } |
| 187 | 187 |
| 188 if (domNames.length == 1 && domNames[0] == 'none') return <String>[]; | 188 if (domNames.length == 1 && domNames[0] == 'none') return <String>[]; |
| 189 return domNames; | 189 return domNames; |
| 190 } else { | 190 } else { |
| 191 return <String>[]; | 191 return <String>[]; |
| 192 } | 192 } |
| 193 } | 193 } |
| OLD | NEW |