OLD | NEW |
1 import 'dart:io'; | 1 import 'dart:io'; |
2 | 2 |
3 import 'package:analyzer/src/generated/sdk_io.dart'; | 3 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 4 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
4 import 'package:analyzer/src/summary/flat_buffers.dart' as fb; | 5 import 'package:analyzer/src/summary/flat_buffers.dart' as fb; |
5 import 'package:analyzer/src/summary/summary_file_builder.dart'; | 6 import 'package:analyzer/src/summary/summary_file_builder.dart'; |
6 | 7 |
7 main(List<String> args) { | 8 main(List<String> args) { |
8 if (args.length < 1) { | 9 if (args.length < 1) { |
9 _printUsage(); | 10 _printUsage(); |
10 exitCode = 1; | 11 exitCode = 1; |
11 return; | 12 return; |
12 } | 13 } |
13 String command = args[0]; | 14 String command = args[0]; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // | 92 // |
92 // Validate the SDK path. | 93 // Validate the SDK path. |
93 // | 94 // |
94 if (sdkPath != null) { | 95 if (sdkPath != null) { |
95 if (!FileSystemEntity.isDirectorySync('$sdkPath/lib')) { | 96 if (!FileSystemEntity.isDirectorySync('$sdkPath/lib')) { |
96 print("'$sdkPath/lib' does not exist."); | 97 print("'$sdkPath/lib' does not exist."); |
97 _printUsage(); | 98 _printUsage(); |
98 return null; | 99 return null; |
99 } | 100 } |
100 } else { | 101 } else { |
101 sdkPath = DirectoryBasedDartSdk.defaultSdkDirectory.getAbsolutePath(); | 102 sdkPath = FolderBasedDartSdk |
| 103 .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE) |
| 104 .path; |
102 } | 105 } |
103 | 106 |
104 // | 107 // |
105 // Build spec and strong outputs. | 108 // Build spec and strong outputs. |
106 // | 109 // |
107 BuilderOutput spec = includeSpec ? _buildOutput(sdkPath, false) : null; | 110 BuilderOutput spec = includeSpec ? _buildOutput(sdkPath, false) : null; |
108 BuilderOutput strong = _buildOutput(sdkPath, true); | 111 BuilderOutput strong = _buildOutput(sdkPath, true); |
109 return new SummaryOutput(spec, strong); | 112 return new SummaryOutput(spec, strong); |
110 } | 113 } |
111 | 114 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 print(' Generate a single file with summary and index.'); | 150 print(' Generate a single file with summary and index.'); |
148 print(' extract-spec-sum input_file output_file'); | 151 print(' extract-spec-sum input_file output_file'); |
149 print(' Extract the spec-mode summary file.'); | 152 print(' Extract the spec-mode summary file.'); |
150 print(' extract-strong-sum input_file output_file'); | 153 print(' extract-strong-sum input_file output_file'); |
151 print(' Extract the strong-mode summary file.'); | 154 print(' Extract the strong-mode summary file.'); |
152 print(' extract-spec-index input_file output_file'); | 155 print(' extract-spec-index input_file output_file'); |
153 print(' Extract the spec-mode index file.'); | 156 print(' Extract the spec-mode index file.'); |
154 print(' extract-strong-index input_file output_file'); | 157 print(' extract-strong-index input_file output_file'); |
155 print(' Extract the strong-mode index file.'); | 158 print(' Extract the strong-mode index file.'); |
156 } | 159 } |
OLD | NEW |