Skip to content

Commit

Permalink
feat: output generated proto sources and descriptor set
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Mackay committed Nov 8, 2024
1 parent cf6e76e commit 495846a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions proto/prost/private/prost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ def _rust_prost_aspect_impl(target, ctx):
package_info = package_info_file,
),
rust_analyzer_info,
OutputGroupInfo(rust_generated_srcs = [lib_rs]),
OutputGroupInfo(
rust_generated_srcs = [lib_rs],
proto_descriptor_set = [proto_info.direct_descriptor_set],
),
]

rust_prost_aspect = aspect(
Expand Down Expand Up @@ -316,7 +319,8 @@ rust_prost_aspect = aspect(
def _rust_prost_library_impl(ctx):
proto_dep = ctx.attr.proto
rust_proto_info = proto_dep[ProstProtoInfo]
dep_variant_info = rust_proto_info.dep_variant_info
rust_generated_srcs = proto_dep[OutputGroupInfo].rust_generated_srcs
proto_descriptor_set = proto_dep[OutputGroupInfo].proto_descriptor_set

prost_toolchain = ctx.toolchains[TOOLCHAIN_TYPE]

Expand All @@ -332,6 +336,10 @@ def _rust_prost_library_impl(ctx):
transitive = transitive,
),
),
OutputGroupInfo(
rust_generated_srcs = rust_generated_srcs,
proto_descriptor_set = proto_descriptor_set,
),
RustAnalyzerGroupInfo(deps = [proto_dep[RustAnalyzerInfo]]),
]

Expand Down

0 comments on commit 495846a

Please sign in to comment.