diff options
author | ccalvarin <ccalvarin@google.com> | 2017-10-10 05:29:56 +0200 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-10-24 12:21:09 -0700 |
commit | 2c2f636ed26b6cf80d2135f0d337e159e047e89d (patch) | |
tree | d25e367094550757aa651f5ed16220555543fcac | |
parent | 687ddfa84472eb5c5a4744cee5a208338afae9cf (diff) | |
download | desugar-2c2f636ed26b6cf80d2135f0d337e159e047e89d.tar.gz |
Report the structured Bazel command line via the BEP.
This is part of the effort outlined in https://bazel.build/designs/2017/07/13/improved-command-line-reporting.html. The refactoring of the options parser is not yet complete, so we still do not have complete & correct information about the canonical command line. Where the information is blatantly incorrect, a best approximation was made, with comments and tests documenting the deficiencies.
Change the names of the initial CommandLine fields in the BEP to be explicitly identified as unstructured.
RELNOTES: None.
PiperOrigin-RevId: 171625377
GitOrigin-RevId: ceb1013c1ca0238188e2714442fcfb2efb16bc6a
Change-Id: I3a40b8e1ebd5d6a7d7e893be369d6d25de758ac7
3 files changed, 10 insertions, 5 deletions
diff --git a/java/com/google/devtools/common/options/OptionValueDescription.java b/java/com/google/devtools/common/options/OptionValueDescription.java index 0d81d49..aa808e2 100644 --- a/java/com/google/devtools/common/options/OptionValueDescription.java +++ b/java/com/google/devtools/common/options/OptionValueDescription.java @@ -208,8 +208,11 @@ public abstract class OptionValueDescription { // The new value does not override the old value, as it has lower priority. warnings.add( String.format( - "The lower priority option '%s' does not override the previous value '%s'", - parsedOption.getCommandLineForm(), effectiveOptionInstance.getCommandLineForm())); + "The lower priority option '%s' (source %s) does not override the previous value " + + "'%s'", + parsedOption.getCommandLineForm(), + parsedOption.getSource(), + effectiveOptionInstance.getCommandLineForm())); } } diff --git a/java/com/google/devtools/common/options/OptionsProvider.java b/java/com/google/devtools/common/options/OptionsProvider.java index 1c7737f..5fd8ac0 100644 --- a/java/com/google/devtools/common/options/OptionsProvider.java +++ b/java/com/google/devtools/common/options/OptionsProvider.java @@ -39,8 +39,10 @@ public interface OptionsProvider extends OptionsClassProvider { * specified. If an option was specified multiple times, it is included in the result multiple * times. Does not include the residue. * - * <p>The returned list can be filtered if undocumented, hidden or implicit options should not be - * displayed. + * <p>The returned list includes undocumented, hidden or implicit options, and should be filtered + * as needed. Since it includes all options parsed, it will also include both an expansion option + * and the options it expanded to, and so blindly using this list for a new invocation will cause + * double-application of these options. */ List<ParsedOptionDescription> asCompleteListOfParsedOptions(); diff --git a/java/com/google/devtools/common/options/ParsedOptionDescription.java b/java/com/google/devtools/common/options/ParsedOptionDescription.java index 1f43172..d558263 100644 --- a/java/com/google/devtools/common/options/ParsedOptionDescription.java +++ b/java/com/google/devtools/common/options/ParsedOptionDescription.java @@ -115,7 +115,7 @@ public final class ParsedOptionDescription { return unconvertedValue; } - OptionPriority getPriority() { + public OptionPriority getPriority() { return origin.getPriority(); } |