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

Unified Diff: pkg/front_end/lib/src/fasta/messages.dart

Issue 2979713002: Add --set-exit-code-on-problem option. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/messages.dart
diff --git a/pkg/front_end/lib/src/fasta/messages.dart b/pkg/front_end/lib/src/fasta/messages.dart
index 5f3f7675370c1275bfff116bfe65e58df400d0d9..7224d978247272a868da5c5baffa89d8af592266 100644
--- a/pkg/front_end/lib/src/fasta/messages.dart
+++ b/pkg/front_end/lib/src/fasta/messages.dart
@@ -4,6 +4,8 @@
library fasta.messages;
+import 'dart:io' show exitCode;
+
import 'package:kernel/ast.dart' show Library, Location, Program, TreeNode;
import 'util/relativize.dart' show relativizeUri;
@@ -30,6 +32,10 @@ bool get isVerbose => CompilerContext.current.options.verbose;
bool get hideNits => !isVerbose;
+bool get setExitCodeOnProblem {
+ return CompilerContext.current.options.setExitCodeOnProblem;
+}
+
void warning(Message message, int charOffset, Uri uri) {
if (hideWarnings) return;
print(deprecated_format(
@@ -85,6 +91,9 @@ String colorNit(String message) {
}
String deprecated_format(Uri uri, int charOffset, String message) {
+ if (setExitCodeOnProblem) {
Siggi Cherem (dart-lang) 2017/07/11 17:04:16 just to make sure, we would practically only get h
ahe 2017/07/11 17:52:36 No. We get here if we print any diagnostic. But I
Siggi Cherem (dart-lang) 2017/07/11 18:12:34 OK - so it is done only if something is visible in
ahe 2017/07/12 09:59:06 I have already implemented this, and should be abl
+ exitCode = 1;
+ }
if (uri != null) {
String path = relativizeUri(uri);
Location location = charOffset == -1 ? null : getLocation(path, charOffset);
« no previous file with comments | « pkg/front_end/lib/src/fasta/compiler_command_line.dart ('k') | pkg/front_end/lib/src/kernel_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698