Skip to content

feat(PBXFileReference): add expectedSignature property #913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 30, 2025
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
8 changes: 2 additions & 6 deletions .github/workflows/xcodeproj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: jdx/mise-action@v2
- uses: swift-actions/setup-swift@v2
with:
swift-version: "6.0.2"
- run: mise use [email protected]
- name: Build
run: swift build --configuration release
test:
Expand All @@ -50,9 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: jdx/mise-action@v2
- uses: swift-actions/setup-swift@v2
with:
swift-version: "6.0.2"
- run: mise use [email protected]
- run: |
git config --global user.email '[email protected]'
git config --global user.name 'xcodeproj'
Expand Down
11 changes: 11 additions & 0 deletions Sources/XcodeProj/Objects/Files/PBXFileReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public final class PBXFileReference: PBXFileElement {
/// Derived file type. For a file named "foo.swift" this value would be "sourcecode.swift"
public var lastKnownFileType: String?

/// The XCFramework's expected code signature. `nil` if not an XCFramework reference or if the XCFramework is not signed.
public var expectedSignature: String?

/// Line ending type for the file
public var lineEnding: UInt?

Expand Down Expand Up @@ -44,6 +47,7 @@ public final class PBXFileReference: PBXFileElement {
/// - indentWidth: the number of positions to indent blocks of code
/// - tabWidth: the visual width of tab characters
/// - lineEnding: the line ending type for the file.
/// - expectedSignature: code signature for signed XCFrameworks, `nil` otherwise.
/// - languageSpecificationIdentifier: legacy programming language identifier.
/// - xcLanguageSpecificationIdentifier: the programming language identifier.
/// - plistStructureDefinitionIdentifier: the plist organizational family identifier.
Expand All @@ -59,13 +63,15 @@ public final class PBXFileReference: PBXFileElement {
indentWidth: UInt? = nil,
tabWidth: UInt? = nil,
lineEnding: UInt? = nil,
expectedSignature: String? = nil,
languageSpecificationIdentifier: String? = nil,
xcLanguageSpecificationIdentifier: String? = nil,
plistStructureDefinitionIdentifier: String? = nil) {
self.fileEncoding = fileEncoding
self.explicitFileType = explicitFileType
self.lastKnownFileType = lastKnownFileType
self.lineEnding = lineEnding
self.expectedSignature = expectedSignature
self.languageSpecificationIdentifier = languageSpecificationIdentifier
self.xcLanguageSpecificationIdentifier = xcLanguageSpecificationIdentifier
self.plistStructureDefinitionIdentifier = plistStructureDefinitionIdentifier
Expand All @@ -86,6 +92,7 @@ public final class PBXFileReference: PBXFileElement {
case explicitFileType
case lastKnownFileType
case lineEnding
case expectedSignature
case languageSpecificationIdentifier
case xcLanguageSpecificationIdentifier
case plistStructureDefinitionIdentifier
Expand All @@ -97,6 +104,7 @@ public final class PBXFileReference: PBXFileElement {
explicitFileType = try container.decodeIfPresent(.explicitFileType)
lastKnownFileType = try container.decodeIfPresent(.lastKnownFileType)
lineEnding = try container.decodeIntIfPresent(.lineEnding)
expectedSignature = try container.decodeIfPresent(.expectedSignature)
languageSpecificationIdentifier = try container.decodeIfPresent(.languageSpecificationIdentifier)
xcLanguageSpecificationIdentifier = try container.decodeIfPresent(.xcLanguageSpecificationIdentifier)
plistStructureDefinitionIdentifier = try container.decodeIfPresent(.plistStructureDefinitionIdentifier)
Expand All @@ -122,6 +130,9 @@ public final class PBXFileReference: PBXFileElement {
if let lineEnding {
dictionary["lineEnding"] = .string(CommentedString("\(lineEnding)"))
}
if let expectedSignature {
dictionary["expectedSignature"] = .string(CommentedString(expectedSignature))
}
if let languageSpecificationIdentifier {
dictionary["languageSpecificationIdentifier"] = .string(CommentedString(languageSpecificationIdentifier))
}
Expand Down