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

Unified Diff: pkg/analyzer/tool/task_dependency_graph/check_test.dart

Issue 1430723002: Refactor code for checking that generated files are up to date. (Closed) Base URL: git@github.com:dart-lang/sdk.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 | « pkg/analyzer/lib/src/codegen/tools.dart ('k') | pkg/analyzer/tool/task_dependency_graph/generate.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/task_dependency_graph/check_test.dart
diff --git a/pkg/analyzer/tool/task_dependency_graph/check_test.dart b/pkg/analyzer/tool/task_dependency_graph/check_test.dart
index b64bf521c5c6948a80902e76f75d57d959bcec38..3d64a855eedf8c2a07be81f505ec5e7075a58157 100644
--- a/pkg/analyzer/tool/task_dependency_graph/check_test.dart
+++ b/pkg/analyzer/tool/task_dependency_graph/check_test.dart
@@ -6,6 +6,7 @@ library task_dependency_graph.check_test;
import 'dart:io';
+import 'package:analyzer/src/codegen/tools.dart';
import 'package:path/path.dart';
import 'generate.dart';
@@ -17,19 +18,6 @@ import 'generate.dart';
main() {
String script = Platform.script.toFilePath(windows: Platform.isWindows);
String pkgPath = normalize(join(dirname(script), '..', '..'));
- if (!target.check(pkgPath)) {
- print(
- '${target.output(pkgPath).absolute} does not have expected contents.');
- print('Please regenerate using:');
- String executable = Platform.executable;
- String packageRoot = '';
- if (Platform.packageRoot.isNotEmpty) {
- packageRoot = ' --package-root=${Platform.packageRoot}';
- }
- String generateScript = join(dirname(script), 'generate.dart');
- print(' $executable$packageRoot $generateScript');
- exit(1);
- } else {
- print('Generated file is up to date.');
- }
+ GeneratedContent.checkAll(pkgPath, 'tool/task_dependency_graph/generate.dart',
+ <GeneratedContent>[target]);
}
« no previous file with comments | « pkg/analyzer/lib/src/codegen/tools.dart ('k') | pkg/analyzer/tool/task_dependency_graph/generate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698