aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-11-09 23:03:39 +0100
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-11-10 23:27:38 +0100
commit688ff592223b756f3749f4d6e46a649ec673ebdb (patch)
tree02da24962c611385f890c06d7c5662a820d056ee /src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
parent10b0d8aa6b73a024cc007c5e075cb329add878ef (diff)
Make the config expansion behavior modular.
Reorganize the BlazeOptionHandler to make it easy to exchange out how the config options are expanded using the definitions in the blazerc. Also change the getOptionsMap call to actually structure the rc options in the order that we parse them: we expand them in command order (for the test command, first add all "common" options, then "build," then "test") and then within each command, we expand the options in the rc order. This somewhat simplifies the rc expansion code, and avoids the two-phase regrouping that used to happen. This change should not change the semantics of rc option ordering. A followup change will add an alternative implementation for --config's expansion. RELNOTES: None. PiperOrigin-RevId: 175208971
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
index 8ba597cf41..2ed29f3613 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
@@ -260,12 +260,11 @@ public class BlazeCommandDispatcher {
StoredEventHandler storedEventHandler = new StoredEventHandler();
BlazeOptionHandler optionHandler =
- new BlazeOptionHandler(
+ BlazeOptionHandler.getHandler(
runtime,
workspace,
command,
commandAnnotation,
- commandName,
// Provide the options parser so that we can cache OptionsData here.
createOptionsParser(command),
invocationPolicy);
@@ -588,8 +587,7 @@ public class BlazeCommandDispatcher {
* classes.
*
* <p>An overriding method should first call this method and can then override default values
- * directly or by calling {@link BlazeOptionHandler#parseOptionsForCommand} for command-specific
- * options.
+ * directly or by calling {@link BlazeOptionHandler#parseOptions} for command-specific options.
*/
private OptionsParser createOptionsParser(BlazeCommand command)
throws OptionsParser.ConstructionException {