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

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

Issue 1536043002: - Fix more bad uses of Platform.packageRoot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 /** 120 /**
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 != null) {
131 Uri packageRootUri = Uri.parse(Platform.packageRoot); 131 packageRootPath = Uri.parse(Platform.packageRoot).toFilePath();
132 packageRootPath = packageRootUri.toFilePath();
133 } else { 132 } else {
134 packageRootPath = path.join(rootDir, 'packages'); 133 packageRootPath = path.join(rootDir, 'packages');
135 } 134 }
136 JavaFile packagesDir = new JavaFile(packageRootPath); 135 JavaFile packagesDir = new JavaFile(packageRootPath);
137 List<UriResolver> uriResolvers = [ 136 List<UriResolver> uriResolvers = [
138 new DartUriResolver(sdk), 137 new DartUriResolver(sdk),
139 new PackageUriResolver(<JavaFile>[packagesDir]), 138 new PackageUriResolver(<JavaFile>[packagesDir]),
140 new FileUriResolver() 139 new FileUriResolver()
141 ]; 140 ];
142 context.sourceFactory = new SourceFactory(uriResolvers); 141 context.sourceFactory = new SourceFactory(uriResolvers);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 @override 311 @override
313 visitIdentifier(Identifier node) { 312 visitIdentifier(Identifier node) {
314 Element element = node.staticElement; 313 Element element = node.staticElement;
315 if (element is PropertyAccessorElement && 314 if (element is PropertyAccessorElement &&
316 element.isGetter && 315 element.isGetter &&
317 element.returnType.isSubtypeOf(type)) { 316 element.returnType.isSubtypeOf(type)) {
318 callback(element); 317 callback(element);
319 } 318 }
320 } 319 }
321 } 320 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/incremental/hello_test.dart » ('j') | tests/standalone/precompilation_dart2js_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698