This PR fixes the matching of prebuilt items and their corresponding spec during the post-install phase.
Let's consider the following scenario:
A Foo pod produces the Foo.xcframework built item.
An unrelated Bar pod contains the Foo subspec, and produces the Bar.xcframework built item.
Pod::Specification::module_name returns Foo for both the Bar/Foo and Foo specs.
When looking up the spec for the Foo.xcframework built item, the previous logic would match Bar/Foo first. This leads to the following:
Foo.xcframework is copied inside the Prebuilt/Bar folder instead of Prebuilt/Foo.
The Prebuilt/Foo folder is left unchanged.
The proposed changes aim to prevent this by making sure that we check name equality between the built item and the spec's module_name for root specs first. If no matches are found in root specs, the existing fallback would apply.
This PR fixes the matching of prebuilt items and their corresponding spec during the post-install phase.
Let's consider the following scenario:
Foo
pod produces theFoo.xcframework
built item.Bar
pod contains theFoo
subspec, and produces theBar.xcframework
built item.Pod::Specification::module_name
returnsFoo
for both theBar/Foo
andFoo
specs.When looking up the spec for the
Foo.xcframework
built item, the previous logic would matchBar/Foo
first. This leads to the following:Foo.xcframework
is copied inside thePrebuilt/Bar
folder instead ofPrebuilt/Foo
.Prebuilt/Foo
folder is left unchanged.The proposed changes aim to prevent this by making sure that we check name equality between the built item and the spec's
module_name
for root specs first. If no matches are found in root specs, the existing fallback would apply.