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

Side by Side Diff: pkg/analyzer/lib/src/command_line/arguments.dart

Issue 2598593003: support --options flag and other analysis options flags in DDC (Closed)
Patch Set: add missing tests Created 4 years 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 // 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';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 abbr: 'D', 112 abbr: 'D',
113 allowMultiple: true, 113 allowMultiple: true,
114 help: 'Define environment variables. For example, "-Dfoo=bar" defines an ' 114 help: 'Define environment variables. For example, "-Dfoo=bar" defines an '
115 'environment variable named "foo" whose value is "bar".'); 115 'environment variable named "foo" whose value is "bar".');
116 116
117 parser.addOption(sdkPathOption, help: 'The path to the Dart SDK.'); 117 parser.addOption(sdkPathOption, help: 'The path to the Dart SDK.');
118 parser.addOption(sdkSummaryPathOption, 118 parser.addOption(sdkSummaryPathOption,
119 help: 'The path to the Dart SDK summary file.', hide: hide); 119 help: 'The path to the Dart SDK summary file.', hide: hide);
120 120
121 parser.addOption(analysisOptionsFileOption, 121 parser.addOption(analysisOptionsFileOption,
122 help: 'Path to an analysis options file.', hide: ddc); 122 help: 'Path to an analysis options file.');
123 123
124 parser.addOption(packageRootOption, 124 parser.addOption(packageRootOption,
125 abbr: 'p', 125 abbr: 'p',
126 help: 'The path to a package root directory (deprecated). ' 126 help: 'The path to a package root directory (deprecated). '
127 'This option cannot be used with --packages.'); 127 'This option cannot be used with --packages.');
128 parser.addOption(packagesOption, 128 parser.addOption(packagesOption,
129 help: 'The path to the package resolution configuration file, which ' 129 help: 'The path to the package resolution configuration file, which '
130 'supplies a mapping of package names to paths. This option cannot be ' 130 'supplies a mapping of package names to paths. This option cannot be '
131 'used with --package-root.', 131 'used with --package-root.',
132 hide: ddc); 132 hide: ddc);
133 133
134 parser.addFlag(strongModeFlag, 134 parser.addFlag(strongModeFlag,
135 help: 'Enable strong static checks (https://goo.gl/DqcBsw)', 135 help: 'Enable strong static checks (https://goo.gl/DqcBsw)',
136 defaultsTo: ddc, 136 defaultsTo: ddc);
137 hide: ddc);
138 parser.addFlag(noImplicitCastsFlag, 137 parser.addFlag(noImplicitCastsFlag,
139 negatable: false, 138 negatable: false,
140 help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)', 139 help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)');
141 hide: ddc);
142 parser.addFlag(noImplicitDynamicFlag, 140 parser.addFlag(noImplicitDynamicFlag,
143 negatable: false, 141 negatable: false,
144 help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)', 142 help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)');
145 hide: ddc);
146 // 143 //
147 // Hidden flags and options. 144 // Hidden flags and options.
148 // 145 //
149 // parser.addFlag(enableNullAwareOperatorsFlag, // 'enable-null-aware-operators ' 146 // parser.addFlag(enableNullAwareOperatorsFlag, // 'enable-null-aware-operators '
150 // help: 'Enable support for null-aware operators (DEP 9).', 147 // help: 'Enable support for null-aware operators (DEP 9).',
151 // defaultsTo: false, 148 // defaultsTo: false,
152 // negatable: false, 149 // negatable: false,
153 // hide: hide || ddc); 150 // hide: hide || ddc);
154 parser.addFlag(enableStrictCallChecksFlag, 151 parser.addFlag(enableStrictCallChecksFlag,
155 help: 'Fix issue 21938.', 152 help: 'Fix issue 21938.',
156 defaultsTo: false, 153 defaultsTo: false,
157 negatable: false, 154 negatable: false,
158 hide: hide || ddc); 155 hide: hide);
159 parser.addFlag(enableInitializingFormalAccessFlag, 156 parser.addFlag(enableInitializingFormalAccessFlag,
160 help: 157 help:
161 'Enable support for allowing access to field formal parameters in a ' 158 'Enable support for allowing access to field formal parameters in a '
162 'constructor\'s initializer list', 159 'constructor\'s initializer list',
163 defaultsTo: false, 160 defaultsTo: false,
164 negatable: false, 161 negatable: false,
165 hide: hide || ddc); 162 hide: hide || ddc);
166 parser.addFlag(enableSuperInMixinFlag, 163 parser.addFlag(enableSuperInMixinFlag,
167 help: 'Relax restrictions on mixins (DEP 34).', 164 help: 'Relax restrictions on mixins (DEP 34).',
168 defaultsTo: false, 165 defaultsTo: false,
169 negatable: false, 166 negatable: false,
170 hide: hide || ddc); 167 hide: hide);
171 // parser.addFlag('enable_type_checks', 168 // parser.addFlag('enable_type_checks',
172 // help: 'Check types in constant evaluation.', 169 // help: 'Check types in constant evaluation.',
173 // defaultsTo: false, 170 // defaultsTo: false,
174 // negatable: false, 171 // negatable: false,
175 // hide: hide || ddc); 172 // hide: hide || ddc);
176 } 173 }
177 174
178 /** 175 /**
179 * Find arguments of the form -Dkey=value 176 * Find arguments of the form -Dkey=value
180 * or argument pairs of the form -Dkey value 177 * or argument pairs of the form -Dkey value
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 .replaceAll('\r\n', '\n') 290 .replaceAll('\r\n', '\n')
294 .replaceAll('\r', '\n') 291 .replaceAll('\r', '\n')
295 .split('\n') 292 .split('\n')
296 .where((String line) => line.isNotEmpty)); 293 .where((String line) => line.isNotEmpty));
297 } on FileSystemException catch (e) { 294 } on FileSystemException catch (e) {
298 throw new Exception('Failed to read file specified by $lastArg : $e'); 295 throw new Exception('Failed to read file specified by $lastArg : $e');
299 } 296 }
300 } 297 }
301 return args; 298 return args;
302 } 299 }
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/analyzer/context.dart » ('j') | pkg/dev_compiler/lib/src/analyzer/context.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698