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 49e92b4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 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,6 +319,8 @@ rust_prost_aspect = aspect(
def _rust_prost_library_impl(ctx):
proto_dep = ctx.attr.proto
rust_proto_info = proto_dep[ProstProtoInfo]
rust_generated_srcs = proto_dep[OutputGroupInfo].rust_generated_srcs
proto_descriptor_set = proto_dep[OutputGroupInfo].proto_descriptor_set
dep_variant_info = rust_proto_info.dep_variant_info

prost_toolchain = ctx.toolchains[TOOLCHAIN_TYPE]
Expand All @@ -332,6 +337,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 49e92b4

Please sign in to comment.