Disable tool resolution with Buf

This commit is contained in:
Adam Liddell 2021-03-02 23:35:05 +00:00
parent 863e63888c
commit e541af70de
2 changed files with 6 additions and 3 deletions

View File

@ -49,13 +49,14 @@ set -uo pipefail
proto_paths.append(descriptor_proto_path(proto, proto_info))
# Build command
args_list, cmd_inputs = build_protoc_args(
args_list, cmd_inputs, _ = build_protoc_args(
ctx,
plugin,
proto_infos,
".",
short_paths = True,
extra_options = options,
resolve_tools = False,
)
all_inputs += cmd_inputs

View File

@ -13,7 +13,8 @@ def build_protoc_args(
out_arg,
extra_options = [],
extra_protoc_args = [],
short_paths = False):
short_paths = False,
resolve_tools = True):
"""
Build the args for a protoc invocation.
@ -28,6 +29,7 @@ def build_protoc_args(
extra_protoc_args: An optional list of extra args to add to the command.
short_paths: Whether to use the .short_path instead of .path when creating paths. The short_path is used when
making a test/executable and referencing the runfiles.
resolve_tools: Whether to resolve and add the tools to returned inputs.
Returns:
- The list of args.
@ -43,7 +45,7 @@ def build_protoc_args(
inputs = []
input_manifests = []
if plugin.tool:
if plugin.tool and resolve_tools:
plugin_runfiles, plugin_input_manifests = ctx.resolve_tools(tools = [plugin.tool])
inputs += plugin_runfiles.to_list()
input_manifests += plugin_input_manifests