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 | 2 |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import 'package:args/args.dart' show ArgParser, ArgResults; | 6 import 'package:args/args.dart' show ArgParser, ArgResults; |
7 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; | 7 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; |
8 import 'package:analyzer/src/generated/engine.dart' | 8 import 'package:analyzer/src/generated/engine.dart' |
9 show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl; | 9 show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl; |
10 import 'package:analyzer/src/generated/java_io.dart' show JavaFile; | 10 import 'package:analyzer/src/generated/java_io.dart' show JavaFile; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 context.typeProvider = sdkResolver.dartSdk.context.typeProvider; | 135 context.typeProvider = sdkResolver.dartSdk.context.typeProvider; |
136 context.resultProvider = | 136 context.resultProvider = |
137 new InputPackagesResultProvider(context, summaryData); | 137 new InputPackagesResultProvider(context, summaryData); |
138 } | 138 } |
139 return context; | 139 return context; |
140 } | 140 } |
141 | 141 |
142 /// Creates an analysis context that contains our restricted typing rules. | 142 /// Creates an analysis context that contains our restricted typing rules. |
143 AnalysisContextImpl createAnalysisContext() { | 143 AnalysisContextImpl createAnalysisContext() { |
144 var res = AnalysisEngine.instance.createAnalysisContext(); | 144 var res = AnalysisEngine.instance.createAnalysisContext(); |
145 res.analysisOptions = new AnalysisOptionsImpl()..strongMode = true; | 145 res.analysisOptions = new AnalysisOptionsImpl() |
| 146 ..strongMode = true |
| 147 ..trackCacheDependencies = false; |
146 return res; | 148 return res; |
147 } | 149 } |
148 | 150 |
149 /// Creates a SourceFactory configured by the [options]. | 151 /// Creates a SourceFactory configured by the [options]. |
150 /// | 152 /// |
151 /// Use [options.useMockSdk] to specify the SDK mode, or use [sdkResolver] | 153 /// Use [options.useMockSdk] to specify the SDK mode, or use [sdkResolver] |
152 /// to entirely override the DartUriResolver. | 154 /// to entirely override the DartUriResolver. |
153 /// | 155 /// |
154 /// If supplied, [fileResolvers] will override the default `file:` and | 156 /// If supplied, [fileResolvers] will override the default `file:` and |
155 /// `package:` URI resolvers. | 157 /// `package:` URI resolvers. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return sdk; | 194 return sdk; |
193 } | 195 } |
194 | 196 |
195 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. | 197 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. |
196 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) { | 198 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) { |
197 var sdk = (sdkSummaryPath != null) | 199 var sdk = (sdkSummaryPath != null) |
198 ? new SummaryBasedDartSdk(sdkSummaryPath, true) | 200 ? new SummaryBasedDartSdk(sdkSummaryPath, true) |
199 : _createDirectoryBasedDartSdk(sdkPath); | 201 : _createDirectoryBasedDartSdk(sdkPath); |
200 return new DartUriResolver(sdk); | 202 return new DartUriResolver(sdk); |
201 } | 203 } |
OLD | NEW |