Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proto_common.compile #1

Open
sluongng opened this issue May 19, 2023 · 1 comment
Open

Use proto_common.compile #1

sluongng opened this issue May 19, 2023 · 1 comment
Assignees

Comments

@sluongng
Copy link

Discussing this repo with @steeve and it seems like we should be able to make our ProtocGenPbjs action setup a less complicated by re-using Bazel's proto_common.compile().

Some usage examples from Steeve:

bin.protoc_gen_ts_binary(
    name = "protoc_gen_ts",
    env = {"BAZEL_BINDIR": "$(BINDIR)"},
    chdir = package_name(),
    visibility = ["//visibility:public"],
)

proto_lang_toolchain(
    name = "toolchain",
    blacklisted_protos = [],
    command_line = "--ts_out=add_pb_suffix,output_javascript:$(OUT)",
    plugin_format_flag = "--plugin=protoc-gen-ts=%s",
    plugin = ":protoc_gen_ts",
    visibility = ["//visibility:public"],
)

Usage in rule definition

proto_common.compile(
    actions = ctx.actions,
    proto_info = proto_info,
    proto_lang_toolchain_info = toolchain,
    generated_files = output_sources,
    plugin_output = plugin_output,
)
@bduffany
Copy link
Member

@bduffany bduffany self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants