diff options
author | 2018-06-11 01:38:33 -0700 | |
---|---|---|
committer | 2018-06-11 01:40:17 -0700 | |
commit | 2c89206a407d8cae0945abe7eb179ee6bb77d9de (patch) | |
tree | 1314352acb1ccda52be27d8d063104eae891669c /src/main/java/com/google/devtools/build/lib/buildtool | |
parent | ce9aafcf63dd198fe16c682dfeedc444f07b5669 (diff) |
Remove ActionContextConsumer
Instead, add some simple APIs to ExecutorBuilder and inline all the previous
subclasses into their corresponding modules. This removes a bunch of
boilerplate.
PiperOrigin-RevId: 200017162
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildtool')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index f046110288..8b3d866fff 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -55,7 +55,6 @@ import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.EventKind; import com.google.devtools.build.lib.events.Reporter; -import com.google.devtools.build.lib.exec.ActionContextConsumer; import com.google.devtools.build.lib.exec.ActionContextProvider; import com.google.devtools.build.lib.exec.BlazeExecutor; import com.google.devtools.build.lib.exec.CheckUpToDateFilter; @@ -140,12 +139,9 @@ public class ExecutionTool { // TODO(philwo) - the ExecutionTool should not add arbitrary dependencies on its own, instead // these dependencies should be added to the ActionContextConsumer of the module that actually // depends on them. - builder.addActionContextConsumer( - b -> { - b.strategyByContextMap() - .put(WorkspaceStatusAction.Context.class, "") - .put(SymlinkTreeActionContext.class, ""); - }); + builder + .addStrategyByContext(WorkspaceStatusAction.Context.class, "") + .addStrategyByContext(SymlinkTreeActionContext.class, ""); // Unfortunately, the exec root cache is not shared with caches in the remote execution client. this.fileCache = @@ -162,13 +158,8 @@ public class ExecutionTool { // independently from each other, for example, to run genrules locally and Java compile action // in prod. Thus, for SpawnActions, we decide the action context to use not only based on the // context class, but also the mnemonic of the action. - SpawnActionContextMaps.Builder spawnActionContextMapsBuilder = - new SpawnActionContextMaps.Builder(); - for (ActionContextConsumer consumer : builder.getActionContextConsumers()) { - consumer.populate(spawnActionContextMapsBuilder); - } spawnActionContextMaps = - spawnActionContextMapsBuilder.build( + builder.getSpawnActionContextMapsBuilder().build( actionContextProviders, request.getOptions(ExecutionOptions.class).testStrategy); } |