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

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

Issue 2258873002: Remove deprecated DirectoryBasedDartSdk (Closed) Base URL: https://github.com/dart-lang/dev_compiler.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
« no previous file with comments | « no previous file | 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 2
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 import 'package:args/args.dart' show ArgParser, ArgResults; 6 import 'package:args/args.dart' show ArgParser, ArgResults;
7 import 'package:analyzer/file_system/file_system.dart' 7 import 'package:analyzer/file_system/file_system.dart'
8 show ResourceProvider, ResourceUriResolver; 8 show ResourceProvider, ResourceUriResolver;
9 import 'package:analyzer/file_system/physical_file_system.dart' 9 import 'package:analyzer/file_system/physical_file_system.dart'
10 show PhysicalResourceProvider; 10 show PhysicalResourceProvider;
11 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; 11 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
12 import 'package:analyzer/src/dart/sdk/sdk.dart' show FolderBasedDartSdk;
12 import 'package:analyzer/src/generated/engine.dart' 13 import 'package:analyzer/src/generated/engine.dart'
13 show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl; 14 show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl;
14 import 'package:analyzer/src/generated/java_io.dart' show JavaFile; 15 import 'package:analyzer/src/generated/java_io.dart' show JavaFile;
15 import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
16 import 'package:analyzer/src/generated/source.dart'; 16 import 'package:analyzer/src/generated/source.dart';
17 import 'package:analyzer/src/generated/source_io.dart' 17 import 'package:analyzer/src/generated/source_io.dart'
18 show 18 show
19 CustomUriResolver, 19 CustomUriResolver,
20 DartUriResolver, 20 DartUriResolver,
21 PackageUriResolver, 21 PackageUriResolver,
22 SourceFactory, 22 SourceFactory,
23 UriResolver; 23 UriResolver;
24 import 'package:analyzer/src/summary/package_bundle_reader.dart' 24 import 'package:analyzer/src/summary/package_bundle_reader.dart'
25 show 25 show
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 List<UriResolver> createFileResolvers(AnalyzerOptions options) { 177 List<UriResolver> createFileResolvers(AnalyzerOptions options) {
178 return [ 178 return [
179 new ResourceUriResolver(PhysicalResourceProvider.INSTANCE), 179 new ResourceUriResolver(PhysicalResourceProvider.INSTANCE),
180 options.useMultiPackage 180 options.useMultiPackage
181 ? new MultiPackageResolver(options.packagePaths) 181 ? new MultiPackageResolver(options.packagePaths)
182 : new PackageUriResolver([new JavaFile(options.packageRoot)]) 182 : new PackageUriResolver([new JavaFile(options.packageRoot)])
183 ]; 183 ];
184 } 184 }
185 185
186 DirectoryBasedDartSdk _createDirectoryBasedDartSdk(String sdkPath) { 186 FolderBasedDartSdk _createFolderBasedDartSdk(String sdkPath) {
Brian Wilkerson 2016/08/18 14:41:26 Return "DartSdk"?
vsm 2016/08/18 14:50:12 Ack - I'll leave as is since it's a private method
187 var sdk = new DirectoryBasedDartSdk( 187 var resourceProvider = PhysicalResourceProvider.INSTANCE;
188 new JavaFile(sdkPath), /*useDart2jsPaths:*/ true); 188 var sdk = new FolderBasedDartSdk(resourceProvider,
189 resourceProvider.getFolder(sdkPath), /*useDart2jsPaths:*/ true);
189 sdk.useSummary = true; 190 sdk.useSummary = true;
190 sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = true; 191 sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = true;
191 return sdk; 192 return sdk;
192 } 193 }
193 194
194 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. 195 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath].
195 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) { 196 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) {
196 var sdk = (sdkSummaryPath != null) 197 var sdk = (sdkSummaryPath != null)
197 ? new SummaryBasedDartSdk(sdkSummaryPath, true) 198 ? new SummaryBasedDartSdk(sdkSummaryPath, true)
198 : _createDirectoryBasedDartSdk(sdkPath); 199 : _createFolderBasedDartSdk(sdkPath);
199 return new DartUriResolver(sdk); 200 return new DartUriResolver(sdk);
200 } 201 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698