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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 741 |
742 String contextRoot; | 742 String contextRoot; |
743 if (options.sourceFiles.isEmpty) { | 743 if (options.sourceFiles.isEmpty) { |
744 contextRoot = path.current; | 744 contextRoot = path.current; |
745 } else { | 745 } else { |
746 contextRoot = options.sourceFiles[0]; | 746 contextRoot = options.sourceFiles[0]; |
747 if (!path.isAbsolute(contextRoot)) { | 747 if (!path.isAbsolute(contextRoot)) { |
748 contextRoot = path.absolute(contextRoot); | 748 contextRoot = path.absolute(contextRoot); |
749 } | 749 } |
750 } | 750 } |
| 751 |
| 752 void verbosePrint(String text) { |
| 753 outSink.writeln(text); |
| 754 } |
| 755 |
751 AnalysisOptionsImpl contextOptions = new ContextBuilder( | 756 AnalysisOptionsImpl contextOptions = new ContextBuilder( |
752 resourceProvider, null, null, | 757 resourceProvider, null, null, |
753 options: options.contextBuilderOptions) | 758 options: options.contextBuilderOptions) |
754 .getAnalysisOptions(contextRoot); | 759 .getAnalysisOptions(contextRoot, |
| 760 verbosePrint: options.verbose ? verbosePrint : null); |
755 | 761 |
756 contextOptions.trackCacheDependencies = false; | 762 contextOptions.trackCacheDependencies = false; |
757 contextOptions.disableCacheFlushing = options.disableCacheFlushing; | 763 contextOptions.disableCacheFlushing = options.disableCacheFlushing; |
758 contextOptions.hint = !options.disableHints; | 764 contextOptions.hint = !options.disableHints; |
759 contextOptions.generateImplicitErrors = options.showPackageWarnings; | 765 contextOptions.generateImplicitErrors = options.showPackageWarnings; |
760 contextOptions.generateSdkErrors = options.showSdkWarnings; | 766 contextOptions.generateSdkErrors = options.showSdkWarnings; |
761 | 767 |
762 return contextOptions; | 768 return contextOptions; |
763 } | 769 } |
764 | 770 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 for (var package in packages) { | 912 for (var package in packages) { |
907 var packageName = path.basename(package.path); | 913 var packageName = path.basename(package.path); |
908 var realPath = package.resolveSymbolicLinksSync(); | 914 var realPath = package.resolveSymbolicLinksSync(); |
909 result[packageName] = [ | 915 result[packageName] = [ |
910 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 916 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
911 ]; | 917 ]; |
912 } | 918 } |
913 return result; | 919 return result; |
914 } | 920 } |
915 } | 921 } |
OLD | NEW |