Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit c367a1d

Browse files
WIP: changes
1 parent b06b584 commit c367a1d

6 files changed

Lines changed: 24 additions & 19 deletions

File tree

Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public struct DependenciesGraph: Equatable, Codable, Sendable {
3333
name: String = "Test",
3434
// swiftlint:disable:next force_try
3535
path: AbsolutePath = AbsolutePath.root.appending(try! RelativePath(validating: "Test.xcframework")),
36-
originalSignature: XCFrameworkOriginalSignatureType = .notSigned,
36+
expectedSignature: XCFrameworkSignature = .notSigned,
3737
status: LinkingStatus = .required
3838
) -> DependenciesGraph {
3939
let externalDependencies = [name: [TargetDependency.xcframework(
4040
path: path,
41-
originalSignature: originalSignature,
41+
expectedSignature: expectedSignature,
4242
status: status
4343
)]]
4444

Sources/XcodeGraph/Models/TargetDependency.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public enum LinkingStatus: String, Hashable, Codable, Sendable {
77
case none
88
}
99

10-
public enum XCFrameworkOriginalSignatureType: Equatable, Hashable, Codable, Sendable {
10+
public enum XCFrameworkSignature: Equatable, Hashable, Codable, Sendable {
1111
case notSigned
1212
case signedByApple(teamIdentifier: String, teamName: String)
1313
case selfSigned(fingerprint: String)
@@ -24,6 +24,7 @@ public enum XCFrameworkOriginalSignatureType: Equatable, Hashable, Codable, Send
2424
}
2525
}
2626

27+
2728
public enum TargetDependency: Equatable, Hashable, Codable, Sendable {
2829
public enum PackageType: String, Equatable, Hashable, Codable, Sendable {
2930
case runtime
@@ -35,7 +36,7 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable {
3536
case target(name: String, status: LinkingStatus = .required, condition: PlatformCondition? = nil)
3637
case project(target: String, path: AbsolutePath, status: LinkingStatus = .required, condition: PlatformCondition? = nil)
3738
case framework(path: AbsolutePath, status: LinkingStatus, condition: PlatformCondition? = nil)
38-
case xcframework(path: AbsolutePath, originalSignature: XCFrameworkOriginalSignatureType, status: LinkingStatus, condition: PlatformCondition? = nil)
39+
case xcframework(path: AbsolutePath, expectedSignature: XCFrameworkSignature?, status: LinkingStatus, condition: PlatformCondition? = nil)
3940
case library(
4041
path: AbsolutePath,
4142
publicHeaders: AbsolutePath,
@@ -54,7 +55,7 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable {
5455
condition
5556
case .framework(path: _, status: _, condition: let condition):
5657
condition
57-
case .xcframework(path: _, originalSignature: _, status: _, condition: let condition):
58+
case .xcframework(path: _, expectedSignature: _, status: _, condition: let condition):
5859
condition
5960
case .library(path: _, publicHeaders: _, swiftModuleMap: _, condition: let condition):
6061
condition
@@ -74,8 +75,8 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable {
7475
return .project(target: target, path: path, status: status, condition: condition)
7576
case .framework(path: let path, status: let status, condition: _):
7677
return .framework(path: path, status: status, condition: condition)
77-
case .xcframework(path: let path, originalSignature: let originalSignature, status: let status, condition: _):
78-
return .xcframework(path: path, originalSignature:originalSignature, status: status, condition: condition)
78+
case .xcframework(path: let path, expectedSignature: let expectedSignature, status: let status, condition: _):
79+
return .xcframework(path: path, expectedSignature:expectedSignature, status: status, condition: condition)
7980
case .library(path: let path, publicHeaders: let headers, swiftModuleMap: let moduleMap, condition: _):
8081
return .library(path: path, publicHeaders: headers, swiftModuleMap: moduleMap, condition: condition)
8182
case .package(product: let product, type: let type, condition: _):

Sources/XcodeGraphMapper/Mappers/Phases/PBXFrameworksBuildPhaseMapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct PBXFrameworksBuildPhaseMapper: PBXFrameworksBuildPhaseMapping {
9797
.throwing(PBXFrameworksBuildPhaseMappingError.missingFilePath(name: fileRef.name))
9898

9999
let absolutePath = try AbsolutePath(validating: filePathString)
100-
return try pathMapper.map(path: absolutePath, originalSignature: nil, condition: nil)
100+
return try pathMapper.map(path: absolutePath, expectedSignature: nil, condition: nil)
101101
}
102102
}
103103

Sources/XcodeGraphMapper/Mappers/Targets/PBXTargetDependencyMapper.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ struct PBXTargetDependencyMapper: PBXTargetDependencyMapping {
108108
if let fileRef = object as? PBXFileReference {
109109
return try mapFileDependency(
110110
pathString: fileRef.path,
111-
originalSignature: nil,
111+
expectedSignature: nil,
112112
condition: condition,
113113
xcodeProj: xcodeProj
114114
)
115115
} else if let refProxy = object as? PBXReferenceProxy {
116116
return try mapFileDependency(
117117
pathString: refProxy.path,
118-
originalSignature: nil,
118+
expectedSignature: nil,
119119
condition: condition,
120120
xcodeProj: xcodeProj
121121
)
@@ -132,22 +132,22 @@ struct PBXTargetDependencyMapper: PBXTargetDependencyMapping {
132132
/// Maps file-based dependencies (e.g., frameworks, libraries) into `TargetDependency` models.
133133
/// - Parameters:
134134
/// - pathString: The path string for the file-based dependency (relative or absolute).
135-
/// - originalSignature: The expected signature if `path` is of a signed XCFramework, `nil` otherwise.
135+
/// - expectedSignature: The expected signature if `path` is of a signed XCFramework, `nil` otherwise.
136136
/// - condition: An optional platform condition.
137137
/// - xcodeProj: The Xcode project reference for resolving the directory structure.
138138
/// - Returns: A `TargetDependency` reflecting the file’s extension (framework, library, etc.).
139139
/// - Throws: If the path is missing or invalid.
140140
private func mapFileDependency(
141141
pathString: String?,
142-
originalSignature:XCFrameworkOriginalSignatureType?,
142+
expectedSignature:XCFrameworkSignature?,
143143
condition: PlatformCondition?,
144144
xcodeProj: XcodeProj
145145
) throws -> TargetDependency {
146146
let pathString = try pathString.throwing(
147147
TargetDependencyMappingError.missingFileReference("Path string is nil in file dependency.")
148148
)
149149
let path = xcodeProj.srcPath.appending(try RelativePath(validating: pathString))
150-
return try pathMapper.map(path: path, originalSignature:originalSignature, condition: condition)
150+
return try pathMapper.map(path: path, expectedSignature:expectedSignature, condition: condition)
151151
}
152152
}
153153

Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ extension TargetDependency {
5151
status: status
5252
)
5353

54-
case let .xcframework(path, originalSignature, status, _):
55-
let metadata = try await xcframeworkMetadataProvider.loadMetadata(at: path, expectedSignature: originalSignature.expectedSignature(), status: status)
54+
case let .xcframework(path, expectedSignature, status, _):
55+
let metadata = try await xcframeworkMetadataProvider.loadMetadata(
56+
at: path,
57+
expectedSignature: expectedSignature?.expectedSignature(),
58+
status: status
59+
)
5660
return .xcframework(
5761
.init(
5862
path: path,

Sources/XcodeGraphMapper/Utilities/PathDependencyMapper.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ protocol PathDependencyMapping {
88
///
99
/// - Parameters:
1010
/// - path: The file path to map.
11-
/// - originalSignature: The expected signature if `path` is of a signed XCFramework, `nil` otherwise.
11+
/// - expectedSignature: The expected signature if `path` is of a signed XCFramework, `nil` otherwise.
1212
/// - condition: An optional platform condition (e.g., iOS only).
1313
/// - Returns: The corresponding `TargetDependency`, if the path extension is recognized.
1414
/// - Throws: `PathDependencyError.invalidExtension` if the file extension is not supported.
15-
func map(path: AbsolutePath, originalSignature:XCFrameworkOriginalSignatureType?, condition: PlatformCondition?) throws -> TargetDependency
15+
func map(path: AbsolutePath, expectedSignature:XCFrameworkSignature?, condition: PlatformCondition?) throws -> TargetDependency
1616
}
1717

1818
/// A mapper that converts file paths (like `.framework`, `.xcframework`, or libraries) to `TargetDependency` models.
1919
struct PathDependencyMapper: PathDependencyMapping {
20-
func map(path: AbsolutePath, originalSignature: XCFrameworkOriginalSignatureType? = nil, condition: PlatformCondition?) throws -> TargetDependency {
20+
func map(path: AbsolutePath, expectedSignature: XCFrameworkSignature? = nil, condition: PlatformCondition?) throws -> TargetDependency {
2121
let status: LinkingStatus = .required
2222

2323
switch path.fileExtension {
2424
case .framework:
2525
return .framework(path: path, status: status, condition: condition)
2626
case .xcframework:
2727
// TODO: throw some error? log warning? this is very general, but from what I can tell it's only called from a non-xcframework contexts
28-
return .xcframework(path: path, originalSignature: originalSignature ?? .notSigned, status: status, condition: condition)
28+
return .xcframework(path: path, expectedSignature: expectedSignature ?? .notSigned, status: status, condition: condition)
2929
case .dynamicLibrary, .textBasedDynamicLibrary, .staticLibrary:
3030
return .library(
3131
path: path,

0 commit comments

Comments
 (0)