OLD | NEW |
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 library analyzer_cli.src.driver; | 5 library analyzer_cli.src.driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
10 | 10 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 resolver, | 366 resolver, |
367 new file_system.ResourceUriResolver(resourceProvider) | 367 new file_system.ResourceUriResolver(resourceProvider) |
368 ]; | 368 ]; |
369 return new SourceFactory(resolvers); | 369 return new SourceFactory(resolvers); |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 UriResolver packageUriResolver; | 373 UriResolver packageUriResolver; |
374 | 374 |
375 if (options.packageRootPath != null) { | 375 if (options.packageRootPath != null) { |
376 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); | 376 ContextBuilderOptions builderOptions = new ContextBuilderOptions(); |
377 builder.defaultPackagesDirectoryPath = options.packageRootPath; | 377 builderOptions.defaultPackagesDirectoryPath = options.packageRootPath; |
| 378 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null, |
| 379 options: builderOptions); |
378 packageUriResolver = new PackageMapUriResolver(resourceProvider, | 380 packageUriResolver = new PackageMapUriResolver(resourceProvider, |
379 builder.convertPackagesToMap(builder.createPackageMap(''))); | 381 builder.convertPackagesToMap(builder.createPackageMap(''))); |
380 } else if (options.packageConfigPath == null) { | 382 } else if (options.packageConfigPath == null) { |
381 // TODO(pq): remove? | 383 // TODO(pq): remove? |
382 if (packageInfo.packageMap == null) { | 384 if (packageInfo.packageMap == null) { |
383 // Fall back to pub list-package-dirs. | 385 // Fall back to pub list-package-dirs. |
384 PubPackageMapProvider pubPackageMapProvider = | 386 PubPackageMapProvider pubPackageMapProvider = |
385 new PubPackageMapProvider(resourceProvider, sdk); | 387 new PubPackageMapProvider(resourceProvider, sdk); |
386 file_system.Resource cwd = resourceProvider.getResource('.'); | 388 file_system.Resource cwd = resourceProvider.getResource('.'); |
387 PackageMapInfo packageMapInfo = | 389 PackageMapInfo packageMapInfo = |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 for (var package in packages) { | 879 for (var package in packages) { |
878 var packageName = path.basename(package.path); | 880 var packageName = path.basename(package.path); |
879 var realPath = package.resolveSymbolicLinksSync(); | 881 var realPath = package.resolveSymbolicLinksSync(); |
880 result[packageName] = [ | 882 result[packageName] = [ |
881 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 883 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
882 ]; | 884 ]; |
883 } | 885 } |
884 return result; | 886 return result; |
885 } | 887 } |
886 } | 888 } |
OLD | NEW |