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

Unified Diff: tools/yaml2json.dart

Issue 2698003003: Proposal: Add YAML file with VM patch file information. (Closed)
Patch Set: Add reference to issue 28836. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/dart_server.yaml ('k') | tools/yaml2json.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/yaml2json.dart
diff --git a/tools/yaml2json.dart b/tools/yaml2json.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d781f9538b019cd78757da63d2820d6030148be4
--- /dev/null
+++ b/tools/yaml2json.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io' show File, exit, stderr;
+
+import 'dart:isolate' show RawReceivePort;
+
+import 'dart:convert' show JsonEncoder;
+
+import 'package:yaml/yaml.dart' show loadYaml;
+
+main(List<String> arguments) async {
+ var port = new RawReceivePort();
+ if (arguments.length != 2) {
+ stderr.writeln("Usage: yaml2json.dart input.yaml output.json");
+ exit(1);
+ }
+ Uri input = Uri.base.resolve(arguments[0]);
+ Uri output = Uri.base.resolve(arguments[1]);
+ var yaml = loadYaml(await new File.fromUri(input).readAsString());
+ await new File.fromUri(output).writeAsString(
+ const JsonEncoder.withIndent(" ").convert(yaml));
+ port.close();
+}
« no previous file with comments | « sdk/lib/dart_server.yaml ('k') | tools/yaml2json.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698