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

Unified Diff: bin/code_deps.dart

Issue 2201903004: add tool to get breakdown of deferred libraries by size (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 4 years, 4 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
Index: bin/code_deps.dart
diff --git a/bin/code_deps.dart b/bin/code_deps.dart
index 9899e8d3553dcde4e533dc1c451ebc67c09e9573..a90df7852f6feb30830e211f7652caa990460245 100644
--- a/bin/code_deps.dart
+++ b/bin/code_deps.dart
@@ -26,14 +26,13 @@
library dart2js_info.bin.code_deps;
import 'dart:collection';
-import 'dart:convert';
import 'dart:io';
import 'package:dart2js_info/info.dart';
import 'package:dart2js_info/src/graph.dart';
import 'package:dart2js_info/src/util.dart';
-main(args) {
+main(args) async {
if (args.length < 2) {
print('usage: dart2js_info_code_deps path-to.info.json <query>');
print(' where <query> can be:');
@@ -42,14 +41,7 @@ main(args) {
exit(1);
}
- var json;
- try {
- json = JSON.decode(new File(args[0]).readAsStringSync());
- } catch (e) {
- print('error: could not read ${args[0]}');
- exit(1);
- }
- var info = new AllInfoJsonCodec().decode(json);
+ var info = await infoFromFile(args.first);
var graph = graphFromInfo(info);
var queryName = args[1];
« no previous file with comments | « README.md ('k') | bin/coverage_log_server.dart » ('j') | bin/deferred_library_size.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698