| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 * then both will be printed. If [printMode] is `2`, then only performance | 132 * then both will be printed. If [printMode] is `2`, then only performance |
| 133 * information will be printed, and it will be marked as being for a cold VM. | 133 * information will be printed, and it will be marked as being for a cold VM. |
| 134 */ | 134 */ |
| 135 ErrorSeverity analyzeSync({int printMode: 1}) { | 135 ErrorSeverity analyzeSync({int printMode: 1}) { |
| 136 setupForAnalysis(); | 136 setupForAnalysis(); |
| 137 return _analyzeSync(printMode); | 137 return _analyzeSync(printMode); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void prepareAnalysisContext(JavaFile sourceFile, Source source) { | 140 void prepareAnalysisContext(JavaFile sourceFile, Source source) { |
| 141 List<UriResolver> resolvers = [ | 141 List<UriResolver> resolvers = [ |
| 142 new CustomUriResolver(options.customUrlMappings), |
| 142 new DartUriResolver(sdk), | 143 new DartUriResolver(sdk), |
| 143 new FileUriResolver()]; | 144 new FileUriResolver()]; |
| 144 // may be add package resolver | 145 // may be add package resolver |
| 145 { | 146 { |
| 146 JavaFile packageDirectory; | 147 JavaFile packageDirectory; |
| 147 if (options.packageRootPath != null) { | 148 if (options.packageRootPath != null) { |
| 148 packageDirectory = new JavaFile(options.packageRootPath); | 149 packageDirectory = new JavaFile(options.packageRootPath); |
| 149 resolvers.add(new PackageUriResolver([packageDirectory])); | 150 resolvers.add(new PackageUriResolver([packageDirectory])); |
| 150 } else { | 151 } else { |
| 151 PubPackageMapProvider pubPackageMapProvider = | 152 PubPackageMapProvider pubPackageMapProvider = |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 440 } |
| 440 } | 441 } |
| 441 | 442 |
| 442 @override | 443 @override |
| 443 void logInformation2(String message, Object exception) { | 444 void logInformation2(String message, Object exception) { |
| 444 if (log) { | 445 if (log) { |
| 445 stdout.writeln(message); | 446 stdout.writeln(message); |
| 446 } | 447 } |
| 447 } | 448 } |
| 448 } | 449 } |
| OLD | NEW |