OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.src.command_line.arguments; | 5 library analyzer.src.command_line.arguments; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/src/context/builder.dart'; | 10 import 'package:analyzer/src/context/builder.dart'; |
11 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 11 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
12 import 'package:analyzer/src/generated/engine.dart'; | 12 import 'package:analyzer/src/generated/engine.dart'; |
13 import 'package:analyzer/src/generated/sdk.dart'; | 13 import 'package:analyzer/src/generated/sdk.dart'; |
14 import 'package:args/args.dart'; | 14 import 'package:args/args.dart'; |
15 import 'package:path/path.dart'; | 15 import 'package:path/path.dart'; |
16 | 16 |
17 const String analysisOptionsFileOption = 'options'; | 17 const String analysisOptionsFileOption = 'options'; |
| 18 const String bazelAnalysisOptionsPath = |
| 19 'package:dart.analysis_options/default.yaml'; |
18 const String defineVariableOption = 'D'; | 20 const String defineVariableOption = 'D'; |
19 const String enableInitializingFormalAccessFlag = 'initializing-formal-access'; | 21 const String enableInitializingFormalAccessFlag = 'initializing-formal-access'; |
20 const String enableStrictCallChecksFlag = 'enable-strict-call-checks'; | 22 const String enableStrictCallChecksFlag = 'enable-strict-call-checks'; |
21 const String enableSuperMixinFlag = 'supermixin'; | 23 const String enableSuperMixinFlag = 'supermixin'; |
| 24 const String flutterAnalysisOptionsPath = |
| 25 'package:flutter/analysis_options_user.yaml'; |
22 const String ignoreUnrecognizedFlagsFlag = 'ignore-unrecognized-flags'; | 26 const String ignoreUnrecognizedFlagsFlag = 'ignore-unrecognized-flags'; |
23 const String lintsFlag = 'lints'; | 27 const String lintsFlag = 'lints'; |
24 const String noImplicitCastsFlag = 'no-implicit-casts'; | 28 const String noImplicitCastsFlag = 'no-implicit-casts'; |
25 const String noImplicitDynamicFlag = 'no-implicit-dynamic'; | 29 const String noImplicitDynamicFlag = 'no-implicit-dynamic'; |
26 const String packageDefaultAnalysisOptions = 'package-default-analysis-options'; | 30 const String packageDefaultAnalysisOptions = 'package-default-analysis-options'; |
27 const String packageRootOption = 'package-root'; | 31 const String packageRootOption = 'package-root'; |
28 const String packagesOption = 'packages'; | 32 const String packagesOption = 'packages'; |
29 const String sdkPathOption = 'dart-sdk'; | 33 const String sdkPathOption = 'dart-sdk'; |
| 34 |
30 const String sdkSummaryPathOption = 'dart-sdk-summary'; | 35 const String sdkSummaryPathOption = 'dart-sdk-summary'; |
31 const String strongModeFlag = 'strong'; | 36 const String strongModeFlag = 'strong'; |
32 | 37 |
33 const String bazelAnalysisOptionsPath = | |
34 'package:dart.analysis_options/default.yaml'; | |
35 const String flutterAnalysisOptionsPath = | |
36 'package:flutter/analysis_options_user.yaml'; | |
37 | |
38 /** | 38 /** |
39 * Update [options] with the value of each analysis option command line flag. | 39 * Update [options] with the value of each analysis option command line flag. |
40 */ | 40 */ |
41 void applyAnalysisOptionFlags(AnalysisOptionsImpl options, ArgResults args, | 41 void applyAnalysisOptionFlags(AnalysisOptionsImpl options, ArgResults args, |
42 {void verbosePrint(String text)}) { | 42 {void verbosePrint(String text)}) { |
43 void verbose(String text) { | 43 void verbose(String text) { |
44 if (verbosePrint != null) { | 44 if (verbosePrint != null) { |
45 verbosePrint('Analysis options: $text'); | 45 verbosePrint('Analysis options: $text'); |
46 } | 46 } |
47 } | 47 } |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 .replaceAll('\r\n', '\n') | 349 .replaceAll('\r\n', '\n') |
350 .replaceAll('\r', '\n') | 350 .replaceAll('\r', '\n') |
351 .split('\n') | 351 .split('\n') |
352 .where((String line) => line.isNotEmpty)); | 352 .where((String line) => line.isNotEmpty)); |
353 } on FileSystemException catch (e) { | 353 } on FileSystemException catch (e) { |
354 throw new Exception('Failed to read file specified by $lastArg : $e'); | 354 throw new Exception('Failed to read file specified by $lastArg : $e'); |
355 } | 355 } |
356 } | 356 } |
357 return args; | 357 return args; |
358 } | 358 } |
OLD | NEW |