Skip to content

Commit bbefe99

Browse files
committed
Drop stale condition
1 parent 1a0bfb8 commit bbefe99

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,14 @@ public final class ProcessXCFrameworkTaskAction: TaskAction {
112112
// Task construction selected the library using the target's architectures and passes its identifier.
113113
// Resolve by identifier so we copy that exact slice: multiple per-arch slices (e.g. linux-aarch64 and
114114
// linux-x86_64) share a platform and library file name, so platform alone cannot disambiguate them here.
115-
let library: XCFramework.Library
116-
if let libraryIdentifier {
117-
let matches = xcframework.libraries.filter { $0.libraryIdentifier == libraryIdentifier && $0.supportedPlatform == plat }
118-
guard let match = matches.only else {
119-
let problem = matches.isEmpty ? "no library was" : "\(matches.count) libraries were"
120-
outputDelegate.emitError("While building for \(platformDisplayName), \(problem) found with identifier '\(libraryIdentifier)' in '\(xcframeworkName)'.")
121-
return .failed
122-
}
123-
library = match
124-
} else if let match = xcframework.findLibrary(platform: plat, platformVariant: environment ?? "") {
125-
// Fallback for callers that do not pass an identifier: match by platform and variant alone.
126-
library = match
127-
} else {
128-
outputDelegate.emitError("While building for \(platformDisplayName), no library for this platform was found in '\(xcframeworkName)'.")
115+
guard let libraryIdentifier else {
116+
outputDelegate.emitError("--library-identifier is a required argument")
117+
return .failed
118+
}
119+
let matches = xcframework.libraries.filter { $0.libraryIdentifier == libraryIdentifier && $0.supportedPlatform == plat }
120+
guard let library = matches.only else {
121+
let problem = matches.isEmpty ? "no library was" : "\(matches.count) libraries were"
122+
outputDelegate.emitError("While building for \(platformDisplayName), \(problem) found with identifier '\(libraryIdentifier)' in '\(xcframeworkName)'.")
129123
return .failed
130124
}
131125

0 commit comments

Comments
 (0)