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

Side by Side Diff: pkg/analyzer/tool/task_dependency_graph/check_test.dart

Issue 1428673004: Rework codegen tools to avoid relying on CWD; integrate with task model graph. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library task_dependency_graph.check_test; 5 library task_dependency_graph.check_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:path/path.dart'; 9 import 'package:path/path.dart';
10 10
11 import 'generate.dart'; 11 import 'generate.dart';
12 12
13 /** 13 /**
14 * Check that the target file has been code generated. If it hasn't tell the 14 * Check that the target file has been code generated. If it hasn't tell the
15 * user to run generate.dart. 15 * user to run generate.dart.
16 */ 16 */
17 main() { 17 main() {
18 String script = Platform.script.toFilePath(windows: Platform.isWindows); 18 String script = Platform.script.toFilePath(windows: Platform.isWindows);
19 Driver driver = new Driver(); 19 String pkgPath = normalize(join(dirname(script), '..', '..'));
20 if (!driver.checkFile()) { 20 if (!target.check(pkgPath)) {
21 print('${driver.file.absolute} does not have expected contents.'); 21 print(
22 '${target.output(pkgPath).absolute} does not have expected contents.');
22 print('Please regenerate using:'); 23 print('Please regenerate using:');
23 String executable = Platform.executable; 24 String executable = Platform.executable;
24 String packageRoot = ''; 25 String packageRoot = '';
25 if (Platform.packageRoot.isNotEmpty) { 26 if (Platform.packageRoot.isNotEmpty) {
26 packageRoot = ' --package-root=${Platform.packageRoot}'; 27 packageRoot = ' --package-root=${Platform.packageRoot}';
27 } 28 }
28 String generateScript = join(dirname(script), 'generate.dart'); 29 String generateScript = join(dirname(script), 'generate.dart');
29 print(' $executable$packageRoot $generateScript'); 30 print(' $executable$packageRoot $generateScript');
30 exit(1); 31 exit(1);
31 } else { 32 } else {
32 print('Generated file is up to date.'); 33 print('Generated file is up to date.');
33 } 34 }
34 } 35 }
OLDNEW
« 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