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

Unified Diff: tools/html_json_doc/lib/json_to_html.dart

Issue 11413197: Updated json_to_html to be sync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: A shot. Created 8 years, 1 month 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
Index: tools/html_json_doc/lib/json_to_html.dart
diff --git a/tools/html_json_doc/lib/json_to_html.dart b/tools/html_json_doc/lib/json_to_html.dart
index d25aa4d0b7e654254ef8e7cafbaa575ef98746be..e6ac183c320b80dbd5a620347873d1e74f68ee3b 100644
--- a/tools/html_json_doc/lib/json_to_html.dart
+++ b/tools/html_json_doc/lib/json_to_html.dart
@@ -66,7 +66,12 @@ Future<bool> convert(Path htmlPath, Path jsonPath) {
// Find html files. (lister)
final lister = htmlDir.list(recursive: false);
+ var pathList = <String>[];
lister.onFile = (String path) {
+ pathList.add(path);
+ };
+
+ getFile(String path) {
final name = new Path.fromNative(path).filename;
// Ignore private classes.
@@ -98,6 +103,9 @@ Future<bool> convert(Path htmlPath, Path jsonPath) {
};
lister.onDone = (_) {
+ while(!pathList.isEmpty) {
+ getFile(pathList.removeLast());
+ }
fileJson.forEach((key, _) {
print('WARNING: the following filename was found in the JSON but not in '
@@ -139,13 +147,6 @@ void _convertFile(File file, Map<String, List<String>> comments) {
'${new Path(file.fullPathSync()).filename}:\n"$key"');
_anyErrors = true;
});
-
- // TODO(amouravski): file.writeAsStringSync('${Strings.join(fileLines, '\n')}\n');
- var outputStream = file.openOutputStream();
- outputStream.writeString(Strings.join(fileLines, '\n'));
- outputStream.writeString('\n');
-
- outputStream.onNoPendingWrites = () {
- outputStream.close();
- };
+
+ file.writeAsStringSync('${Strings.join(fileLines, '\n')}\n');
}
« tools/html_json_doc/lib/html_to_json.dart ('K') | « tools/html_json_doc/lib/html_to_json.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698