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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 PackageBundleAssembler assembler = new PackageBundleAssembler(); | 87 PackageBundleAssembler assembler = new PackageBundleAssembler(); |
88 for (Source source in explicitSources) { | 88 for (Source source in explicitSources) { |
89 if (context.computeKindOf(source) != SourceKind.LIBRARY) { | 89 if (context.computeKindOf(source) != SourceKind.LIBRARY) { |
90 continue; | 90 continue; |
91 } | 91 } |
92 LibraryElement libraryElement = context.computeLibraryElement(source); | 92 LibraryElement libraryElement = context.computeLibraryElement(source); |
93 assembler.serializeLibraryElement(libraryElement); | 93 assembler.serializeLibraryElement(libraryElement); |
94 } | 94 } |
95 // Write the whole package bundle. | 95 // Write the whole package bundle. |
96 PackageBundleBuilder sdkBundle = assembler.assemble(); | 96 PackageBundleBuilder sdkBundle = assembler.assemble(); |
| 97 if (options.buildSummaryExcludeInformative) { |
| 98 sdkBundle.flushInformative(); |
| 99 sdkBundle.unlinkedUnitHashes = null; |
| 100 } |
97 io.File file = new io.File(options.buildSummaryOutput); | 101 io.File file = new io.File(options.buildSummaryOutput); |
98 file.writeAsBytesSync(sdkBundle.toBuffer(), mode: io.FileMode.WRITE_ONLY); | 102 file.writeAsBytesSync(sdkBundle.toBuffer(), mode: io.FileMode.WRITE_ONLY); |
99 } | 103 } |
100 | 104 |
101 if (options.buildSummaryOnly) { | 105 if (options.buildSummaryOnly) { |
102 return ErrorSeverity.NONE; | 106 return ErrorSeverity.NONE; |
103 } else { | 107 } else { |
104 // Process errors. | 108 // Process errors. |
105 _printErrors(outputPath: options.buildAnalysisOutput); | 109 _printErrors(outputPath: options.buildAnalysisOutput); |
106 return _computeMaxSeverity(); | 110 return _computeMaxSeverity(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); | 203 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); |
200 return null; | 204 return null; |
201 } | 205 } |
202 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); | 206 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); |
203 String path = sourceFile.substring(pipeIndex + 1); | 207 String path = sourceFile.substring(pipeIndex + 1); |
204 uriToFileMap[uri] = new JavaFile(path); | 208 uriToFileMap[uri] = new JavaFile(path); |
205 } | 209 } |
206 return uriToFileMap; | 210 return uriToFileMap; |
207 } | 211 } |
208 } | 212 } |
OLD | NEW |