aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-11-10 01:40:01 +0100
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-11-10 23:28:03 +0100
commit0dd5a680f2d6d209a1b814071a3131d3a469995d (patch)
treea03d7413db1dbf24088d1b7cf5b280ce6930e334 /src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
parent3fa2e46f73802412772b0182e1e38e9dbbcda638 (diff)
Add option-specified warning.
Accept warnings specified by flag. This flag will cause a warning to be printed like a standard Option deprecation warning or any other warning from options parsing. This can be used to deprecate definitions of config expansion or bazelrc files. This should not be used to deprecate internal option specifications. RELNOTES: None. PiperOrigin-RevId: 175231963
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
index 1f4e0d738f..c93f667878 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
@@ -275,4 +275,19 @@ public class CommonCommandOptions extends OptionsBase {
+ "logged with the rest of the Bazel invocation."
)
public ToolCommandLineEvent toolCommandLine;
+
+ @Option(
+ name = "unconditional_warning",
+ defaultValue = "",
+ documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
+ allowMultiple = true,
+ help =
+ "A warning that will unconditionally get printed with build warnings and errors. This is "
+ + "useful to deprecate bazelrc files or --config definitions. If the intent is to "
+ + "effectively deprecate some flag or combination of flags, this is NOT sufficient. "
+ + "The flag or flags should use the deprecationWarning field in the option definition, "
+ + "or the bad combination should be checked for programmatically."
+ )
+ public List<String> deprecationWarnings;
}