diff options
author | 2016-10-31 16:52:48 +0000 | |
---|---|---|
committer | 2016-11-02 08:25:42 +0000 | |
commit | a0e3af46ca41f55163188d4beef10534c006aaca (patch) | |
tree | d9cc68a79c856f7d536244d17267e7c7ea0e2c87 /src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java | |
parent | 03afc7d463149860df6e7c7aa04a6325bb9391e3 (diff) |
Refactor the module API to use the builder pattern for executor creation.
This significantly simplifies several of our modules.
--
MOS_MIGRATED_REVID=137713119
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java index e22b09b007..c72c05e337 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java @@ -93,6 +93,8 @@ public final class CommandEnvironment { private ImmutableList<ActionInputPrefetcher> actionInputPrefetchers = ImmutableList.of(); private Path workingDirectory; + private OptionsClassProvider options; + private AtomicReference<AbruptExitException> pendingException = new AtomicReference<>(); private class BlazeModuleEnvironment implements BlazeModule.ModuleEnvironment { @@ -180,6 +182,10 @@ public final class CommandEnvironment { return Collections.unmodifiableMap(clientEnv); } + public OptionsClassProvider getOptions() { + return options; + } + /** * Return an ordered version of the client environment restricted to those variables whitelisted * by the command-line options to be inheritable by actions. @@ -527,6 +533,7 @@ public final class CommandEnvironment { throw new IllegalStateException(e); } } + this.options = optionsParser; eventBus.post(new GotOptionsEvent(runtime.getStartupOptionsProvider(), optionsParser)); throwPendingException(); |