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

Side by Side Diff: pkg/front_end/lib/src/fasta/compiler_command_line.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec Created 3 years, 5 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
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 fasta.compiler_command_line; 5 library fasta.compiler_command_line;
6 6
7 import 'dart:io' show exit; 7 import 'dart:io' show exit;
8 8
9 import 'command_line.dart' show CommandLine, argumentError; 9 import 'command_line.dart' show CommandLine, deprecated_argumentError;
10 10
11 import 'compiler_context.dart' show CompilerContext; 11 import 'compiler_context.dart' show CompilerContext;
12 12
13 import 'package:kernel/target/targets.dart' 13 import 'package:kernel/target/targets.dart'
14 show Target, getTarget, TargetFlags, targets; 14 show Target, getTarget, TargetFlags, targets;
15 15
16 const Map<String, dynamic> optionSpecification = const <String, dynamic>{ 16 const Map<String, dynamic> optionSpecification = const <String, dynamic>{
17 "--compile-sdk": Uri, 17 "--compile-sdk": Uri,
18 "--fatal": ",", 18 "--fatal": ",",
19 "--output": Uri, 19 "--output": Uri,
(...skipping 27 matching lines...) Expand all
47 options.containsKey("/?"); 47 options.containsKey("/?");
48 } 48 }
49 49
50 void validate() { 50 void validate() {
51 if (help) { 51 if (help) {
52 print(computeUsage(programName, verbose)); 52 print(computeUsage(programName, verbose));
53 exit(0); 53 exit(0);
54 } 54 }
55 55
56 if (options.containsKey("-o") && options.containsKey("--output")) { 56 if (options.containsKey("-o") && options.containsKey("--output")) {
57 return argumentError(usage, "Can't specify both '-o' and '--output'."); 57 return deprecated_argumentError(
58 usage, "Can't specify both '-o' and '--output'.");
58 } 59 }
59 if (options.containsKey("-t") && options.containsKey("--target")) { 60 if (options.containsKey("-t") && options.containsKey("--target")) {
60 return argumentError(usage, "Can't specify both '-t' and '--target'."); 61 return deprecated_argumentError(
62 usage, "Can't specify both '-t' and '--target'.");
61 } 63 }
62 if (options.containsKey("--compile-sdk") && 64 if (options.containsKey("--compile-sdk") &&
63 options.containsKey("--platform")) { 65 options.containsKey("--platform")) {
64 return argumentError( 66 return deprecated_argumentError(
65 usage, "Can't specify both '--compile-sdk' and '--platform'."); 67 usage, "Can't specify both '--compile-sdk' and '--platform'.");
66 } 68 }
67 if (programName == "compile_platform" && arguments.length != 3) { 69 if (programName == "compile_platform" && arguments.length != 3) {
68 return argumentError(usage, "Expected three arguments."); 70 return deprecated_argumentError(usage, "Expected three arguments.");
69 } else if (arguments.isEmpty) { 71 } else if (arguments.isEmpty) {
70 return argumentError(usage, "No Dart file specified."); 72 return deprecated_argumentError(usage, "No Dart file specified.");
71 } 73 }
72 74
73 Target target = 75 Target target =
74 getTarget(targetName, new TargetFlags(strongMode: strongMode)); 76 getTarget(targetName, new TargetFlags(strongMode: strongMode));
75 if (target == null) { 77 if (target == null) {
76 return argumentError( 78 return deprecated_argumentError(
77 usage, 79 usage,
78 "Target '${targetName}' not recognized. " 80 "Target '${targetName}' not recognized. "
79 "Valid targets are:\n ${targets.keys.join("\n ")}"); 81 "Valid targets are:\n ${targets.keys.join("\n ")}");
80 } 82 }
81 options["target"] = target; 83 options["target"] = target;
82 } 84 }
83 85
84 Uri get output { 86 Uri get output {
85 return options["-o"] ?? options["--output"] ?? defaultOutput; 87 return options["-o"] ?? options["--output"] ?? defaultOutput;
86 } 88 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 libraries. 218 libraries.
217 219
218 --fatal=errors 220 --fatal=errors
219 --fatal=warnings 221 --fatal=warnings
220 --fatal=nits 222 --fatal=nits
221 Makes messages of the given kinds fatal, that is, immediately stop the 223 Makes messages of the given kinds fatal, that is, immediately stop the
222 compiler with a non-zero exit-code. In --verbose mode, also display an 224 compiler with a non-zero exit-code. In --verbose mode, also display an
223 internal stack trace from the compiler. Multiple kinds can be separated by 225 internal stack trace from the compiler. Multiple kinds can be separated by
224 commas, for example, --fatal=errors,warnings. 226 commas, for example, --fatal=errors,warnings.
225 """; 227 """;
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/compile_platform.dart ('k') | pkg/front_end/lib/src/fasta/deprecated_problems.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698