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

Side by Side Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2239303004: Normalize paths in PhysicalResourceProvider.getFile()/getFolder(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 analyzer.src.context.context_builder; 5 library analyzer.src.context.context_builder;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return context; 137 return context;
138 } 138 }
139 139
140 Map<String, List<Folder>> convertPackagesToMap(Packages packages) { 140 Map<String, List<Folder>> convertPackagesToMap(Packages packages) {
141 if (packages == null || packages == Packages.noPackages) { 141 if (packages == null || packages == Packages.noPackages) {
142 return null; 142 return null;
143 } 143 }
144 Map<String, List<Folder>> folderMap = new HashMap<String, List<Folder>>(); 144 Map<String, List<Folder>> folderMap = new HashMap<String, List<Folder>>();
145 packages.asMap().forEach((String packagePath, Uri uri) { 145 packages.asMap().forEach((String packagePath, Uri uri) {
146 String path = resourceProvider.pathContext.fromUri(uri); 146 String path = resourceProvider.pathContext.fromUri(uri);
147 if (path.endsWith(resourceProvider.pathContext.separator)) {
148 path = path.substring(0, path.length - 1);
149 }
150 folderMap[packagePath] = [resourceProvider.getFolder(path)]; 147 folderMap[packagePath] = [resourceProvider.getFolder(path)];
151 }); 148 });
152 return folderMap; 149 return folderMap;
153 } 150 }
154 151
155 // void _processAnalysisOptions( 152 // void _processAnalysisOptions(
156 // AnalysisContext context, Map<String, YamlNode> optionMap) { 153 // AnalysisContext context, Map<String, YamlNode> optionMap) {
157 // List<OptionsProcessor> optionsProcessors = 154 // List<OptionsProcessor> optionsProcessors =
158 // AnalysisEngine.instance.optionsPlugin.optionsProcessors; 155 // AnalysisEngine.instance.optionsPlugin.optionsProcessors;
159 // try { 156 // try {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 String _readEmbedderYaml(Folder libDir) { 441 String _readEmbedderYaml(Folder libDir) {
445 File file = libDir.getChild(EMBEDDER_FILE_NAME); 442 File file = libDir.getChild(EMBEDDER_FILE_NAME);
446 try { 443 try {
447 return file.readAsStringSync(); 444 return file.readAsStringSync();
448 } on FileSystemException { 445 } on FileSystemException {
449 // File can't be read. 446 // File can't be read.
450 return null; 447 return null;
451 } 448 }
452 } 449 }
453 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698