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

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

Issue 1533693003: - Fix usage of Platform.packageRoot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync to latest Created 5 years 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/lib/src/codegen/tools.dart ('k') | tests/compiler/dart2js/analyze_helper.dart » ('j') | 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 * Generate the task dependency graph and return it as a [String]. 121 * Generate the task dependency graph and return it as a [String].
122 */ 122 */
123 String generateFileContents() { 123 String generateFileContents() {
124 AnalysisEngine.instance.processRequiredPlugins(); 124 AnalysisEngine.instance.processRequiredPlugins();
125 List<String> lines = <String>[]; 125 List<String> lines = <String>[];
126 resourceProvider = PhysicalResourceProvider.INSTANCE; 126 resourceProvider = PhysicalResourceProvider.INSTANCE;
127 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; 127 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
128 context = AnalysisEngine.instance.createAnalysisContext(); 128 context = AnalysisEngine.instance.createAnalysisContext();
129 String packageRootPath; 129 String packageRootPath;
130 if (Platform.packageRoot.isNotEmpty) { 130 if (Platform.packageRoot.isNotEmpty) {
131 packageRootPath = Platform.packageRoot; 131 Uri packageRootUri = Uri.parse(Platform.packageRoot);
132 packageRootPath = packageRootUri.toFilePath();
132 } else { 133 } else {
133 packageRootPath = path.join(rootDir, 'packages'); 134 packageRootPath = path.join(rootDir, 'packages');
134 } 135 }
135 JavaFile packagesDir = new JavaFile(packageRootPath); 136 JavaFile packagesDir = new JavaFile(packageRootPath);
136 List<UriResolver> uriResolvers = [ 137 List<UriResolver> uriResolvers = [
137 new DartUriResolver(sdk), 138 new DartUriResolver(sdk),
138 new PackageUriResolver(<JavaFile>[packagesDir]), 139 new PackageUriResolver(<JavaFile>[packagesDir]),
139 new FileUriResolver() 140 new FileUriResolver()
140 ]; 141 ];
141 context.sourceFactory = new SourceFactory(uriResolvers); 142 context.sourceFactory = new SourceFactory(uriResolvers);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 @override 312 @override
312 visitIdentifier(Identifier node) { 313 visitIdentifier(Identifier node) {
313 Element element = node.staticElement; 314 Element element = node.staticElement;
314 if (element is PropertyAccessorElement && 315 if (element is PropertyAccessorElement &&
315 element.isGetter && 316 element.isGetter &&
316 element.returnType.isSubtypeOf(type)) { 317 element.returnType.isSubtypeOf(type)) {
317 callback(element); 318 callback(element);
318 } 319 }
319 } 320 }
320 } 321 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/codegen/tools.dart ('k') | tests/compiler/dart2js/analyze_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698