From a0e3af46ca41f55163188d4beef10534c006aaca Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Mon, 31 Oct 2016 16:52:48 +0000 Subject: Refactor the module API to use the builder pattern for executor creation. This significantly simplifies several of our modules. -- MOS_MIGRATED_REVID=137713119 --- .../com/google/devtools/build/lib/runtime/CommandEnvironment.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java') 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 actionInputPrefetchers = ImmutableList.of(); private Path workingDirectory; + private OptionsClassProvider options; + private AtomicReference 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(); -- cgit v1.2.3