Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: pkg/analyzer/tool/summary/build_sdk_summaries.dart

Issue 2078033002: Introduce build configuration to summary building. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 import 'dart:io'; 1 import 'dart:io';
2 2
3 import 'package:analyzer/src/generated/sdk_io.dart'; 3 import 'package:analyzer/src/generated/sdk_io.dart';
4 import 'package:analyzer/src/summary/flat_buffers.dart' as fb; 4 import 'package:analyzer/src/summary/flat_buffers.dart' as fb;
5 import 'package:analyzer/src/summary/summary_file_builder.dart'; 5 import 'package:analyzer/src/summary/summary_file_builder.dart';
6 6
7 main(List<String> args) { 7 main(List<String> args) {
8 if (args.length < 1) { 8 if (args.length < 1) {
9 _printUsage(); 9 _printUsage();
10 exitCode = 1; 10 exitCode = 1;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // 106 //
107 BuilderOutput spec = includeSpec ? _buildOutput(sdkPath, false) : null; 107 BuilderOutput spec = includeSpec ? _buildOutput(sdkPath, false) : null;
108 BuilderOutput strong = _buildOutput(sdkPath, true); 108 BuilderOutput strong = _buildOutput(sdkPath, true);
109 return new SummaryOutput(spec, strong); 109 return new SummaryOutput(spec, strong);
110 } 110 }
111 111
112 BuilderOutput _buildOutput(String sdkPath, bool strongMode) { 112 BuilderOutput _buildOutput(String sdkPath, bool strongMode) {
113 String modeName = strongMode ? 'strong' : 'spec'; 113 String modeName = strongMode ? 'strong' : 'spec';
114 print('Generating $modeName mode summary and index.'); 114 print('Generating $modeName mode summary and index.');
115 Stopwatch sw = new Stopwatch()..start(); 115 Stopwatch sw = new Stopwatch()..start();
116 BuilderOutput output = new SummaryBuilder.forSdk(sdkPath, strongMode).build(); 116 SummaryBuildConfig config = new SummaryBuildConfig(strongMode: strongMode);
117 BuilderOutput output = new SummaryBuilder.forSdk(sdkPath, config).build();
117 print('\tDone in ${sw.elapsedMilliseconds} ms.'); 118 print('\tDone in ${sw.elapsedMilliseconds} ms.');
118 return output; 119 return output;
119 } 120 }
120 121
121 /** 122 /**
122 * Open the flat buffer in [inputPath] and extract the byte array in the [field] 123 * Open the flat buffer in [inputPath] and extract the byte array in the [field]
123 * into the [outputPath] file. 124 * into the [outputPath] file.
124 */ 125 */
125 void _extractSingleOutput(String inputPath, int field, String outputPath) { 126 void _extractSingleOutput(String inputPath, int field, String outputPath) {
126 List<int> bytes = new File(inputPath).readAsBytesSync(); 127 List<int> bytes = new File(inputPath).readAsBytesSync();
(...skipping 19 matching lines...) Expand all
146 print(' Generate a single file with summary and index.'); 147 print(' Generate a single file with summary and index.');
147 print(' extract-spec-sum input_file output_file'); 148 print(' extract-spec-sum input_file output_file');
148 print(' Extract the spec-mode summary file.'); 149 print(' Extract the spec-mode summary file.');
149 print(' extract-strong-sum input_file output_file'); 150 print(' extract-strong-sum input_file output_file');
150 print(' Extract the strong-mode summary file.'); 151 print(' Extract the strong-mode summary file.');
151 print(' extract-spec-index input_file output_file'); 152 print(' extract-spec-index input_file output_file');
152 print(' Extract the spec-mode index file.'); 153 print(' Extract the spec-mode index file.');
153 print(' extract-strong-index input_file output_file'); 154 print(' extract-strong-index input_file output_file');
154 print(' Extract the strong-mode index file.'); 155 print(' Extract the strong-mode index file.');
155 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698