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

Unified Diff: bin/verify_deps.dart

Issue 1419903003: merge verify_deps into debug_info (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 5 years, 2 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 | « bin/debug_info.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/verify_deps.dart
diff --git a/bin/verify_deps.dart b/bin/verify_deps.dart
deleted file mode 100644
index 05fef0f91df8c47e33e24ba40c9cafe3ee0568cd..0000000000000000000000000000000000000000
--- a/bin/verify_deps.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// This tools verifies that all elements that are included in the output are
-/// reachable from the program entrypoint. If there are elements that are not
-/// reachable from the entrypoint, then this indicates that we are missing
-/// dependencies. If all functions are reachable from the entrypoint, this
-/// script will return with exitcode 0. Otherwise it will list the unreachable
-/// functions and return with exitcode 1.
-library dart2js_info.bin.verify_deps;
-
-import 'dart:async';
-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';
-
-Future main(List<String> args) async {
- if (args.length > 1) {
- printUsage();
- exit(1);
- }
- var json = JSON.decode(await new File(args[0]).readAsString());
- var info = new AllInfoJsonCodec().decode(json);
- var graph = graphFromInfo(info);
- var entrypoint = info.program.entrypoint;
- var reachables = findReachable(graph, entrypoint);
-
- var functionsAndFields = []..addAll(info.functions)..addAll(info.fields);
- var unreachables =
- functionsAndFields.where((func) => !reachables.contains(func));
- if (unreachables.isNotEmpty) {
- unreachables.forEach((x) => print(longName(x)));
- exit(1);
- } else {
- print('all elements are reachable from the entrypoint');
- }
-}
-
-/// Finds the set of nodes reachable from [start] in [graph].
-Set<Info> findReachable(Graph<Info> graph, Info start) =>
- new Set.from(graph.preOrder(start));
-
-void printUsage() {
- print('usage: dart2js_info_verify_deps <info file>');
-}
« no previous file with comments | « bin/debug_info.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698