Pass in the command options to BlazeModule.getCoverageReportFactory. This allows us to make the coverage module stateless if it depends on options. -- MOS_MIGRATED_REVID=129852270
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 acc7e6a..ea29c42 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
@@ -183,10 +183,11 @@ this, packageFactory, ruleClassProvider, getProductName(), eventBusExceptionHandler); } - @Nullable public CoverageReportActionFactory getCoverageReportActionFactory() { + @Nullable public CoverageReportActionFactory getCoverageReportActionFactory( + OptionsClassProvider commandOptions) { CoverageReportActionFactory firstFactory = null; for (BlazeModule module : blazeModules) { - CoverageReportActionFactory factory = module.getCoverageReportFactory(); + CoverageReportActionFactory factory = module.getCoverageReportFactory(commandOptions); if (factory != null) { Preconditions.checkState(firstFactory == null, "only one Blaze Module can have a Coverage Report Factory");