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

Side by Side Diff: pkg/analyzer/tool/task_dependency_graph/generate.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, 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
« no previous file with comments | « pkg/analyzer/tool/task_dependency_graph/check_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * This file contains code to output a description of tasks and their 6 * This file contains code to output a description of tasks and their
7 * dependencies in ".dot" format. Prior to running, the user should run "pub 7 * dependencies in ".dot" format. Prior to running, the user should run "pub
8 * get" in the analyzer directory to ensure that a "packages" folder exists. 8 * get" in the analyzer directory to ensure that a "packages" folder exists.
9 * 9 *
10 * TODO(paulberry): 10 * TODO(paulberry):
(...skipping 23 matching lines...) Expand all
34 import 'package:analyzer/src/generated/source_io.dart'; 34 import 'package:analyzer/src/generated/source_io.dart';
35 import 'package:path/path.dart' as path; 35 import 'package:path/path.dart' as path;
36 import 'package:path/path.dart'; 36 import 'package:path/path.dart';
37 37
38 /** 38 /**
39 * Generate the target .dot file. 39 * Generate the target .dot file.
40 */ 40 */
41 main() { 41 main() {
42 String script = Platform.script.toFilePath(windows: Platform.isWindows); 42 String script = Platform.script.toFilePath(windows: Platform.isWindows);
43 String pkgPath = normalize(join(dirname(script), '..', '..')); 43 String pkgPath = normalize(join(dirname(script), '..', '..'));
44 target.generate(pkgPath); 44 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target]);
45 } 45 }
46 46
47 final GeneratedFile target = new GeneratedFile( 47 final GeneratedFile target = new GeneratedFile(
48 'tool/task_dependency_graph/tasks.dot', 48 'tool/task_dependency_graph/tasks.dot',
49 (String pkgPath) => new Driver(pkgPath).generateFileContents()); 49 (String pkgPath) => new Driver(pkgPath).generateFileContents());
50 50
51 typedef void GetterFinderCallback(PropertyAccessorElement element); 51 typedef void GetterFinderCallback(PropertyAccessorElement element);
52 52
53 class Driver { 53 class Driver {
54 PhysicalResourceProvider resourceProvider; 54 PhysicalResourceProvider resourceProvider;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 @override 309 @override
310 visitIdentifier(Identifier node) { 310 visitIdentifier(Identifier node) {
311 Element element = node.staticElement; 311 Element element = node.staticElement;
312 if (element is PropertyAccessorElement && 312 if (element is PropertyAccessorElement &&
313 element.isGetter && 313 element.isGetter &&
314 element.returnType.isSubtypeOf(type)) { 314 element.returnType.isSubtypeOf(type)) {
315 callback(element); 315 callback(element);
316 } 316 }
317 } 317 }
318 } 318 }
OLDNEW
« no previous file with comments | « pkg/analyzer/tool/task_dependency_graph/check_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698