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

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/command.dart

Issue 2580933002: refactor DDC and Analyzer CLI parser option declaration (Closed)
Patch Set: merge 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
« no previous file with comments | « pkg/dev_compiler/lib/src/analyzer/context.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) 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 import 'dart:io'; 5 import 'dart:io';
6 import 'package:analyzer/src/command_line/arguments.dart' 6 import 'package:analyzer/src/command_line/arguments.dart'
7 show 7 show
8 defineDDCAnalysisArguments,
8 extractDefinedVariables, 9 extractDefinedVariables,
9 filterUnknownArguments, 10 filterUnknownArguments,
10 ignoreUnrecognizedFlagsFlag; 11 ignoreUnrecognizedFlagsFlag;
11 import 'package:analyzer/src/generated/source.dart' show Source; 12 import 'package:analyzer/src/generated/source.dart' show Source;
12 import 'package:analyzer/src/summary/package_bundle_reader.dart' 13 import 'package:analyzer/src/summary/package_bundle_reader.dart'
13 show InSummarySource; 14 show InSummarySource;
14 import 'package:args/args.dart' show ArgParser, ArgResults; 15 import 'package:args/args.dart' show ArgParser, ArgResults;
15 import 'package:args/command_runner.dart' show UsageException; 16 import 'package:args/command_runner.dart' show UsageException;
16 import 'package:path/path.dart' as path; 17 import 'package:path/path.dart' as path;
17 18
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 defaultsTo: false, 90 defaultsTo: false,
90 negatable: false) 91 negatable: false)
91 ..addOption('out', 92 ..addOption('out',
92 abbr: 'o', allowMultiple: true, help: 'Output file (required).') 93 abbr: 'o', allowMultiple: true, help: 'Output file (required).')
93 ..addOption('module-root', 94 ..addOption('module-root',
94 help: 'Root module directory.\n' 95 help: 'Root module directory.\n'
95 'Generated module paths are relative to this root.') 96 'Generated module paths are relative to this root.')
96 ..addOption('library-root', 97 ..addOption('library-root',
97 help: 'Root of source files.\n' 98 help: 'Root of source files.\n'
98 'Generated library names are relative to this root.'); 99 'Generated library names are relative to this root.');
100 defineDDCAnalysisArguments(argParser, hide: hide);
99 addModuleFormatOptions(argParser, allowMultiple: true, hide: hide); 101 addModuleFormatOptions(argParser, allowMultiple: true, hide: hide);
100 AnalyzerOptions.addArguments(argParser, hide: hide); 102 AnalyzerOptions.addArguments(argParser, hide: hide);
101 CompilerOptions.addArguments(argParser, hide: hide); 103 CompilerOptions.addArguments(argParser, hide: hide);
102 return argParser; 104 return argParser;
103 } 105 }
104 106
105 bool _changed(List<int> list1, List<int> list2) { 107 bool _changed(List<int> list1, List<int> list2) {
106 var length = list1.length; 108 var length = list1.length;
107 if (length != list2.length) return true; 109 if (length != list2.length) return true;
108 for (var i = 0; i < length; ++i) { 110 for (var i = 0; i < length; ++i) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 '\n\n${_argParser(hide: !_verbose).usage}'; 227 '\n\n${_argParser(hide: !_verbose).usage}';
226 228
227 void _usageException(String message) { 229 void _usageException(String message) {
228 throw new UsageException(message, _usageMessage); 230 throw new UsageException(message, _usageMessage);
229 } 231 }
230 232
231 /// Thrown when the input source code has errors. 233 /// Thrown when the input source code has errors.
232 class CompileErrorException implements Exception { 234 class CompileErrorException implements Exception {
233 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; 235 toString() => '\nPlease fix all errors before compiling (warnings are okay).';
234 } 236 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/lib/src/analyzer/context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698