https://pantsbuild.org/ logo
#general
Title
# general
w

wide-midnight-78598

06/19/2022, 2:27 AM
Is there a mechanism to retrieve the list of source files in a target from a subset of members of that target? So, let's say I have 20 sources in a
swift_sources(name="mylib", sources=[...])
target, and my
check
goal gets the addresses:
helloswift/myfile1.swift:mylib
and
helloswift/myfile2.swift:mylib
- is there a request that will allow me to get all the other files in that target from those addresses? My current attempt feels yuckyish. Take all my addresses (from one or more
swift_sources
targets), get a single address per unique
target_name
, use `WrappedTarget`s and then using a
tgt.get(SourceField)
- feels like there must be a request somewhere which will take in a set of addresses and return unique targets (I originally thought this would be handled by
CoarsenedTarget
)
1
w

witty-crayon-22786

06/21/2022, 3:55 PM
My current attempt feels yuckyish. Take all my addresses (from one or more
swift_sources
targets), get a single address per unique
target_name
, use `WrappedTarget`s and then using a
tgt.get(SourceField)
this is the best option currently. can convert to the generator address with https://github.com/pantsbuild/pants/blob/main/src/python/pants/build_graph/address.py#L538
CoarsenedTarget only batches targets together if they have cycles between themselves.
3 Views