Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct PBXCopyFilesBuildPhaseMapper: PBXCopyFilesBuildPhaseMapping {
return .file(path: absolutePath, condition: nil, codeSignOnCopy: codeSignOnCopy)
}
.sorted { $0.path < $1.path }
let groupsFiles = fileSystemSynchronizedGroupsFiles(
let groupsFiles = try fileSystemSynchronizedGroupsFiles(
phase,
fileSystemSynchronizedGroups: fileSystemSynchronizedGroups,
xcodeProj: xcodeProj
Expand All @@ -83,17 +83,17 @@ struct PBXCopyFilesBuildPhaseMapper: PBXCopyFilesBuildPhaseMapping {
_ phase: PBXCopyFilesBuildPhase,
fileSystemSynchronizedGroups: [PBXFileSystemSynchronizedRootGroup],
xcodeProj: XcodeProj
) -> [CopyFileElement] {
) throws -> [CopyFileElement] {
var files: [CopyFileElement] = []
for fileSystemSynchronizedGroup in fileSystemSynchronizedGroups {
if let path = fileSystemSynchronizedGroup.path {
let buildPhaseExceptions = fileSystemSynchronizedGroup.exceptions?
.compactMap { $0 as? PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet }
.filter { $0.buildPhase == phase } ?? []
let groupFiles = buildPhaseExceptions.compactMap {
$0.membershipExceptions?.map {
let groupFiles = try buildPhaseExceptions.compactMap {
try $0.membershipExceptions?.map {
return CopyFileElement.file(
path: xcodeProj.srcPath.appending(component: path).appending(RelativePath($0)),
path: xcodeProj.srcPath.appending(component: path).appending(try RelativePath(validating: $0)),
condition: nil,
codeSignOnCopy: true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ struct PBXFrameworksBuildPhaseMapper: PBXFrameworksBuildPhaseMapping {
condition: nil
)
}
let fileRef = try buildFile.file.throwing(PBXFrameworksBuildPhaseMappingError.missingFileReference)
let fileRef = try buildFile.file.throwing(
PBXFrameworksBuildPhaseMappingError.missingFileReference(
buildFile.uuid,
xcodeProj.projectPath.appending(component: "project.pbxproj")
)
)
if let path = fileRef.path {
let name = path.replacingOccurrences(of: ".framework", with: "")
let linkingStatus: LinkingStatus = (buildFile.settings?["ATTRIBUTES"] as? [String])?
Expand Down Expand Up @@ -98,16 +103,16 @@ struct PBXFrameworksBuildPhaseMapper: PBXFrameworksBuildPhaseMapping {

/// Errors that may occur when mapping framework build phase files.
enum PBXFrameworksBuildPhaseMappingError: Error, LocalizedError {
case missingFileReference
case missingFileReference(String, AbsolutePath)
case missingFilePath(name: String?)

var errorDescription: String? {
switch self {
case .missingFileReference:
return "Missing `PBXBuildFile.file` reference."
case let .missingFileReference(buildFileUUID, pbxprojPath):
return "Missing 'PBXBuildFile.file' reference for \(buildFileUUID) id. Make sure an element with that id is present in the \(pbxprojPath.pathString) file."
case let .missingFilePath(name):
let fileName = name ?? "Unknown"
return "Missing or invalid file path for `PBXBuildFile`: \(fileName)."
return "Missing or invalid file path for 'PBXBuildFile': \(fileName)."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ struct XcodeGraphMapperTests {
pbxProj: pbxProj
)

let appTarget = try PBXNativeTarget.test(
try PBXNativeTarget.test(
name: "App",
buildConfigurationList: configurationList,
buildPhases: [],
Expand Down