Skip to content

Commit

Permalink
Fix modules returning command options
Browse files Browse the repository at this point in the history
Nobody reads the documentation, apparently. It also clearly states that
getCommonCommandOptions should be used to add options to all commands.

PiperOrigin-RevId: 196965665
  • Loading branch information
ulfjack authored and Copybara-Service committed May 17, 2018
1 parent 64a461d commit 4ca4b8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.runtime.BlazeModule;
import com.google.devtools.build.lib.runtime.BuildEventStreamer;
import com.google.devtools.build.lib.runtime.Command;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.runtime.SynchronizedOutputStream;
import com.google.devtools.build.lib.util.AbruptExitException;
Expand Down Expand Up @@ -63,7 +62,7 @@ public abstract class BuildEventServiceModule<T extends BuildEventServiceOptions
private Set<BuildEventTransport> transports = ImmutableSet.of();

@Override
public Iterable<Class<? extends OptionsBase>> getCommandOptions(Command command) {
public Iterable<Class<? extends OptionsBase>> getCommonCommandOptions() {
return ImmutableList.of(optionsClass(), AuthAndTLSOptions.class, BuildEventStreamOptions.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void validateMocks() {
@Test
public void testReturnsBuildEventStreamerOptions() throws Exception {
BazelBuildEventServiceModule module = new BazelBuildEventServiceModule();
Iterable<Class<? extends OptionsBase>> commandOptions = module.getCommandOptions(command);
Iterable<Class<? extends OptionsBase>> commandOptions = module.getCommonCommandOptions();
assertThat(commandOptions).isNotEmpty();
OptionsParser optionsParser = OptionsParser.newOptionsParser(commandOptions);
optionsParser.parse(
Expand Down

0 comments on commit 4ca4b8d

Please sign in to comment.