| 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'; | 7 import 'dart:core'; |
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 break; | 185 break; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Write summary. | 190 // Write summary. |
| 191 assembler = new PackageBundleAssembler( | 191 assembler = new PackageBundleAssembler( |
| 192 excludeHashes: options.buildSummaryExcludeInformative && | 192 excludeHashes: options.buildSummaryExcludeInformative && |
| 193 options.buildSummaryOutputSemantic == null); | 193 options.buildSummaryOutputSemantic == null); |
| 194 if (_shouldOutputSummary) { | 194 if (_shouldOutputSummary) { |
| 195 if (!options.buildSummaryFallback) { | 195 _serializeAstBasedSummary(explicitSources); |
| 196 _serializeAstBasedSummary(explicitSources); | |
| 197 } else { | |
| 198 for (Source source in explicitSources) { | |
| 199 assembler.addFallbackUnit(source); | |
| 200 } | |
| 201 } | |
| 202 // Write the whole package bundle. | 196 // Write the whole package bundle. |
| 203 assembler.recordDependencies(summaryDataStore); | 197 assembler.recordDependencies(summaryDataStore); |
| 204 PackageBundleBuilder bundle = assembler.assemble(); | 198 PackageBundleBuilder bundle = assembler.assemble(); |
| 205 if (options.buildSummaryExcludeInformative) { | 199 if (options.buildSummaryExcludeInformative) { |
| 206 bundle.flushInformative(); | 200 bundle.flushInformative(); |
| 207 } | 201 } |
| 208 if (options.buildSummaryOutput != null) { | 202 if (options.buildSummaryOutput != null) { |
| 209 io.File file = new io.File(options.buildSummaryOutput); | 203 io.File file = new io.File(options.buildSummaryOutput); |
| 210 file.writeAsBytesSync(bundle.toBuffer(), mode: io.FileMode.WRITE_ONLY); | 204 file.writeAsBytesSync(bundle.toBuffer(), mode: io.FileMode.WRITE_ONLY); |
| 211 } | 205 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 * Build the inverse mapping of [uriToSourceMap]. | 408 * Build the inverse mapping of [uriToSourceMap]. |
| 415 */ | 409 */ |
| 416 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { | 410 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { |
| 417 Map<String, Uri> pathToUriMap = <String, Uri>{}; | 411 Map<String, Uri> pathToUriMap = <String, Uri>{}; |
| 418 uriToSourceMap.forEach((Uri uri, File file) { | 412 uriToSourceMap.forEach((Uri uri, File file) { |
| 419 pathToUriMap[file.path] = uri; | 413 pathToUriMap[file.path] = uri; |
| 420 }); | 414 }); |
| 421 return pathToUriMap; | 415 return pathToUriMap; |
| 422 } | 416 } |
| 423 } | 417 } |
| OLD | NEW |