diff options
author | ulfjack <ulfjack@google.com> | 2018-05-17 07:46:47 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-17 07:48:10 -0700 |
commit | d1ec570fb6ef8d142b0cf381df008c0f209b57aa (patch) | |
tree | ec84868f78a2080556f1e6b56149bff4d283b166 /src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java | |
parent | a61b53a8ef65881c6c4a69f16edc52ed7f1662a3 (diff) |
Rename CommandAction.getEnvironment, add AbstractAction.getEnvironment
This is a cleanup to clarify the code.
1. The getEnvironment method in the CommandAction interface does not have
access to the clientEnv, so it's return value is necessarily incomplete.
Rename to getIncompleteEnvironmentForTesting.
2. Add a final getEnvironment method to AbstractAction, which returns the
ActionEnvironment, which is intended to be a complete description of the
intended final environment of the action (technically, of any spawn running
within the action). This is not currently used, but is provided to prevent
action subclasses to add such a method (it may be used in the future).
PiperOrigin-RevId: 196991091
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java index 1ea286db8d..6191b272a8 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java @@ -479,7 +479,7 @@ public class SpawnAction extends AbstractAction implements ExecutionInfoSpecifie @Override @VisibleForTesting - public final ImmutableMap<String, String> getEnvironment() { + public final ImmutableMap<String, String> getIncompleteEnvironmentForTesting() { // TODO(ulfjack): AbstractAction should declare getEnvironment with a return value of type // ActionEnvironment to avoid developers misunderstanding the purpose of this method. That // requires first updating all subclasses and callers to actually handle environments correctly, |