Skip to content

Commit

Permalink
Remove proto_lang_target from proto_common.compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
comius committed Jun 18, 2022
1 parent a0f498e commit 903119e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ public static void compile(
compile,
ImmutableList.of(
/* actions */ ruleContext.getStarlarkRuleContext().actions(),
/* proto_info */ protoTarget.get(ProtoInfo.PROVIDER),
/* proto_lang_toolchain_info */ protoLangToolchainInfo,
/* generated_files */ StarlarkList.immutableCopyOf(generatedFiles),
/* plugin_output */ pluginOutput == null ? Starlark.NONE : pluginOutput,
Expand All @@ -569,8 +570,7 @@ public static void compile(
: Depset.of(
Artifact.TYPE, NestedSetBuilder.wrap(Order.STABLE_ORDER, additionalInputs)),
/* resource_set */ resourceSet == null ? Starlark.NONE : resourceSet,
/* experimental_progress_message */ progressMessage,
/* proto_info */ protoTarget.get(ProtoInfo.PROVIDER)),
/* experimental_progress_message */ progressMessage),
ImmutableMap.of());
}

Expand All @@ -589,14 +589,13 @@ public static void compile(
compile,
ImmutableList.of(
/* actions */ ruleContext.getStarlarkRuleContext().actions(),
/* proto_info */ protoTarget.get(ProtoInfo.PROVIDER),
/* proto_lang_toolchain_info */ protoLangToolchainInfo,
/* generated_files */ StarlarkList.immutableCopyOf(generatedFiles),
/* plugin_output */ pluginOutput == null ? Starlark.NONE : pluginOutput),
ImmutableMap.of(
"experimental_progress_message",
progressMessage,
"proto_info",
protoTarget.get(ProtoInfo.PROVIDER)));
progressMessage));
}

public static boolean shouldGenerateCode(
Expand Down
10 changes: 2 additions & 8 deletions src/main/starlark/builtins_bzl/common/proto/proto_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ def _Iimport_path_equals_fullpath(proto_source):

def _compile(
actions,
proto_info,
proto_lang_toolchain_info,
generated_files,
plugin_output = None,
additional_args = None,
additional_tools = [],
additional_inputs = depset(),
resource_set = None,
experimental_progress_message = None,
proto_info = None,
proto_library_target = None):
experimental_progress_message = None):
"""Creates proto compile action for compiling *.proto files to language specific sources.
Args:
Expand All @@ -58,12 +57,7 @@ def _compile(
the callback.
experimental_progress_message: Overrides progres_message from the toolchain.
Don't use this parameter. It's only intended for the transition.
proto_library_target: (Target) Deprecated: use proto_info instead.
Exactly one need to be set: `proto_info` or `proto_library_target`.
"""
if not proto_info:
proto_info = proto_library_target[_builtins.toplevel.ProtoInfo]

args = actions.args()
args.use_param_file(param_file_arg = "@%s")
args.set_param_file_format("multiline")
Expand Down

0 comments on commit 903119e

Please sign in to comment.