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/ast/ast.dart' show CompilationUnit; | 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 options.dartSdkSummaryPath, options.strongMode); | 250 options.dartSdkSummaryPath, options.strongMode); |
251 sdk = summarySdk; | 251 sdk = summarySdk; |
252 sdkBundle = summarySdk.bundle; | 252 sdkBundle = summarySdk.bundle; |
253 } else { | 253 } else { |
254 DirectoryBasedDartSdk directorySdk = | 254 DirectoryBasedDartSdk directorySdk = |
255 new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath)); | 255 new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath)); |
256 directorySdk.analysisOptions = | 256 directorySdk.analysisOptions = |
257 Driver.createAnalysisOptionsForCommandLineOptions(options); | 257 Driver.createAnalysisOptionsForCommandLineOptions(options); |
258 directorySdk.useSummary = !options.buildSummaryOnlyAst; | 258 directorySdk.useSummary = !options.buildSummaryOnlyAst; |
259 sdk = directorySdk; | 259 sdk = directorySdk; |
260 sdkBundle = directorySdk.getSummarySdkBundle(); | 260 sdkBundle = directorySdk.getSummarySdkBundle(options.strongMode); |
261 } | 261 } |
262 | 262 |
263 // In AST mode include SDK bundle to avoid parsing SDK sources. | 263 // In AST mode include SDK bundle to avoid parsing SDK sources. |
264 if (options.buildSummaryOnlyAst) { | 264 if (options.buildSummaryOnlyAst) { |
265 summaryDataStore.addBundle(null, sdkBundle); | 265 summaryDataStore.addBundle(null, sdkBundle); |
266 } | 266 } |
267 | 267 |
268 // Create the context. | 268 // Create the context. |
269 context = AnalysisEngine.instance.createAnalysisContext(); | 269 context = AnalysisEngine.instance.createAnalysisContext(); |
270 context.sourceFactory = new SourceFactory(<UriResolver>[ | 270 context.sourceFactory = new SourceFactory(<UriResolver>[ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); | 371 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); |
372 return null; | 372 return null; |
373 } | 373 } |
374 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); | 374 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); |
375 String path = sourceFile.substring(pipeIndex + 1); | 375 String path = sourceFile.substring(pipeIndex + 1); |
376 uriToFileMap[uri] = new JavaFile(path); | 376 uriToFileMap[uri] = new JavaFile(path); |
377 } | 377 } |
378 return uriToFileMap; | 378 return uriToFileMap; |
379 } | 379 } |
380 } | 380 } |
OLD | NEW |