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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 exitCode = errorSeverity.ordinal; | 580 exitCode = errorSeverity.ordinal; |
581 } | 581 } |
582 return errorSeverity; | 582 return errorSeverity; |
583 } | 583 } |
584 | 584 |
585 void _setupEnv(CommandLineOptions options) { | 585 void _setupEnv(CommandLineOptions options) { |
586 // In batch mode, SDK is specified on the main command line rather than in | 586 // In batch mode, SDK is specified on the main command line rather than in |
587 // the command lines sent to stdin. So process it before deciding whether | 587 // the command lines sent to stdin. So process it before deciding whether |
588 // to activate batch mode. | 588 // to activate batch mode. |
589 if (sdk == null) { | 589 if (sdk == null) { |
590 sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath)); | 590 String dartSdkPath = options.dartSdkPath; |
591 sdk.useSummary = true; | 591 sdk = new DirectoryBasedDartSdk(new JavaFile(dartSdkPath)); |
| 592 sdk.useSummary = options.sourceFiles.every((String sourcePath) { |
| 593 sourcePath = path.absolute(sourcePath); |
| 594 sourcePath = path.normalize(sourcePath); |
| 595 return !path.isWithin(dartSdkPath, sourcePath); |
| 596 }); |
592 sdk.analysisOptions = createAnalysisOptionsForCommandLineOptions(options); | 597 sdk.analysisOptions = createAnalysisOptionsForCommandLineOptions(options); |
593 } | 598 } |
594 _isBatch = options.shouldBatch; | 599 _isBatch = options.shouldBatch; |
595 } | 600 } |
596 | 601 |
597 static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions( | 602 static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions( |
598 CommandLineOptions options) { | 603 CommandLineOptions options) { |
599 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); | 604 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); |
600 contextOptions.hint = !options.disableHints; | 605 contextOptions.hint = !options.disableHints; |
601 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; | 606 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 for (var package in packages) { | 783 for (var package in packages) { |
779 var packageName = path.basename(package.path); | 784 var packageName = path.basename(package.path); |
780 var realPath = package.resolveSymbolicLinksSync(); | 785 var realPath = package.resolveSymbolicLinksSync(); |
781 result[packageName] = [ | 786 result[packageName] = [ |
782 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 787 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
783 ]; | 788 ]; |
784 } | 789 } |
785 return result; | 790 return result; |
786 } | 791 } |
787 } | 792 } |
OLD | NEW |