Clarify InvocationPolicy origins.
Some policies can come from the module API, and some come from the user via
startup argument. Clarify which one is which.
--
PiperOrigin-RevId: 151324618
MOS_MIGRATED_REVID=151324618
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 582e1e1..db56ad8 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
@@ -381,7 +381,7 @@
parseArgsAndConfigs(env, optionsParser, commandAnnotation, args, rcfileNotes, outErr);
InvocationPolicyEnforcer optionsPolicyEnforcer =
- new InvocationPolicyEnforcer(runtime.getInvocationPolicy());
+ new InvocationPolicyEnforcer(runtime.getModuleInvocationPolicy());
optionsPolicyEnforcer.enforce(optionsParser, commandName);
optionsPolicyEnforcer =
InvocationPolicyEnforcer.create(
@@ -526,7 +526,7 @@
}
/**
- * For testing ONLY. Same as {@link #exec(List, OutErr, boolean, String, long)}, but automatically
+ * For testing ONLY. Same as {@link #exec}, but automatically
* uses the current time.
*/
@VisibleForTesting
@@ -604,7 +604,7 @@
: "Reading options for '" + originalCommand + "' from " + rcfile;
rcfileNotes.add(source + ":\n"
+ " " + inherited + "'" + commandToParse + "' options: "
- + Joiner.on(' ').join(rcfileOptions));
+ + Joiner.on(' ').join(rcfileOptions));
optionsParser.parse(OptionPriority.RC_FILE, rcfile, rcfileOptions);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
index efe5a21..368b66b 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
@@ -139,8 +139,7 @@
private final OptionsProvider startupOptionsProvider;
private final ProjectFile.Provider projectFileProvider;
- @Nullable
- private final InvocationPolicy invocationPolicy;
+ @Nullable private final InvocationPolicy moduleInvocationPolicy;
private final String defaultsPackageContent;
private final SubscriberExceptionHandler eventBusExceptionHandler;
private final String productName;
@@ -163,7 +162,7 @@
Iterable<BlazeModule> blazeModules,
SubscriberExceptionHandler eventBusExceptionHandler,
ProjectFile.Provider projectFileProvider,
- InvocationPolicy invocationPolicy,
+ InvocationPolicy moduleInvocationPolicy,
Iterable<BlazeCommand> commands,
String productName,
PathConverter pathToUriConverter) {
@@ -173,7 +172,7 @@
this.packageFactory = pkgFactory;
this.projectFileProvider = projectFileProvider;
- this.invocationPolicy = invocationPolicy;
+ this.moduleInvocationPolicy = moduleInvocationPolicy;
this.ruleClassProvider = ruleClassProvider;
this.configurationFactory = configurationFactory;
@@ -187,7 +186,7 @@
this.eventBusExceptionHandler = eventBusExceptionHandler;
this.defaultsPackageContent =
- ruleClassProvider.getDefaultsPackageContent(getInvocationPolicy());
+ ruleClassProvider.getDefaultsPackageContent(getModuleInvocationPolicy());
CommandNameCache.CommandNameCacheInstance.INSTANCE.setCommandNameCache(
new CommandNameCacheImpl(getCommandMap()));
this.productName = productName;
@@ -250,8 +249,8 @@
}
@Nullable
- public InvocationPolicy getInvocationPolicy() {
- return invocationPolicy;
+ public InvocationPolicy getModuleInvocationPolicy() {
+ return moduleInvocationPolicy;
}
/**