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

Side by Side Diff: pkg/analyzer_cli/lib/src/options.dart

Issue 2657903006: Implement using AnalysisDriver in analyzer_cli. Disabled. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.options; 5 library analyzer_cli.src.options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/file_system/physical_file_system.dart'; 9 import 'package:analyzer/file_system/physical_file_system.dart';
10 import 'package:analyzer/src/command_line/arguments.dart'; 10 import 'package:analyzer/src/command_line/arguments.dart';
(...skipping 15 matching lines...) Expand all
26 exitHandler(exitCode); 26 exitHandler(exitCode);
27 } 27 }
28 28
29 /// Exit handler. 29 /// Exit handler.
30 /// 30 ///
31 /// *Visible for testing.* 31 /// *Visible for testing.*
32 typedef void ExitHandler(int code); 32 typedef void ExitHandler(int code);
33 33
34 /// Analyzer commandline configuration options. 34 /// Analyzer commandline configuration options.
35 class CommandLineOptions { 35 class CommandLineOptions {
36 final bool enableNewAnalysisDriver = false;
37
36 /// The path to output analysis results when in build mode. 38 /// The path to output analysis results when in build mode.
37 final String buildAnalysisOutput; 39 final String buildAnalysisOutput;
38 40
39 /// Whether to use build mode. 41 /// Whether to use build mode.
40 final bool buildMode; 42 final bool buildMode;
41 43
42 /// Whether to use build mode as a Bazel persistent worker. 44 /// Whether to use build mode as a Bazel persistent worker.
43 final bool buildModePersistentWorker; 45 final bool buildModePersistentWorker;
44 46
45 /// List of summary file paths to use in build mode. 47 /// List of summary file paths to use in build mode.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 193
192 /// Whether to strictly follow the specification when generating warnings on 194 /// Whether to strictly follow the specification when generating warnings on
193 /// "call" methods (fixes dartbug.com/21938). 195 /// "call" methods (fixes dartbug.com/21938).
194 bool get enableStrictCallChecks => 196 bool get enableStrictCallChecks =>
195 contextBuilderOptions.defaultOptions.enableStrictCallChecks; 197 contextBuilderOptions.defaultOptions.enableStrictCallChecks;
196 198
197 /// Whether to relax restrictions on mixins (DEP 34). 199 /// Whether to relax restrictions on mixins (DEP 34).
198 bool get enableSuperMixins => 200 bool get enableSuperMixins =>
199 contextBuilderOptions.defaultOptions.enableSuperMixins; 201 contextBuilderOptions.defaultOptions.enableSuperMixins;
200 202
203 /// The path to a `.packages` configuration file
204 String get packageConfigPath => contextBuilderOptions.defaultPackageFilePath;
205
201 /// The path to the package root 206 /// The path to the package root
202 String get packageRootPath => 207 String get packageRootPath =>
203 contextBuilderOptions.defaultPackagesDirectoryPath; 208 contextBuilderOptions.defaultPackagesDirectoryPath;
204 209
205 /// The path to a `.packages` configuration file
206 String get packageConfigPath => contextBuilderOptions.defaultPackageFilePath;
207
208 /// Parse [args] into [CommandLineOptions] describing the specified 210 /// Parse [args] into [CommandLineOptions] describing the specified
209 /// analyzer options. In case of a format error, calls [printAndFail], which 211 /// analyzer options. In case of a format error, calls [printAndFail], which
210 /// by default prints an error message to stderr and exits. 212 /// by default prints an error message to stderr and exits.
211 static CommandLineOptions parse(List<String> args, 213 static CommandLineOptions parse(List<String> args,
212 [printAndFail(String msg) = printAndFail]) { 214 [printAndFail(String msg) = printAndFail]) {
213 CommandLineOptions options = _parse(args); 215 CommandLineOptions options = _parse(args);
214 // Check SDK. 216 // Check SDK.
215 if (!options.buildModePersistentWorker) { 217 if (!options.buildModePersistentWorker) {
216 // Infer if unspecified. 218 // Infer if unspecified.
217 if (options.dartSdkPath == null) { 219 if (options.dartSdkPath == null) {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 529
528 static _showUsage(parser) { 530 static _showUsage(parser) {
529 errorSink 531 errorSink
530 .writeln('Usage: $_binaryName [options...] <libraries to analyze...>'); 532 .writeln('Usage: $_binaryName [options...] <libraries to analyze...>');
531 errorSink.writeln(parser.getUsage()); 533 errorSink.writeln(parser.getUsage());
532 errorSink.writeln(''); 534 errorSink.writeln('');
533 errorSink.writeln( 535 errorSink.writeln(
534 'For more information, see http://www.dartlang.org/tools/analyzer.'); 536 'For more information, see http://www.dartlang.org/tools/analyzer.');
535 } 537 }
536 } 538 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698