Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@ extension PackagePIFProjectBuilder {
case macro
}

static func createBinaryModuleFileReference(_ binaryModule: BinaryModule, id: ProjectModel.GUID) -> FileReference {
let fileTypeIdentifier: String?
switch binaryModule.kind {
case .artifactsArchive:
fileTypeIdentifier = "wrapper.artifactbundle"
case .xcframework:
fileTypeIdentifier = "wrapper.xcframework"
case .unknown:
fileTypeIdentifier = nil
}
return FileReference(id: id, path: binaryModule.artifactPath.pathString, fileType: fileTypeIdentifier)
}

/// Constructs a *PIF target* for building a *module* as a particular type.
/// An optional target identifier suffix is passed when building variants of a target.
@discardableResult
Expand Down Expand Up @@ -651,7 +664,7 @@ extension PackagePIFProjectBuilder {
break
}
let binaryReference = self.binaryGroup.addFileReference { id in
FileReference(id: id, path: (binaryModule.artifactPath.pathString))
return Self.createBinaryModuleFileReference(binaryModule, id: id)
}
if shouldLinkProduct {
self.project[keyPath: sourceModuleTargetKeyPath].addLibrary { id in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ extension PackagePIFProjectBuilder {
break
}
let binaryFileRef = self.binaryGroup.addFileReference { id in
FileReference(id: id, path: binaryModule.artifactPath.pathString)
Self.createBinaryModuleFileReference(binaryModule, id: id)
}
let toolsVersion = self.package.manifest.toolsVersion
self.project[keyPath: mainModuleTargetKeyPath].addLibrary { id in
Expand Down
Loading