| 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.build_mode; | 5 library analyzer_cli.src.build_mode; |
| 6 | 6 |
| 7 import 'dart:core' hide Resource; | 7 import 'dart:core' hide Resource; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Create the context. | 138 // Create the context. |
| 139 context = AnalysisEngine.instance.createAnalysisContext(); | 139 context = AnalysisEngine.instance.createAnalysisContext(); |
| 140 context.sourceFactory = new SourceFactory(<UriResolver>[ | 140 context.sourceFactory = new SourceFactory(<UriResolver>[ |
| 141 new DartUriResolver(sdk), | 141 new DartUriResolver(sdk), |
| 142 new InSummaryPackageUriResolver(summaryDataStore), | 142 new InSummaryPackageUriResolver(summaryDataStore), |
| 143 new ExplicitSourceResolver(uriToFileMap) | 143 new ExplicitSourceResolver(uriToFileMap) |
| 144 ]); | 144 ]); |
| 145 | 145 |
| 146 // Set context options. | 146 // Set context options. |
| 147 Driver.setAnalysisContextOptions( | 147 Driver.setAnalysisContextOptions( |
| 148 context, options, (AnalysisOptionsImpl contextOptions) {}); | 148 context, options, (AnalysisOptionsImpl contextOptions) { |
| 149 if (options.buildSummaryOnlyDiet) { |
| 150 contextOptions.analyzeFunctionBodies = false; |
| 151 } |
| 152 }); |
| 149 | 153 |
| 150 // Configure using summaries. | 154 // Configure using summaries. |
| 151 context.typeProvider = sdk.context.typeProvider; | 155 context.typeProvider = sdk.context.typeProvider; |
| 152 context.resultProvider = | 156 context.resultProvider = |
| 153 new InputPackagesResultProvider(context, summaryDataStore); | 157 new InputPackagesResultProvider(context, summaryDataStore); |
| 154 } | 158 } |
| 155 | 159 |
| 156 /** | 160 /** |
| 157 * Print errors for all explicit sources. If [outputPath] is supplied, output | 161 * Print errors for all explicit sources. If [outputPath] is supplied, output |
| 158 * is sent to a new file at that path. | 162 * is sent to a new file at that path. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); | 199 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); |
| 196 return null; | 200 return null; |
| 197 } | 201 } |
| 198 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); | 202 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); |
| 199 String path = sourceFile.substring(pipeIndex + 1); | 203 String path = sourceFile.substring(pipeIndex + 1); |
| 200 uriToFileMap[uri] = new JavaFile(path); | 204 uriToFileMap[uri] = new JavaFile(path); |
| 201 } | 205 } |
| 202 return uriToFileMap; | 206 return uriToFileMap; |
| 203 } | 207 } |
| 204 } | 208 } |
| OLD | NEW |