diff options
author | Chloe Calvarin <ccalvarin@google.com> | 2017-03-27 15:37:50 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2017-03-28 19:48:28 +0000 |
commit | 6b60718363c6b3abed8e68b524fe4641b4991517 (patch) | |
tree | 671bc89f034b86fc0a9cfe5cdba0e4f3e8aec047 /src/main/java/com/google/devtools | |
parent | f1792e3a67a110d74eb134a93c6331aa0b61bf3c (diff) |
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
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java | 6 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java | 13 |
2 files changed, 9 insertions, 10 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 582e1e1418..db56ad8b41 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 @@ public class BlazeCommandDispatcher { 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 @@ public class BlazeCommandDispatcher { } /** - * 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 @@ public class BlazeCommandDispatcher { : "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 efe5a2111f..368b66bd89 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 @@ public final class BlazeRuntime { 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 @@ public final class BlazeRuntime { Iterable<BlazeModule> blazeModules, SubscriberExceptionHandler eventBusExceptionHandler, ProjectFile.Provider projectFileProvider, - InvocationPolicy invocationPolicy, + InvocationPolicy moduleInvocationPolicy, Iterable<BlazeCommand> commands, String productName, PathConverter pathToUriConverter) { @@ -173,7 +172,7 @@ public final class BlazeRuntime { this.packageFactory = pkgFactory; this.projectFileProvider = projectFileProvider; - this.invocationPolicy = invocationPolicy; + this.moduleInvocationPolicy = moduleInvocationPolicy; this.ruleClassProvider = ruleClassProvider; this.configurationFactory = configurationFactory; @@ -187,7 +186,7 @@ public final class BlazeRuntime { 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 @@ public final class BlazeRuntime { } @Nullable - public InvocationPolicy getInvocationPolicy() { - return invocationPolicy; + public InvocationPolicy getModuleInvocationPolicy() { + return moduleInvocationPolicy; } /** |