selectAppleSlice function
AppleSliceCandidate?
selectAppleSlice(
- Iterable<
AppleSliceCandidate> candidates, - AppleSliceRequest request
Selects an XCFramework entry without relying on directory enumeration order.
Implementation
AppleSliceCandidate? selectAppleSlice(
Iterable<AppleSliceCandidate> candidates,
AppleSliceRequest request,
) {
final compatible = candidates.where(
(candidate) => candidate.supports(request),
);
return compatible.isEmpty
? null
: (compatible.toList()
..sort((a, b) => a.identifier.compareTo(b.identifier)))
.first;
}