rules_swift icon indicating copy to clipboard operation
rules_swift copied to clipboard

[Feeature Request] Support aggregation of protos and their dependencies into one Swift module

Open Skoti opened this issue 11 months ago • 0 comments

Motivation

Given one or many proto_library targets with dependencies, one would like to put them all into a single Swift module.

Currently, it is possible only if labels for all proto_library targets and their dependent targets are manually repeated in the protos attribute of the swift_proto_library rule. However, this creates a maintenance hell, as each time one of the proto_library targets gets modified, the same change needs to be reflected in this swift_proto_library aggregation target, resulting in two sources of truth.

It would be great if this could be done automatically, by only providing the leaf proto_library targets.

Proposed solution

The idea is to create an aspect that collects ProtoInfo transitively and add an attribute that uses it to the swift_proto_library rule.

@AttilaTheFun I'm tagging you as requested :)

Skoti avatar Nov 22 '24 10:11 Skoti