| 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'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 setAnalysisContextOptions(_context, options, | 478 setAnalysisContextOptions(_context, options, |
| 479 (AnalysisOptionsImpl contextOptions) { | 479 (AnalysisOptionsImpl contextOptions) { |
| 480 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy; | 480 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy; |
| 481 }); | 481 }); |
| 482 | 482 |
| 483 // Find package info. | 483 // Find package info. |
| 484 _PackageInfo packageInfo = _findPackages(options); | 484 _PackageInfo packageInfo = _findPackages(options); |
| 485 | 485 |
| 486 // Process embedders. | 486 // Process embedders. |
| 487 Map<file_system.Folder, YamlMap> embedderMap = | 487 Map<file_system.Folder, YamlMap> embedderMap = |
| 488 _findEmbedders(packageInfo.packageMap); | 488 new EmbedderYamlLocator(packageInfo.packageMap).embedderYamls; |
| 489 | 489 |
| 490 // Scan for SDK extenders. | 490 // Scan for SDK extenders. |
| 491 bool hasSdkExt = _hasSdkExt(packageInfo.packageMap?.values); | 491 bool hasSdkExt = _hasSdkExt(packageInfo.packageMap?.values); |
| 492 | 492 |
| 493 // No summaries in the presence of embedders or extenders. | 493 // No summaries in the presence of embedders or extenders. |
| 494 bool useSummaries = embedderMap.isEmpty && !hasSdkExt; | 494 bool useSummaries = embedderMap.isEmpty && !hasSdkExt; |
| 495 | 495 |
| 496 // Once options and embedders are processed, setup the SDK. | 496 // Once options and embedders are processed, setup the SDK. |
| 497 _setupSdk(options, useSummaries); | 497 _setupSdk(options, useSummaries); |
| 498 | 498 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 513 if (packages != Packages.noPackages) { | 513 if (packages != Packages.noPackages) { |
| 514 return packages; | 514 return packages; |
| 515 } | 515 } |
| 516 } catch (_) { | 516 } catch (_) { |
| 517 // Ignore and fall through to null. | 517 // Ignore and fall through to null. |
| 518 } | 518 } |
| 519 | 519 |
| 520 return null; | 520 return null; |
| 521 } | 521 } |
| 522 | 522 |
| 523 Map<file_system.Folder, YamlMap> _findEmbedders( | |
| 524 Map<String, List<file_system.Folder>> packageMap) { | |
| 525 EmbedderYamlLocator locator = | |
| 526 (_context as InternalAnalysisContext).embedderYamlLocator; | |
| 527 locator.refresh(packageMap); | |
| 528 return locator.embedderYamls; | |
| 529 } | |
| 530 | |
| 531 _PackageInfo _findPackages(CommandLineOptions options) { | 523 _PackageInfo _findPackages(CommandLineOptions options) { |
| 532 if (packageResolverProvider != null) { | 524 if (packageResolverProvider != null) { |
| 533 // The resolver provider will do all the work later. | 525 // The resolver provider will do all the work later. |
| 534 return null; | 526 return null; |
| 535 } | 527 } |
| 536 | 528 |
| 537 Packages packages; | 529 Packages packages; |
| 538 Map<String, List<file_system.Folder>> packageMap; | 530 Map<String, List<file_system.Folder>> packageMap; |
| 539 | 531 |
| 540 if (options.packageConfigPath != null) { | 532 if (options.packageConfigPath != null) { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 for (var package in packages) { | 832 for (var package in packages) { |
| 841 var packageName = path.basename(package.path); | 833 var packageName = path.basename(package.path); |
| 842 var realPath = package.resolveSymbolicLinksSync(); | 834 var realPath = package.resolveSymbolicLinksSync(); |
| 843 result[packageName] = [ | 835 result[packageName] = [ |
| 844 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 836 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
| 845 ]; | 837 ]; |
| 846 } | 838 } |
| 847 return result; | 839 return result; |
| 848 } | 840 } |
| 849 } | 841 } |
| OLD | NEW |