Remove the unused method ProtoCompileActionBuilder#setLangPluginParameter().
RELNOTES: None.
@@ -22,7 +22,6 @@ import static com.google.devtools.build.lib.rules.proto.ProtoCommon.areDepsStric
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.AbstractAction;
@@ -73,8 +72,7 @@ public class ProtoCompileActionBuilder {
private Iterable<Artifact> inputs;
private String langParameter;
private String langPluginName;
- private String langPluginParameter;
- private Supplier<String> langPluginParameterSupplier;
+ private Supplier<String> langPluginParameter;
private boolean hasServices;
private Iterable<String> additionalCommandLineArguments;
private Iterable<FilesToRunProvider> additionalTools;
@@ -100,17 +98,11 @@ public class ProtoCompileActionBuilder {
return this;
}
- public ProtoCompileActionBuilder setLangPluginParameter(String langPluginParameter) {
+ public ProtoCompileActionBuilder setLangPluginParameter(Supplier<String> langPluginParameter) {
this.langPluginParameter = langPluginParameter;
return this;
}
- public ProtoCompileActionBuilder setLangPluginParameterSupplier(
- Supplier<String> langPluginParameterSupplier) {
- this.langPluginParameterSupplier = langPluginParameterSupplier;
- return this;
- }
-
public ProtoCompileActionBuilder setAdditionalCommandLineArguments(
Iterable<String> additionalCmdLine) {
this.additionalCommandLineArguments = additionalCmdLine;
@@ -206,10 +198,6 @@ public class ProtoCompileActionBuilder {
}
public Action[] build() {
- checkState(
- langPluginParameter == null || langPluginParameterSupplier == null,
- "Only one of {langPluginParameter, langPluginParameterSupplier} should be set.");
-
if (isEmpty(outputs)) {
return NO_ACTIONS;
}
@@ -286,18 +274,13 @@ public class ProtoCompileActionBuilder {
}
} else {
FilesToRunProvider langPluginTarget = getLangPluginTarget();
- Supplier<String> langPluginParameter1 =
- langPluginParameter == null
- ? langPluginParameterSupplier
- : Suppliers.ofInstance(langPluginParameter);
-
Preconditions.checkArgument(langParameter == null);
- Preconditions.checkArgument(langPluginParameter1 != null);
+ Preconditions.checkArgument(langPluginParameter != null);
// We pass a separate langPluginName as there are plugins that cannot be overridden
// and thus we have to deal with "$xx_plugin" and "xx_plugin".
result.addFormatted(
"--plugin=protoc-gen-%s=%s", langPrefix, langPluginTarget.getExecutable().getExecPath());
- result.addLazyString(new LazyLangPluginFlag(langPrefix, langPluginParameter1));
+ result.addLazyString(new LazyLangPluginFlag(langPrefix, langPluginParameter));
}
result.addAll(ruleContext.getFragment(ProtoConfiguration.class).protocOpts());
