From 09dfd4523035926f2df9079fba0de9bff3b3840c Mon Sep 17 00:00:00 2001 From: fortmarek Date: Tue, 10 Feb 2026 17:36:27 +0100 Subject: [PATCH 1/7] feat: add foreignBuild case to TargetDependency Add support for foreign build system dependencies (KMP, Rust, CMake, etc.) by introducing a new `foreignBuild` case on `TargetDependency` and a `ForeignBuildCacheInput` model for content hashing. Co-Authored-By: Claude Opus 4.6 --- .../Models/ForeignBuildCacheInput.swift | 8 +++++ .../XcodeGraph/Models/TargetDependency.swift | 11 +++++++ .../TargetDependency+Extensions.swift | 2 ++ .../TargetDependency+GraphMapping.swift | 11 +++++++ .../Models/TargetDependencyTests.swift | 33 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift diff --git a/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift b/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift new file mode 100644 index 00000000..ddaa9144 --- /dev/null +++ b/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift @@ -0,0 +1,8 @@ +import Path + +public enum ForeignBuildCacheInput: Equatable, Hashable, Codable, Sendable { + case file(AbsolutePath) + case folder(AbsolutePath) + case glob(String) + case script(String) +} diff --git a/Sources/XcodeGraph/Models/TargetDependency.swift b/Sources/XcodeGraph/Models/TargetDependency.swift index 54ddb418..f1e0fc64 100644 --- a/Sources/XcodeGraph/Models/TargetDependency.swift +++ b/Sources/XcodeGraph/Models/TargetDependency.swift @@ -50,6 +50,13 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case package(product: String, type: PackageType, condition: PlatformCondition? = nil) case sdk(name: String, status: LinkingStatus, condition: PlatformCondition? = nil) case xctest + indirect case foreignBuild( + name: String, + script: String, + output: TargetDependency, + cacheInputs: [ForeignBuildCacheInput], + condition: PlatformCondition? = nil + ) public var condition: PlatformCondition? { switch self { @@ -68,6 +75,8 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case .sdk(name: _, status: _, condition: let condition): condition case .xctest: nil + case .foreignBuild(name: _, script: _, output: _, cacheInputs: _, condition: let condition): + condition } } @@ -88,6 +97,8 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case .sdk(name: let name, status: let status, condition: _): return .sdk(name: name, status: status, condition: condition) case .xctest: return .xctest + case .foreignBuild(name: let name, script: let script, output: let output, cacheInputs: let cacheInputs, condition: _): + return .foreignBuild(name: name, script: script, output: output, cacheInputs: cacheInputs, condition: condition) } } } diff --git a/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift b/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift index 6642bac8..54aa3bec 100644 --- a/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift +++ b/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift @@ -20,6 +20,8 @@ extension TargetDependency { return path.basenameWithoutExt case .xctest: return "xctest" + case let .foreignBuild(name, _, _, _, _): + return name } } } diff --git a/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift b/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift index a85e3ae6..b472aafb 100644 --- a/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift +++ b/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift @@ -101,6 +101,17 @@ extension TargetDependency { source: .developer ) + case let .foreignBuild(_, _, output, _, _): + return try await output.graphDependency( + sourceDirectory: sourceDirectory, + target: target, + xcframeworkMetadataProvider: xcframeworkMetadataProvider, + libraryMetadataProvider: libraryMetadataProvider, + frameworkMetadataProvider: frameworkMetadataProvider, + systemFrameworkMetadataProvider: systemFrameworkMetadataProvider, + developerDirectoryProvider: developerDirectoryProvider + ) + // MARK: - XCTest (System Provided) case .xctest: diff --git a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift index e3a070a7..56b5c5b7 100644 --- a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift @@ -36,6 +36,28 @@ final class TargetDependencyTests: XCTestCase { XCTAssertCodable(subject) } + func test_codable_foreignBuild() { + // Given + let subject = TargetDependency.foreignBuild( + name: "SharedKMP", + script: "./gradlew build", + output: .xcframework( + path: try! AbsolutePath(validating: "/path/to/output.xcframework"), + expectedSignature: nil, + status: .required + ), + cacheInputs: [ + .file(try! AbsolutePath(validating: "/path/to/input.kt")), + .folder(try! AbsolutePath(validating: "/path/to/src")), + .glob("**/*.kt"), + .script("git rev-parse HEAD"), + ] + ) + + // Then + XCTAssertCodable(subject) + } + func test_filtering() { let expected: PlatformCondition? = .when([.macos]) @@ -57,6 +79,17 @@ final class TargetDependencyTests: XCTestCase { condition: expected ), .project(target: "", path: try! AbsolutePath(validating: "/"), condition: expected), + .foreignBuild( + name: "KMP", + script: "./build.sh", + output: .xcframework( + path: try! AbsolutePath(validating: "/output.xcframework"), + expectedSignature: nil, + status: .required + ), + cacheInputs: [.file(try! AbsolutePath(validating: "/input.kt"))], + condition: expected + ), ] for subject in subjects { From b975413c01767c50a49855893e664a02e7cb1714 Mon Sep 17 00:00:00 2001 From: fortmarek Date: Thu, 12 Feb 2026 15:57:58 +0100 Subject: [PATCH 2/7] feat: redesign foreign build model with ForeignBuildInfo, ForeignBuildInput, and ForeignBuildArtifact Replace TargetDependency.foreignBuild case with Target.foreignBuild property using dedicated ForeignBuildInfo, ForeignBuildInput, and ForeignBuildArtifact types. Add GraphDependency.foreignBuildOutput for linking resolution. Co-Authored-By: Claude Opus 4.6 --- .../XcodeGraph/Graph/GraphDependency.swift | 46 +++++++++++++++++++ .../Models/ForeignBuildArtifact.swift | 23 ++++++++++ .../Models/ForeignBuildCacheInput.swift | 8 ---- .../XcodeGraph/Models/ForeignBuildInfo.swift | 17 +++++++ .../XcodeGraph/Models/ForeignBuildInput.swift | 7 +++ Sources/XcodeGraph/Models/Target.swift | 21 +++++++-- .../XcodeGraph/Models/TargetDependency.swift | 11 ----- .../TargetDependency+Extensions.swift | 2 - .../TargetDependency+GraphMapping.swift | 11 ----- .../Models/TargetDependencyTests.swift | 18 ++++---- 10 files changed, 117 insertions(+), 47 deletions(-) create mode 100644 Sources/XcodeGraph/Models/ForeignBuildArtifact.swift delete mode 100644 Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift create mode 100644 Sources/XcodeGraph/Models/ForeignBuildInfo.swift create mode 100644 Sources/XcodeGraph/Models/ForeignBuildInput.swift diff --git a/Sources/XcodeGraph/Graph/GraphDependency.swift b/Sources/XcodeGraph/Graph/GraphDependency.swift index 40f35481..252888b2 100644 --- a/Sources/XcodeGraph/Graph/GraphDependency.swift +++ b/Sources/XcodeGraph/Graph/GraphDependency.swift @@ -56,6 +56,26 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda } } + public struct ForeignBuildOutput: Hashable, CustomStringConvertible, Comparable, Codable, Sendable { + public var name: String + public var path: AbsolutePath + public var linking: BinaryLinking + + public init(name: String, path: AbsolutePath, linking: BinaryLinking) { + self.name = name + self.path = path + self.linking = linking + } + + public var description: String { "foreign build output '\(name)'" } + + public static func < (lhs: ForeignBuildOutput, rhs: ForeignBuildOutput) -> Bool { + lhs.description < rhs.description + } + } + + case foreignBuildOutput(ForeignBuildOutput) + case xcframework(GraphDependency.XCFramework) /// A dependency that represents a pre-compiled framework. @@ -97,6 +117,9 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda switch self { case let .macro(path): hasher.combine(path) + case let .foreignBuildOutput(output): + hasher.combine("foreignBuildOutput") + hasher.combine(output) case let .xcframework(xcframework): hasher.combine(xcframework) case let .framework(path, _, _, _, _, _, _): @@ -129,6 +152,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isTarget: Bool { switch self { case .macro: return false + case .foreignBuildOutput: return false case .xcframework: return false case .framework: return false case .library: return false @@ -145,6 +169,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isStaticPrecompiled: Bool { switch self { case .macro: return false + case let .foreignBuildOutput(output): return output.linking == .static case let .xcframework(xcframework): return xcframework.linking == .static case let .framework(_, _, _, _, linking, _, _), @@ -162,6 +187,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isDynamicPrecompiled: Bool { switch self { case .macro: return false + case let .foreignBuildOutput(output): return output.linking == .dynamic case let .xcframework(xcframework): return xcframework.linking == .dynamic case let .framework(_, _, _, _, linking, _, _), @@ -176,6 +202,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isPrecompiled: Bool { switch self { case .macro: return true + case .foreignBuildOutput: return true case .xcframework: return true case .framework: return true case .library: return true @@ -189,6 +216,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isLinkable: Bool { switch self { case .macro: return false + case .foreignBuildOutput: return true case .xcframework: return true case .framework: return true case .library: return true @@ -202,6 +230,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isPrecompiledMacro: Bool { switch self { case .macro: return true + case .foreignBuildOutput: return false case .xcframework: return false case .framework: return false case .library: return false @@ -215,6 +244,7 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda public var isPrecompiledDynamicAndLinkable: Bool { switch self { case .macro: return false + case let .foreignBuildOutput(output): return output.linking == .dynamic case let .xcframework(xcframework): return xcframework.linking == .dynamic case let .framework(_, _, _, _, linking, _, _), @@ -245,6 +275,8 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda switch self { case .macro: return "macro '\(name)'" + case let .foreignBuildOutput(output): + return output.description case .xcframework: return "xcframework '\(name)'" case .framework: @@ -266,6 +298,8 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda switch self { case let .macro(path): return path.basename + case let .foreignBuildOutput(output): + return output.name case let .xcframework(xcframework): return xcframework.path.basename case let .framework(path, _, _, _, _, _, _): @@ -382,6 +416,18 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda ) } + public static func testForeignBuildOutput( + name: String = "SharedKMP", + path: AbsolutePath = AbsolutePath.root.appending(try! RelativePath(validating: "SharedKMP.xcframework")), + linking: BinaryLinking = .dynamic + ) -> GraphDependency { + .foreignBuildOutput(GraphDependency.ForeignBuildOutput( + name: name, + path: path, + linking: linking + )) + } + public static func testBundle(path: AbsolutePath = .root.appending(component: "test.bundle")) -> GraphDependency { .bundle(path: path) } diff --git a/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift b/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift new file mode 100644 index 00000000..1c5c45fe --- /dev/null +++ b/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift @@ -0,0 +1,23 @@ +import Path + +public enum ForeignBuildArtifact: Equatable, Hashable, Codable, Sendable { + case xcframework(path: AbsolutePath, linking: BinaryLinking) + case framework(path: AbsolutePath, linking: BinaryLinking) + case library(path: AbsolutePath, publicHeaders: AbsolutePath, swiftModuleMap: AbsolutePath?, linking: BinaryLinking) + + public var path: AbsolutePath { + switch self { + case let .xcframework(path, _): return path + case let .framework(path, _): return path + case let .library(path, _, _, _): return path + } + } + + public var linking: BinaryLinking { + switch self { + case let .xcframework(_, linking): return linking + case let .framework(_, linking): return linking + case let .library(_, _, _, linking): return linking + } + } +} diff --git a/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift b/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift deleted file mode 100644 index ddaa9144..00000000 --- a/Sources/XcodeGraph/Models/ForeignBuildCacheInput.swift +++ /dev/null @@ -1,8 +0,0 @@ -import Path - -public enum ForeignBuildCacheInput: Equatable, Hashable, Codable, Sendable { - case file(AbsolutePath) - case folder(AbsolutePath) - case glob(String) - case script(String) -} diff --git a/Sources/XcodeGraph/Models/ForeignBuildInfo.swift b/Sources/XcodeGraph/Models/ForeignBuildInfo.swift new file mode 100644 index 00000000..5f1b0802 --- /dev/null +++ b/Sources/XcodeGraph/Models/ForeignBuildInfo.swift @@ -0,0 +1,17 @@ +import Path + +public struct ForeignBuildInfo: Equatable, Hashable, Codable, Sendable { + public let script: String + public let inputs: [ForeignBuildInput] + public let output: ForeignBuildArtifact + + public init( + script: String, + inputs: [ForeignBuildInput], + output: ForeignBuildArtifact + ) { + self.script = script + self.inputs = inputs + self.output = output + } +} diff --git a/Sources/XcodeGraph/Models/ForeignBuildInput.swift b/Sources/XcodeGraph/Models/ForeignBuildInput.swift new file mode 100644 index 00000000..ae0829bc --- /dev/null +++ b/Sources/XcodeGraph/Models/ForeignBuildInput.swift @@ -0,0 +1,7 @@ +import Path + +public enum ForeignBuildInput: Equatable, Hashable, Codable, Sendable { + case file(AbsolutePath) + case folder(AbsolutePath) + case script(String) +} diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index bdabad06..0c21d303 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -71,6 +71,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { public let type: TargetType public let packages: [AbsolutePath] public var buildableFolders: [BuildableFolder] + public var foreignBuild: ForeignBuildInfo? // MARK: - Init @@ -105,7 +106,8 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { metadata: TargetMetadata = .metadata(tags: []), type: TargetType = .local, packages: [AbsolutePath] = [], - buildableFolders: [BuildableFolder] = [] + buildableFolders: [BuildableFolder] = [], + foreignBuild: ForeignBuildInfo? = nil ) { self.name = name self.product = product @@ -138,6 +140,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { self.type = type self.packages = packages self.buildableFolders = buildableFolders + self.foreignBuild = foreignBuild } /// Given a target name, it obtains the product name by turning "-" characters into "_" and "/" into "_" @@ -148,6 +151,10 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { .replacingOccurrences(of: "/", with: "_") } + public var isAggregate: Bool { + foreignBuild != nil + } + /// Target can be included in the link phase of other targets public func isLinkable() -> Bool { [.dynamicLibrary, .staticLibrary, .framework, .staticFramework].contains(product) @@ -451,7 +458,8 @@ extension Sequence { mergedBinaryType: MergedBinaryType = .disabled, mergeable: Bool = false, metadata: TargetMetadata = .test(), - buildableFolders: [BuildableFolder] = [] + buildableFolders: [BuildableFolder] = [], + foreignBuild: ForeignBuildInfo? = nil ) -> Target { Target( name: name, @@ -480,7 +488,8 @@ extension Sequence { mergedBinaryType: mergedBinaryType, mergeable: mergeable, metadata: metadata, - buildableFolders: buildableFolders + buildableFolders: buildableFolders, + foreignBuild: foreignBuild ) } @@ -513,7 +522,8 @@ extension Sequence { mergedBinaryType: MergedBinaryType = .disabled, mergeable: Bool = false, metadata: TargetMetadata = .test(), - buildableFolders: [BuildableFolder] = [] + buildableFolders: [BuildableFolder] = [], + foreignBuild: ForeignBuildInfo? = nil ) -> Target { Target( name: name, @@ -542,7 +552,8 @@ extension Sequence { mergedBinaryType: mergedBinaryType, mergeable: mergeable, metadata: metadata, - buildableFolders: buildableFolders + buildableFolders: buildableFolders, + foreignBuild: foreignBuild ) } diff --git a/Sources/XcodeGraph/Models/TargetDependency.swift b/Sources/XcodeGraph/Models/TargetDependency.swift index f1e0fc64..54ddb418 100644 --- a/Sources/XcodeGraph/Models/TargetDependency.swift +++ b/Sources/XcodeGraph/Models/TargetDependency.swift @@ -50,13 +50,6 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case package(product: String, type: PackageType, condition: PlatformCondition? = nil) case sdk(name: String, status: LinkingStatus, condition: PlatformCondition? = nil) case xctest - indirect case foreignBuild( - name: String, - script: String, - output: TargetDependency, - cacheInputs: [ForeignBuildCacheInput], - condition: PlatformCondition? = nil - ) public var condition: PlatformCondition? { switch self { @@ -75,8 +68,6 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case .sdk(name: _, status: _, condition: let condition): condition case .xctest: nil - case .foreignBuild(name: _, script: _, output: _, cacheInputs: _, condition: let condition): - condition } } @@ -97,8 +88,6 @@ public enum TargetDependency: Equatable, Hashable, Codable, Sendable { case .sdk(name: let name, status: let status, condition: _): return .sdk(name: name, status: status, condition: condition) case .xctest: return .xctest - case .foreignBuild(name: let name, script: let script, output: let output, cacheInputs: let cacheInputs, condition: _): - return .foreignBuild(name: name, script: script, output: output, cacheInputs: cacheInputs, condition: condition) } } } diff --git a/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift b/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift index 54aa3bec..6642bac8 100644 --- a/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift +++ b/Sources/XcodeGraphMapper/Extensions/TargetDependency+Extensions.swift @@ -20,8 +20,6 @@ extension TargetDependency { return path.basenameWithoutExt case .xctest: return "xctest" - case let .foreignBuild(name, _, _, _, _): - return name } } } diff --git a/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift b/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift index b472aafb..a85e3ae6 100644 --- a/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift +++ b/Sources/XcodeGraphMapper/Mappers/Targets/TargetDependency+GraphMapping.swift @@ -101,17 +101,6 @@ extension TargetDependency { source: .developer ) - case let .foreignBuild(_, _, output, _, _): - return try await output.graphDependency( - sourceDirectory: sourceDirectory, - target: target, - xcframeworkMetadataProvider: xcframeworkMetadataProvider, - libraryMetadataProvider: libraryMetadataProvider, - frameworkMetadataProvider: frameworkMetadataProvider, - systemFrameworkMetadataProvider: systemFrameworkMetadataProvider, - developerDirectoryProvider: developerDirectoryProvider - ) - // MARK: - XCTest (System Provided) case .xctest: diff --git a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift index 56b5c5b7..e5b75a78 100644 --- a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift @@ -41,17 +41,16 @@ final class TargetDependencyTests: XCTestCase { let subject = TargetDependency.foreignBuild( name: "SharedKMP", script: "./gradlew build", - output: .xcframework( - path: try! AbsolutePath(validating: "/path/to/output.xcframework"), - expectedSignature: nil, - status: .required - ), - cacheInputs: [ + inputs: [ .file(try! AbsolutePath(validating: "/path/to/input.kt")), .folder(try! AbsolutePath(validating: "/path/to/src")), .glob("**/*.kt"), .script("git rev-parse HEAD"), - ] + ], + output: .xcframework( + path: try! AbsolutePath(validating: "/path/to/output.xcframework"), + linking: .dynamic + ) ) // Then @@ -82,12 +81,11 @@ final class TargetDependencyTests: XCTestCase { .foreignBuild( name: "KMP", script: "./build.sh", + inputs: [.file(try! AbsolutePath(validating: "/input.kt"))], output: .xcframework( path: try! AbsolutePath(validating: "/output.xcframework"), - expectedSignature: nil, - status: .required + linking: .dynamic ), - cacheInputs: [.file(try! AbsolutePath(validating: "/input.kt"))], condition: expected ), ] From c7addb9504eb9f92fe5cf182e0569826fca85cff Mon Sep 17 00:00:00 2001 From: fortmarek Date: Thu, 12 Feb 2026 16:17:15 +0100 Subject: [PATCH 3/7] refactor: rename ForeignBuildInfo to ForeignBuild and nest Input/Artifact Rename `ForeignBuildInfo` to `ForeignBuild` to match the ProjectDescription naming convention. Nest `ForeignBuildInput` and `ForeignBuildArtifact` as `ForeignBuild.Input` and `ForeignBuild.Artifact` for cleaner namespacing. Co-Authored-By: Claude Opus 4.6 --- Package.resolved | 44 ++++++++++++----- Sources/XcodeGraph/Models/ForeignBuild.swift | 49 +++++++++++++++++++ .../Models/ForeignBuildArtifact.swift | 23 --------- .../XcodeGraph/Models/ForeignBuildInfo.swift | 17 ------- .../XcodeGraph/Models/ForeignBuildInput.swift | 7 --- Sources/XcodeGraph/Models/Target.swift | 8 +-- 6 files changed, 84 insertions(+), 64 deletions(-) create mode 100644 Sources/XcodeGraph/Models/ForeignBuild.swift delete mode 100644 Sources/XcodeGraph/Models/ForeignBuildArtifact.swift delete mode 100644 Sources/XcodeGraph/Models/ForeignBuildInfo.swift delete mode 100644 Sources/XcodeGraph/Models/ForeignBuildInput.swift diff --git a/Package.resolved b/Package.resolved index e8a5b425..21e51788 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "cdc9be76aaffeb8dbcd507c75817622558ba401dcfa67cebf405a4c32004fa46", + "originHash" : "e64a631d84155fa1dd47d1dbcfb085ffbdfbc60ee0792fee2a2320579e19f568", "pins" : [ { "identity" : "aexml", @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/FileSystem.git", "state" : { - "revision" : "d7f0e65da38b26272b39068d94978363ad64bf9a", - "version" : "0.14.8" + "revision" : "ed76b19034f6a04a266319ed5c460377e8e91fb8", + "version" : "0.14.25" } }, { @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/p-x9/MachOKit", "state" : { - "revision" : "97a600d7b72cf2538dc0cd77b792f5211c2de055", - "version" : "0.44.0" + "revision" : "a17885f09c038957a7ec70cb3099f4a423af4c40", + "version" : "0.46.1" } }, { @@ -51,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Kolos65/Mockable.git", "state" : { - "revision" : "1e0d218b41aef515627a0fa7c98ca2b9d2833213", - "version" : "0.5.0" + "revision" : "e969f8469667382af3cbf6e457b2e771e70745f3", + "version" : "0.6.0" } }, { @@ -91,6 +91,15 @@ "version" : "1.2.0" } }, + { + "identity" : "swift-binary-parse-support", + "kind" : "remoteSourceControl", + "location" : "https://github.com/p-x9/swift-binary-parse-support.git", + "state" : { + "revision" : "5fb96b503672ea4752eded6b4e301fd87214b03b", + "version" : "0.2.1" + } + }, { "identity" : "swift-collections", "kind" : "remoteSourceControl", @@ -123,8 +132,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/p-x9/swift-fileio.git", "state" : { - "revision" : "63daf8e8402789339ccc5a19d198ff0fcafd29d9", - "version" : "0.11.0" + "revision" : "d589ff3966f9f064574780f527449a946736b989", + "version" : "0.13.0" + } + }, + { + "identity" : "swift-fileio-extra", + "kind" : "remoteSourceControl", + "location" : "https://github.com/p-x9/swift-fileio-extra.git", + "state" : { + "revision" : "8d83506dd4dff737807d90dbf2264096ed98c7a7", + "version" : "0.2.2" } }, { @@ -132,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log", "state" : { - "revision" : "bc386b95f2a16ccd0150a8235e7c69eab2b866ca", - "version" : "1.8.0" + "revision" : "2778fd4e5a12a8aaa30a3ee8285f4ce54c5f3181", + "version" : "1.9.1" } }, { @@ -168,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/XcodeProj", "state" : { - "revision" : "1cf10b32c53e003994f27bb3d37e20dcb941179d", - "version" : "9.7.1" + "revision" : "31712ec42e9cbc46e7fd25ea55c2730cb3476097", + "version" : "9.7.2" } }, { diff --git a/Sources/XcodeGraph/Models/ForeignBuild.swift b/Sources/XcodeGraph/Models/ForeignBuild.swift new file mode 100644 index 00000000..0b20af89 --- /dev/null +++ b/Sources/XcodeGraph/Models/ForeignBuild.swift @@ -0,0 +1,49 @@ +import Path + +public struct ForeignBuild: Equatable, Hashable, Codable, Sendable { + public let script: String + public let inputs: [Input] + public let output: Artifact + + public init( + script: String, + inputs: [Input], + output: Artifact + ) { + self.script = script + self.inputs = inputs + self.output = output + } +} + +extension ForeignBuild { + public enum Input: Equatable, Hashable, Codable, Sendable { + case file(AbsolutePath) + case folder(AbsolutePath) + case script(String) + } +} + +extension ForeignBuild { + public enum Artifact: Equatable, Hashable, Codable, Sendable { + case xcframework(path: AbsolutePath, linking: BinaryLinking) + case framework(path: AbsolutePath, linking: BinaryLinking) + case library(path: AbsolutePath, publicHeaders: AbsolutePath, swiftModuleMap: AbsolutePath?, linking: BinaryLinking) + + public var path: AbsolutePath { + switch self { + case let .xcframework(path, _): return path + case let .framework(path, _): return path + case let .library(path, _, _, _): return path + } + } + + public var linking: BinaryLinking { + switch self { + case let .xcframework(_, linking): return linking + case let .framework(_, linking): return linking + case let .library(_, _, _, linking): return linking + } + } + } +} diff --git a/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift b/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift deleted file mode 100644 index 1c5c45fe..00000000 --- a/Sources/XcodeGraph/Models/ForeignBuildArtifact.swift +++ /dev/null @@ -1,23 +0,0 @@ -import Path - -public enum ForeignBuildArtifact: Equatable, Hashable, Codable, Sendable { - case xcframework(path: AbsolutePath, linking: BinaryLinking) - case framework(path: AbsolutePath, linking: BinaryLinking) - case library(path: AbsolutePath, publicHeaders: AbsolutePath, swiftModuleMap: AbsolutePath?, linking: BinaryLinking) - - public var path: AbsolutePath { - switch self { - case let .xcframework(path, _): return path - case let .framework(path, _): return path - case let .library(path, _, _, _): return path - } - } - - public var linking: BinaryLinking { - switch self { - case let .xcframework(_, linking): return linking - case let .framework(_, linking): return linking - case let .library(_, _, _, linking): return linking - } - } -} diff --git a/Sources/XcodeGraph/Models/ForeignBuildInfo.swift b/Sources/XcodeGraph/Models/ForeignBuildInfo.swift deleted file mode 100644 index 5f1b0802..00000000 --- a/Sources/XcodeGraph/Models/ForeignBuildInfo.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Path - -public struct ForeignBuildInfo: Equatable, Hashable, Codable, Sendable { - public let script: String - public let inputs: [ForeignBuildInput] - public let output: ForeignBuildArtifact - - public init( - script: String, - inputs: [ForeignBuildInput], - output: ForeignBuildArtifact - ) { - self.script = script - self.inputs = inputs - self.output = output - } -} diff --git a/Sources/XcodeGraph/Models/ForeignBuildInput.swift b/Sources/XcodeGraph/Models/ForeignBuildInput.swift deleted file mode 100644 index ae0829bc..00000000 --- a/Sources/XcodeGraph/Models/ForeignBuildInput.swift +++ /dev/null @@ -1,7 +0,0 @@ -import Path - -public enum ForeignBuildInput: Equatable, Hashable, Codable, Sendable { - case file(AbsolutePath) - case folder(AbsolutePath) - case script(String) -} diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index 0c21d303..fe78e3d6 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -71,7 +71,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { public let type: TargetType public let packages: [AbsolutePath] public var buildableFolders: [BuildableFolder] - public var foreignBuild: ForeignBuildInfo? + public var foreignBuild: ForeignBuild? // MARK: - Init @@ -107,7 +107,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { type: TargetType = .local, packages: [AbsolutePath] = [], buildableFolders: [BuildableFolder] = [], - foreignBuild: ForeignBuildInfo? = nil + foreignBuild: ForeignBuild? = nil ) { self.name = name self.product = product @@ -459,7 +459,7 @@ extension Sequence { mergeable: Bool = false, metadata: TargetMetadata = .test(), buildableFolders: [BuildableFolder] = [], - foreignBuild: ForeignBuildInfo? = nil + foreignBuild: ForeignBuild? = nil ) -> Target { Target( name: name, @@ -523,7 +523,7 @@ extension Sequence { mergeable: Bool = false, metadata: TargetMetadata = .test(), buildableFolders: [BuildableFolder] = [], - foreignBuild: ForeignBuildInfo? = nil + foreignBuild: ForeignBuild? = nil ) -> Target { Target( name: name, From 673eed78f4e42bb84a5a95aba01f6dafc85c0a6a Mon Sep 17 00:00:00 2001 From: fortmarek Date: Fri, 13 Feb 2026 09:50:47 +0100 Subject: [PATCH 4/7] refactor: simplify ForeignBuild.Artifact to xcframework-only Remove .framework and .library cases from ForeignBuild.Artifact. XCFramework is the only supported output format for foreign builds as it provides multi-architecture support and cache compatibility. Co-Authored-By: Claude Opus 4.6 --- Sources/XcodeGraph/Models/ForeignBuild.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sources/XcodeGraph/Models/ForeignBuild.swift b/Sources/XcodeGraph/Models/ForeignBuild.swift index 0b20af89..13492fce 100644 --- a/Sources/XcodeGraph/Models/ForeignBuild.swift +++ b/Sources/XcodeGraph/Models/ForeignBuild.swift @@ -27,22 +27,16 @@ extension ForeignBuild { extension ForeignBuild { public enum Artifact: Equatable, Hashable, Codable, Sendable { case xcframework(path: AbsolutePath, linking: BinaryLinking) - case framework(path: AbsolutePath, linking: BinaryLinking) - case library(path: AbsolutePath, publicHeaders: AbsolutePath, swiftModuleMap: AbsolutePath?, linking: BinaryLinking) public var path: AbsolutePath { switch self { case let .xcframework(path, _): return path - case let .framework(path, _): return path - case let .library(path, _, _, _): return path } } public var linking: BinaryLinking { switch self { case let .xcframework(_, linking): return linking - case let .framework(_, linking): return linking - case let .library(_, _, _, linking): return linking } } } From 7c8db3f822de6f418fa07f936192c56cd3a8b76c Mon Sep 17 00:00:00 2001 From: fortmarek Date: Fri, 13 Feb 2026 11:38:54 +0100 Subject: [PATCH 5/7] fix: remove stale foreignBuild references from TargetDependencyTests The foreignBuild case was removed from TargetDependency (it moved to the Target model), but the test file still referenced it. Co-Authored-By: Claude Opus 4.6 --- .../Models/TargetDependencyTests.swift | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift index e5b75a78..e3a070a7 100644 --- a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift @@ -36,27 +36,6 @@ final class TargetDependencyTests: XCTestCase { XCTAssertCodable(subject) } - func test_codable_foreignBuild() { - // Given - let subject = TargetDependency.foreignBuild( - name: "SharedKMP", - script: "./gradlew build", - inputs: [ - .file(try! AbsolutePath(validating: "/path/to/input.kt")), - .folder(try! AbsolutePath(validating: "/path/to/src")), - .glob("**/*.kt"), - .script("git rev-parse HEAD"), - ], - output: .xcframework( - path: try! AbsolutePath(validating: "/path/to/output.xcframework"), - linking: .dynamic - ) - ) - - // Then - XCTAssertCodable(subject) - } - func test_filtering() { let expected: PlatformCondition? = .when([.macos]) @@ -78,16 +57,6 @@ final class TargetDependencyTests: XCTestCase { condition: expected ), .project(target: "", path: try! AbsolutePath(validating: "/"), condition: expected), - .foreignBuild( - name: "KMP", - script: "./build.sh", - inputs: [.file(try! AbsolutePath(validating: "/input.kt"))], - output: .xcframework( - path: try! AbsolutePath(validating: "/output.xcframework"), - linking: .dynamic - ), - condition: expected - ), ] for subject in subjects { From a3ef93ca5e07fb845a0078e32a4b43551a385202 Mon Sep 17 00:00:00 2001 From: fortmarek Date: Fri, 13 Feb 2026 15:54:37 +0100 Subject: [PATCH 6/7] fix: resolve SwiftFormat lint violations across codebase Co-Authored-By: Claude Opus 4.6 --- .../Graph/ConditionalGraphTarget.swift | 4 ++- .../XcodeGraph/Graph/GraphDependency.swift | 4 ++- Sources/XcodeGraph/Models/Plist.swift | 24 +++++++------- Sources/XcodeGraph/Models/Product.swift | 2 +- .../Models/ResourceSynthesizer.swift | 5 ++- .../XcodeGraph/Models/RunActionOptions.swift | 32 +++++++++---------- Sources/XcodeGraph/Models/Target.swift | 6 ++-- Sources/XcodeGraph/PackageInfo.swift | 2 +- .../PrecompiledMetadataProvider.swift | 2 +- .../Graph/XcodeGraphMapperTests.swift | 18 +++++------ .../Package/PackageMapperTests.swift | 1 - .../Package/XCPackageMapperTests.swift | 18 +++++------ .../PBXFrameworksBuildPhaseMapperTests.swift | 1 - .../Schemes/XCSchemeMapperTests.swift | 1 - .../Settings/ConfigurationMatcherTests.swift | 8 ++--- .../Settings/XCConfigurationMapperTests.swift | 2 +- .../Target/PBXTargetMapperTests.swift | 12 +++---- .../TestData/XCUserData+TestData.swift | 2 +- .../XCWorkspaceDataGroup+TestData.swift | 2 -- .../DependenciesGraphTests.swift | 1 - .../SettingsDictionary+ExtrasTests.swift | 1 - .../Graph/GraphDependencyTests.swift | 1 - .../Graph/GraphTargetTests.swift | 1 - Tests/XcodeGraphTests/Graph/GraphTests.swift | 5 ++- .../Models/AnalyzeActionTests.swift | 1 - .../Models/ArchiveActionTests.swift | 1 - .../Models/ArgumentsTests.swift | 1 - .../Models/BuildActionTests.swift | 5 ++- .../Models/BuildConfigurationTests.swift | 1 - .../Models/BuildRule.CompilerSpecTests.swift | 1 - .../Models/BuildRule.FileTypeTests.swift | 1 - .../Models/BuildRuleTests.swift | 1 - .../Models/CompatibleXcodeVersionsTests.swift | 1 - .../Models/CopyFileElementTests.swift | 9 +++--- .../Models/CopyFilesActionTests.swift | 5 ++- .../Models/CoreDataModelTests.swift | 7 ++-- .../Models/ExecutionActionTests.swift | 5 ++- .../Models/FileElementTests.swift | 9 +++--- .../XcodeGraphTests/Models/HeadersTests.swift | 9 +++--- .../Models/InfoPlistTests.swift | 9 +++--- .../Models/PackageInfoTests.swift | 2 -- .../XcodeGraphTests/Models/PackageTests.swift | 9 +++--- .../Models/PlatformFilterTests.swift | 1 - .../Models/ProfileActionTests.swift | 5 ++- .../Models/ProjectGroupTests.swift | 1 - .../Models/RawScriptBuildPhaseTests.swift | 1 - .../Models/RequirementTests.swift | 1 - .../Models/ResourceFileElementTests.swift | 9 +++--- .../Models/ResourceSynthesizerTests.swift | 1 - .../Models/RunActionTests.swift | 9 +++--- .../Models/SDKSourceTests.swift | 1 - .../XcodeGraphTests/Models/SchemeTests.swift | 1 - .../Models/SettingsTests.swift | 8 ++--- .../Models/SourceFileTests.swift | 5 ++- .../Models/TargetDependencyTests.swift | 31 +++++++++--------- .../Models/TargetReferenceTests.swift | 5 ++- .../Models/TestActionTests.swift | 1 - .../Models/TestPlanTests.swift | 5 ++- .../Models/TestableTargetTests.swift | 9 +++--- .../WorkspaceGenerationOptionsTests.swift | 1 - .../Models/WorkspaceTests.swift | 5 ++- .../Models/XCFrameworkInfoPlistTests.swift | 2 +- 62 files changed, 146 insertions(+), 188 deletions(-) diff --git a/Sources/XcodeGraph/Graph/ConditionalGraphTarget.swift b/Sources/XcodeGraph/Graph/ConditionalGraphTarget.swift index e1322612..413df2f2 100644 --- a/Sources/XcodeGraph/Graph/ConditionalGraphTarget.swift +++ b/Sources/XcodeGraph/Graph/ConditionalGraphTarget.swift @@ -7,7 +7,9 @@ public struct GraphTargetReference: Equatable, Comparable, Hashable, CustomDebug /// Path to the directory that contains the project where the target is defined. public let graphTarget: GraphTarget - public var target: Target { graphTarget.target } + public var target: Target { + graphTarget.target + } /// Platforms the target is conditionally deployed to. public let condition: PlatformCondition? diff --git a/Sources/XcodeGraph/Graph/GraphDependency.swift b/Sources/XcodeGraph/Graph/GraphDependency.swift index 252888b2..5b2195ed 100644 --- a/Sources/XcodeGraph/Graph/GraphDependency.swift +++ b/Sources/XcodeGraph/Graph/GraphDependency.swift @@ -67,7 +67,9 @@ public enum GraphDependency: Hashable, CustomStringConvertible, Comparable, Coda self.linking = linking } - public var description: String { "foreign build output '\(name)'" } + public var description: String { + "foreign build output '\(name)'" + } public static func < (lhs: ForeignBuildOutput, rhs: ForeignBuildOutput) -> Bool { lhs.description < rhs.description diff --git a/Sources/XcodeGraph/Models/Plist.swift b/Sources/XcodeGraph/Models/Plist.swift index 3af5c63a..e6e626fe 100644 --- a/Sources/XcodeGraph/Models/Plist.swift +++ b/Sources/XcodeGraph/Models/Plist.swift @@ -93,21 +93,21 @@ extension Dictionary where Value == Plist.Value { // MARK: - InfoPlist public enum InfoPlist: Equatable, Codable, Sendable { - // Path to a user defined info.plist file (already exists on disk). + /// Path to a user defined info.plist file (already exists on disk). case file(path: AbsolutePath, configuration: BuildConfiguration? = nil) - // Path to a generated info.plist file (may not exist on disk at the time of project generation). - // Data of the generated file + /// Path to a generated info.plist file (may not exist on disk at the time of project generation). + /// Data of the generated file case generatedFile(path: AbsolutePath, data: Data, configuration: BuildConfiguration? = nil) - // User defined dictionary of keys/values for an info.plist file. + /// User defined dictionary of keys/values for an info.plist file. case dictionary([String: Plist.Value], configuration: BuildConfiguration? = nil) - // A user defined xcconfig variable map to .entitlements file + /// A user defined xcconfig variable map to .entitlements file case variable(String, configuration: BuildConfiguration? = nil) - // User defined dictionary of keys/values for an info.plist file extending the default set of keys/values - // for the target type. + /// User defined dictionary of keys/values for an info.plist file extending the default set of keys/values + /// for the target type. case extendingDefault(with: [String: Plist.Value], configuration: BuildConfiguration? = nil) // MARK: - Public @@ -138,17 +138,17 @@ extension InfoPlist: ExpressibleByStringLiteral { // MARK: - Entitlements public enum Entitlements: Equatable, Codable, Sendable { - // Path to a user defined .entitlements file (already exists on disk). + /// Path to a user defined .entitlements file (already exists on disk). case file(path: AbsolutePath, configuration: BuildConfiguration? = nil) - // Path to a generated .entitlements file (may not exist on disk at the time of project generation). - // Data of the generated file + /// Path to a generated .entitlements file (may not exist on disk at the time of project generation). + /// Data of the generated file case generatedFile(path: AbsolutePath, data: Data, configuration: BuildConfiguration? = nil) - // User defined dictionary of keys/values for an .entitlements file. + /// User defined dictionary of keys/values for an .entitlements file. case dictionary([String: Plist.Value], configuration: BuildConfiguration? = nil) - // A user defined xcconfig variable map to .entitlements file + /// A user defined xcconfig variable map to .entitlements file case variable(String, configuration: BuildConfiguration? = nil) // MARK: - Public diff --git a/Sources/XcodeGraph/Models/Product.swift b/Sources/XcodeGraph/Models/Product.swift index d3876861..c6669fe6 100644 --- a/Sources/XcodeGraph/Models/Product.swift +++ b/Sources/XcodeGraph/Models/Product.swift @@ -11,7 +11,7 @@ public enum Product: String, CustomStringConvertible, CaseIterable, Codable, Sen case bundle case commandLineTool case appExtension = "app_extension" - // case watchApp = "watch_app" + /// case watchApp = "watch_app" case watch2App = "watch_2_app" // case watchExtension = "watch_extension" case watch2Extension = "watch_2_extension" diff --git a/Sources/XcodeGraph/Models/ResourceSynthesizer.swift b/Sources/XcodeGraph/Models/ResourceSynthesizer.swift index 23748225..09cb8de3 100644 --- a/Sources/XcodeGraph/Models/ResourceSynthesizer.swift +++ b/Sources/XcodeGraph/Models/ResourceSynthesizer.swift @@ -26,7 +26,10 @@ public struct ResourceSynthesizer: Equatable, Hashable, Codable, Sendable { case files public struct Option: Equatable, Hashable, Codable, Sendable { - public var value: Any { anyCodableValue.value } + public var value: Any { + anyCodableValue.value + } + private let anyCodableValue: AnyCodable public init(value: some Any) { diff --git a/Sources/XcodeGraph/Models/RunActionOptions.swift b/Sources/XcodeGraph/Models/RunActionOptions.swift index 941bdb18..b947bcd1 100644 --- a/Sources/XcodeGraph/Models/RunActionOptions.swift +++ b/Sources/XcodeGraph/Models/RunActionOptions.swift @@ -20,22 +20,22 @@ public struct RunActionOptions: Equatable, Codable, Sendable { /// Configure your project to work with the Metal frame debugger. public let enableGPUFrameCaptureMode: GPUFrameCaptureMode - /// Creates an `RunActionOptions` instance - /// - /// - Parameters: - /// - language: language (e.g. "pl"). - /// - /// - storeKitConfigurationPath: The absolute path of the - /// [StoreKit configuration - /// file](https://developer.apple.com/documentation/xcode/setting_up_storekit_testing_in_xcode#3625700). - /// The default value is `nil`, which results in no - /// configuration defined for the scheme - /// - /// - simulatedLocation: The simulated GPS location to use when running the app. - /// - /// - enableGPUFrameCaptureMode: The Metal Frame Capture mode to use. e.g: .disabled - /// If your target links to the Metal framework, Xcode enables GPU Frame Capture. - /// You can disable it to test your app in best performance. + // Creates an `RunActionOptions` instance + // + // - Parameters: + // - language: language (e.g. "pl"). + // + // - storeKitConfigurationPath: The absolute path of the + // [StoreKit configuration + // file](https://developer.apple.com/documentation/xcode/setting_up_storekit_testing_in_xcode#3625700). + // The default value is `nil`, which results in no + // configuration defined for the scheme + // + // - simulatedLocation: The simulated GPS location to use when running the app. + // + // - enableGPUFrameCaptureMode: The Metal Frame Capture mode to use. e.g: .disabled + // If your target links to the Metal framework, Xcode enables GPU Frame Capture. + // You can disable it to test your app in best performance. public init( language: String? = nil, diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index fe78e3d6..c8c6880e 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -5,8 +5,8 @@ import Path public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { // MARK: - Static - // Note: The `.docc` file type is technically both a valid source extension and folder extension - // in order to compile the documentation archive (including Tutorials, Articles, etc.) + /// Note: The `.docc` file type is technically both a valid source extension and folder extension + /// in order to compile the documentation archive (including Tutorials, Articles, etc.) public static let validSourceCompatibleFolderExtensions: [String] = [ "playground", "rcproject", "mlpackage", "docc", ] @@ -606,7 +606,7 @@ extension Sequence { ) } - // Maps a platform to a set of Destinations. For migration purposes + /// Maps a platform to a set of Destinations. For migration purposes private static func destinationsFrom(_ platform: Platform) -> Destinations { switch platform { case .iOS: diff --git a/Sources/XcodeGraph/PackageInfo.swift b/Sources/XcodeGraph/PackageInfo.swift index 2f187ea3..7e7b644c 100644 --- a/Sources/XcodeGraph/PackageInfo.swift +++ b/Sources/XcodeGraph/PackageInfo.swift @@ -614,7 +614,7 @@ extension PackageInfo.Target { case tool, name, condition, value, kind } - // Xcode 14 format + /// Xcode 14 format private enum Kind: Codable, Equatable { case swiftLanguageMode(String) case headerSearchPath(String) diff --git a/Sources/XcodeMetadata/Providers/PrecompiledMetadataProvider.swift b/Sources/XcodeMetadata/Providers/PrecompiledMetadataProvider.swift index c5418478..12fca735 100644 --- a/Sources/XcodeMetadata/Providers/PrecompiledMetadataProvider.swift +++ b/Sources/XcodeMetadata/Providers/PrecompiledMetadataProvider.swift @@ -45,7 +45,7 @@ public protocol PrecompiledMetadataProviding { /// Reads Mach-O metadata (arches, linking type, UUIDs) without calling deprecated swap_* APIs. public class PrecompiledMetadataProvider: PrecompiledMetadataProviding { - // A local struct for arch/linking/UUID data + /// A local struct for arch/linking/UUID data typealias Metadata = (BinaryArchitecture, BinaryLinking, UUID?) public func architectures(binaryPath: AbsolutePath) throws -> [BinaryArchitecture] { diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Graph/XcodeGraphMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Graph/XcodeGraphMapperTests.swift index 52a8edc0..8d89ec72 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Graph/XcodeGraphMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Graph/XcodeGraphMapperTests.swift @@ -45,7 +45,7 @@ struct XcodeGraphMapperTests { .add(to: pbxProj.rootObject) let projectPath = xcodeProj.projectPath - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = XcodeGraphMapper() // When let graph = try await mapper.buildGraph(from: .project(xcodeProj)) @@ -90,7 +90,7 @@ struct XcodeGraphMapperTests { .add(to: pbxProj) .add(to: pbxProj.rootObject) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = XcodeGraphMapper( projectMapper: projectMapper ) @@ -141,7 +141,7 @@ struct XcodeGraphMapperTests { .add(to: pbxProj) .add(to: pbxProj.rootObject) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = XcodeGraphMapper( projectMapper: projectMapper ) @@ -229,8 +229,8 @@ struct XcodeGraphMapperTests { path: .init(projectAPath.appending("/Workspace.xcworkspace")) ) - try projectA.write(path: projectA.path!) - try projectB.write(path: projectB.path!) + try projectA.write(path: try #require(projectA.path)) + try projectB.write(path: try #require(projectB.path)) let mapper = XcodeGraphMapper() // When @@ -308,8 +308,8 @@ struct XcodeGraphMapperTests { path: .init("/tmp/Workspace.xcworkspace") ) - try projectA.write(path: projectA.path!) - try projectB.write(path: projectB.path!) + try projectA.write(path: try #require(projectA.path)) + try projectB.write(path: try #require(projectB.path)) let mapper = XcodeGraphMapper() // When @@ -380,7 +380,7 @@ struct XcodeGraphMapperTests { ) .add(to: pbxProj) appTarget.dependencies.append(dep) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = XcodeGraphMapper() // When @@ -420,7 +420,7 @@ struct XcodeGraphMapperTests { .add(to: pbxProj) .add(to: pbxProj.rootObject) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let packageMapper = MockPackageMapping() let packageInfoLoader = MockPackageInfoLoading() let projectMapper = MockPBXProjectMapping() diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Package/PackageMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Package/PackageMapperTests.swift index d67ec431..cfa9488b 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Package/PackageMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Package/PackageMapperTests.swift @@ -2,7 +2,6 @@ import FileSystem import Foundation import Testing import XcodeGraph - @testable import XcodeGraphMapper struct PackageMapperTests: Sendable { diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Package/XCPackageMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Package/XCPackageMapperTests.swift index b5e5379e..93fa15f5 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Package/XCPackageMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Package/XCPackageMapperTests.swift @@ -13,7 +13,7 @@ struct XCPackageMapperTests { } @Test("Maps a remote package with a valid URL and up-to-next-major requirement") - func mapPackageWithValidURL() async throws { + func mapPackageWithValidURL() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -34,7 +34,7 @@ struct XCPackageMapperTests { } @Test("Maps an up-to-next-major version requirement correctly") - func mapRequirementUpToNextMajor() async throws { + func mapRequirementUpToNextMajor() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -48,7 +48,7 @@ struct XCPackageMapperTests { } @Test("Maps an up-to-next-minor version requirement correctly") - func mapRequirementUpToNextMinor() async throws { + func mapRequirementUpToNextMinor() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -63,7 +63,7 @@ struct XCPackageMapperTests { } @Test("Maps an exact version requirement correctly") - func mapRequirementExact() async throws { + func mapRequirementExact() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -78,7 +78,7 @@ struct XCPackageMapperTests { } @Test("Maps a range version requirement correctly") - func mapRequirementRange() async throws { + func mapRequirementRange() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -93,7 +93,7 @@ struct XCPackageMapperTests { } @Test("Maps a branch-based version requirement correctly") - func mapRequirementBranch() async throws { + func mapRequirementBranch() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -108,7 +108,7 @@ struct XCPackageMapperTests { } @Test("Maps a revision-based version requirement correctly") - func mapRequirementRevision() async throws { + func mapRequirementRevision() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -123,7 +123,7 @@ struct XCPackageMapperTests { } @Test("Maps a missing version requirement to up-to-next-major(0.0.0)") - func mapRequirementNoVersionRequirement() async throws { + func mapRequirementNoVersionRequirement() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "https://github.com/example/package.git", @@ -154,7 +154,7 @@ struct XCPackageMapperTests { } @Test("Throws an error if remote package has no repository URL") - func mapPackageWithoutURL() async throws { + func mapPackageWithoutURL() throws { // Given let package = XCRemoteSwiftPackageReference( repositoryURL: "", diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Phases/PBXFrameworksBuildPhaseMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Phases/PBXFrameworksBuildPhaseMapperTests.swift index ab158951..235af16d 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Phases/PBXFrameworksBuildPhaseMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Phases/PBXFrameworksBuildPhaseMapperTests.swift @@ -2,7 +2,6 @@ import Path import Testing import XcodeGraph import XcodeProj - @testable import XcodeGraphMapper @Suite diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Schemes/XCSchemeMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Schemes/XCSchemeMapperTests.swift index c2ff1308..e2dc0bf0 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Schemes/XCSchemeMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Schemes/XCSchemeMapperTests.swift @@ -3,7 +3,6 @@ import FileSystem import Path import Testing import XcodeGraph - @testable @preconcurrency import XcodeGraphMapper @testable @preconcurrency import XcodeProj diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Settings/ConfigurationMatcherTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Settings/ConfigurationMatcherTests.swift index d1c39fdc..13b94d96 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Settings/ConfigurationMatcherTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Settings/ConfigurationMatcherTests.swift @@ -11,7 +11,7 @@ struct ConfigurationMatcherTests { } @Test("Detects 'Debug' variants from configuration names") - func variantDetectionForDebug() async throws { + func variantDetectionForDebug() { // Given // The configurationMatcher is already set up by the initializer. @@ -27,7 +27,7 @@ struct ConfigurationMatcherTests { } @Test("Detects 'Release' variants from configuration names") - func variantDetectionForRelease() async throws { + func variantDetectionForRelease() { // Given // The configurationMatcher is already set up by the initializer. @@ -43,7 +43,7 @@ struct ConfigurationMatcherTests { } @Test("Falls back to 'Debug' variant for unrecognized configuration names") - func variantFallbackToDebug() async throws { + func variantFallbackToDebug() { // Given // The configurationMatcher is already set up by the initializer. @@ -57,7 +57,7 @@ struct ConfigurationMatcherTests { } @Test("Validates configuration names based on allowed patterns") - func testValidateConfigurationName() async throws { + func testValidateConfigurationName() { // Given // The configurationMatcher is already set up by the initializer. diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift index ee1d3cff..d6e6216f 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift @@ -42,7 +42,7 @@ struct XCConfigurationMapperTests { #expect(configKey?.name == "Debug") #expect(configKey?.variant == .debug) - let debugConfig = try #require(settings.configurations[configKey!]) + let debugConfig = try #require(settings.configurations[try #require(configKey)]) #expect(debugConfig?.settings["PRODUCT_BUNDLE_IDENTIFIER"] == "com.example.debug") } diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Target/PBXTargetMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Target/PBXTargetMapperTests.swift index 29bdec42..2db67458 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Target/PBXTargetMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Target/PBXTargetMapperTests.swift @@ -21,7 +21,7 @@ struct PBXTargetMapperTests: Sendable { buildSettings: ["PRODUCT_BUNDLE_IDENTIFIER": "com.example.app"] ) try xcodeProj.mainPBXProject().targets.append(target) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) // When let mapper = PBXTargetMapper() @@ -323,7 +323,7 @@ struct PBXTargetMapperTests: Sendable { let target = PBXNativeTarget.test() try xcodeProj.mainPBXProject().targets.append(target) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = PBXTargetMapper() @@ -370,7 +370,7 @@ struct PBXTargetMapperTests: Sendable { ] ) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = PBXTargetMapper() // When @@ -400,7 +400,7 @@ struct PBXTargetMapperTests: Sendable { name: "App" ) - try xcodeProj.write(path: xcodeProj.path!) + try xcodeProj.write(path: try #require(xcodeProj.path)) let mapper = PBXTargetMapper() // When @@ -444,7 +444,7 @@ struct PBXTargetMapperTests: Sendable { xcodeProj.pbxproj.add(object: releaseConfig) xcodeProj.pbxproj.add(object: configurationList) - let target = PBXNativeTarget.test( + return PBXNativeTarget.test( name: name, buildConfigurationList: configurationList, buildRules: [], @@ -452,7 +452,5 @@ struct PBXTargetMapperTests: Sendable { dependencies: dependencies, productType: productType ) - - return target } } diff --git a/Tests/XcodeGraphMapperTests/TestData/XCUserData+TestData.swift b/Tests/XcodeGraphMapperTests/TestData/XCUserData+TestData.swift index 863352c5..5270e8c2 100644 --- a/Tests/XcodeGraphMapperTests/TestData/XCUserData+TestData.swift +++ b/Tests/XcodeGraphMapperTests/TestData/XCUserData+TestData.swift @@ -1,6 +1,6 @@ import XcodeProj -// Tests? +/// Tests? extension XCUserData { static func test( userName: String = "user", diff --git a/Tests/XcodeGraphMapperTests/TestData/XCWorkspaceDataGroup+TestData.swift b/Tests/XcodeGraphMapperTests/TestData/XCWorkspaceDataGroup+TestData.swift index 8414f008..d4449993 100644 --- a/Tests/XcodeGraphMapperTests/TestData/XCWorkspaceDataGroup+TestData.swift +++ b/Tests/XcodeGraphMapperTests/TestData/XCWorkspaceDataGroup+TestData.swift @@ -1,7 +1,5 @@ import XcodeProj -import XcodeProj - extension XCWorkspaceDataElement { static func test(name: String, children: [XCWorkspaceDataElement]) -> XCWorkspaceDataElement { .group(XCWorkspaceDataGroup(location: .group(name), name: name, children: children)) diff --git a/Tests/XcodeGraphTests/DependenciesGraph/DependenciesGraphTests.swift b/Tests/XcodeGraphTests/DependenciesGraph/DependenciesGraphTests.swift index 4d1ab496..7371d853 100644 --- a/Tests/XcodeGraphTests/DependenciesGraph/DependenciesGraphTests.swift +++ b/Tests/XcodeGraphTests/DependenciesGraph/DependenciesGraphTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class DependenciesGraphTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Extensions/SettingsDictionary+ExtrasTests.swift b/Tests/XcodeGraphTests/Extensions/SettingsDictionary+ExtrasTests.swift index 32bae6a6..878d6293 100644 --- a/Tests/XcodeGraphTests/Extensions/SettingsDictionary+ExtrasTests.swift +++ b/Tests/XcodeGraphTests/Extensions/SettingsDictionary+ExtrasTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class SettingsDictionaryExtrasTest: XCTestCase { diff --git a/Tests/XcodeGraphTests/Graph/GraphDependencyTests.swift b/Tests/XcodeGraphTests/Graph/GraphDependencyTests.swift index 04b5b9d8..4d410569 100644 --- a/Tests/XcodeGraphTests/Graph/GraphDependencyTests.swift +++ b/Tests/XcodeGraphTests/Graph/GraphDependencyTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class GraphDependencyTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Graph/GraphTargetTests.swift b/Tests/XcodeGraphTests/Graph/GraphTargetTests.swift index 0f44dbe2..e5589421 100644 --- a/Tests/XcodeGraphTests/Graph/GraphTargetTests.swift +++ b/Tests/XcodeGraphTests/Graph/GraphTargetTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class GraphTargetTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Graph/GraphTests.swift b/Tests/XcodeGraphTests/Graph/GraphTests.swift index 7387a348..246c6d33 100644 --- a/Tests/XcodeGraphTests/Graph/GraphTests.swift +++ b/Tests/XcodeGraphTests/Graph/GraphTests.swift @@ -1,13 +1,12 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class GraphTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given - let subject = Graph.test(name: "name", path: try! AbsolutePath(validating: "/path/to")) + let subject = Graph.test(name: "name", path: try AbsolutePath(validating: "/path/to")) // Then XCTAssertCodable(subject) diff --git a/Tests/XcodeGraphTests/Models/AnalyzeActionTests.swift b/Tests/XcodeGraphTests/Models/AnalyzeActionTests.swift index 3cf435b7..64491196 100644 --- a/Tests/XcodeGraphTests/Models/AnalyzeActionTests.swift +++ b/Tests/XcodeGraphTests/Models/AnalyzeActionTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class AnalyzeActionTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/ArchiveActionTests.swift b/Tests/XcodeGraphTests/Models/ArchiveActionTests.swift index 6b9b2455..4c976a9e 100644 --- a/Tests/XcodeGraphTests/Models/ArchiveActionTests.swift +++ b/Tests/XcodeGraphTests/Models/ArchiveActionTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class ArchiveActionTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/ArgumentsTests.swift b/Tests/XcodeGraphTests/Models/ArgumentsTests.swift index b9d0d936..e69c88a9 100644 --- a/Tests/XcodeGraphTests/Models/ArgumentsTests.swift +++ b/Tests/XcodeGraphTests/Models/ArgumentsTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class ArgumentsTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/BuildActionTests.swift b/Tests/XcodeGraphTests/Models/BuildActionTests.swift index c4ace6a6..e72d6bd2 100644 --- a/Tests/XcodeGraphTests/Models/BuildActionTests.swift +++ b/Tests/XcodeGraphTests/Models/BuildActionTests.swift @@ -1,16 +1,15 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class BuildActionTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = BuildAction( targets: [ .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), ], diff --git a/Tests/XcodeGraphTests/Models/BuildConfigurationTests.swift b/Tests/XcodeGraphTests/Models/BuildConfigurationTests.swift index 80263ce0..3a9dfc0f 100644 --- a/Tests/XcodeGraphTests/Models/BuildConfigurationTests.swift +++ b/Tests/XcodeGraphTests/Models/BuildConfigurationTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class BuildConfigurationTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/BuildRule.CompilerSpecTests.swift b/Tests/XcodeGraphTests/Models/BuildRule.CompilerSpecTests.swift index dd7e310c..cf926cd8 100644 --- a/Tests/XcodeGraphTests/Models/BuildRule.CompilerSpecTests.swift +++ b/Tests/XcodeGraphTests/Models/BuildRule.CompilerSpecTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class BuildRuleCompilerSpecTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/BuildRule.FileTypeTests.swift b/Tests/XcodeGraphTests/Models/BuildRule.FileTypeTests.swift index 94e89d1a..68f5ccaf 100644 --- a/Tests/XcodeGraphTests/Models/BuildRule.FileTypeTests.swift +++ b/Tests/XcodeGraphTests/Models/BuildRule.FileTypeTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class BuildRuleFileTypeTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/BuildRuleTests.swift b/Tests/XcodeGraphTests/Models/BuildRuleTests.swift index 382e6639..7c6687cc 100644 --- a/Tests/XcodeGraphTests/Models/BuildRuleTests.swift +++ b/Tests/XcodeGraphTests/Models/BuildRuleTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class BuildRuleTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/CompatibleXcodeVersionsTests.swift b/Tests/XcodeGraphTests/Models/CompatibleXcodeVersionsTests.swift index 2f858248..6276b4a3 100644 --- a/Tests/XcodeGraphTests/Models/CompatibleXcodeVersionsTests.swift +++ b/Tests/XcodeGraphTests/Models/CompatibleXcodeVersionsTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class CompatibleXcodeVersionsTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/CopyFileElementTests.swift b/Tests/XcodeGraphTests/Models/CopyFileElementTests.swift index 16b16746..dffcb9a4 100644 --- a/Tests/XcodeGraphTests/Models/CopyFileElementTests.swift +++ b/Tests/XcodeGraphTests/Models/CopyFileElementTests.swift @@ -1,22 +1,21 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class CopyFileElementTests: XCTestCase { - func test_codable_file() { + func test_codable_file() throws { // Given - let subject = CopyFileElement.file(path: try! AbsolutePath(validating: "/path/to/file"), condition: .when([.macos])) + let subject = CopyFileElement.file(path: try AbsolutePath(validating: "/path/to/file"), condition: .when([.macos])) // Then XCTAssertCodable(subject) } - func test_codable_folderReference() { + func test_codable_folderReference() throws { // Given let subject = CopyFileElement.folderReference( - path: try! AbsolutePath(validating: "/folder/reference"), + path: try AbsolutePath(validating: "/folder/reference"), condition: .when([.macos]) ) diff --git a/Tests/XcodeGraphTests/Models/CopyFilesActionTests.swift b/Tests/XcodeGraphTests/Models/CopyFilesActionTests.swift index 5be1de0c..da10f34e 100644 --- a/Tests/XcodeGraphTests/Models/CopyFilesActionTests.swift +++ b/Tests/XcodeGraphTests/Models/CopyFilesActionTests.swift @@ -1,18 +1,17 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class CopyFilesActionTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = CopyFilesAction( name: "name", destination: .frameworks, subpath: "subpath", files: [ - .file(path: try! AbsolutePath(validating: "/path/to/file")), + .file(path: try AbsolutePath(validating: "/path/to/file")), ] ) diff --git a/Tests/XcodeGraphTests/Models/CoreDataModelTests.swift b/Tests/XcodeGraphTests/Models/CoreDataModelTests.swift index 1a0413e9..6b634778 100644 --- a/Tests/XcodeGraphTests/Models/CoreDataModelTests.swift +++ b/Tests/XcodeGraphTests/Models/CoreDataModelTests.swift @@ -1,16 +1,15 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class CoreDataModelTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = CoreDataModel( - path: try! AbsolutePath(validating: "/path/to/model"), + path: try AbsolutePath(validating: "/path/to/model"), versions: [ - try! AbsolutePath(validating: "/path/to/version"), + try AbsolutePath(validating: "/path/to/version"), ], currentVersion: "1.1.1" ) diff --git a/Tests/XcodeGraphTests/Models/ExecutionActionTests.swift b/Tests/XcodeGraphTests/Models/ExecutionActionTests.swift index 26233755..c12f0490 100644 --- a/Tests/XcodeGraphTests/Models/ExecutionActionTests.swift +++ b/Tests/XcodeGraphTests/Models/ExecutionActionTests.swift @@ -1,17 +1,16 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class ExecutionActionTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = ExecutionAction( title: "title", scriptText: "text", target: .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), shellPath: nil, diff --git a/Tests/XcodeGraphTests/Models/FileElementTests.swift b/Tests/XcodeGraphTests/Models/FileElementTests.swift index 56645a81..3f90d401 100644 --- a/Tests/XcodeGraphTests/Models/FileElementTests.swift +++ b/Tests/XcodeGraphTests/Models/FileElementTests.swift @@ -1,21 +1,20 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class FileElementTests: XCTestCase { - func test_codable_file() { + func test_codable_file() throws { // Given - let subject = FileElement.file(path: try! AbsolutePath(validating: "/path/to/file")) + let subject = FileElement.file(path: try AbsolutePath(validating: "/path/to/file")) // Then XCTAssertCodable(subject) } - func test_codable_folderReference() { + func test_codable_folderReference() throws { // Given - let subject = FileElement.folderReference(path: try! AbsolutePath(validating: "/folder/reference")) + let subject = FileElement.folderReference(path: try AbsolutePath(validating: "/folder/reference")) // Then XCTAssertCodable(subject) diff --git a/Tests/XcodeGraphTests/Models/HeadersTests.swift b/Tests/XcodeGraphTests/Models/HeadersTests.swift index 02fcba37..875fa352 100644 --- a/Tests/XcodeGraphTests/Models/HeadersTests.swift +++ b/Tests/XcodeGraphTests/Models/HeadersTests.swift @@ -1,21 +1,20 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class HeadersTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = Headers( public: [ - try! AbsolutePath(validating: "/path/to/public/header"), + try AbsolutePath(validating: "/path/to/public/header"), ], private: [ - try! AbsolutePath(validating: "/path/to/private/header"), + try AbsolutePath(validating: "/path/to/private/header"), ], project: [ - try! AbsolutePath(validating: "/path/to/project/header"), + try AbsolutePath(validating: "/path/to/project/header"), ] ) diff --git a/Tests/XcodeGraphTests/Models/InfoPlistTests.swift b/Tests/XcodeGraphTests/Models/InfoPlistTests.swift index 7dbcd0d1..6926fe74 100644 --- a/Tests/XcodeGraphTests/Models/InfoPlistTests.swift +++ b/Tests/XcodeGraphTests/Models/InfoPlistTests.swift @@ -1,13 +1,12 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class InfoPlistTests: XCTestCase { - func test_codable_file() { + func test_codable_file() throws { // Given - let subject = InfoPlist.file(path: try! AbsolutePath(validating: "/path/to/file")) + let subject = InfoPlist.file(path: try AbsolutePath(validating: "/path/to/file")) // Then XCTAssertCodable(subject) @@ -25,9 +24,9 @@ final class InfoPlistTests: XCTestCase { XCTAssertCodable(subject) } - func test_path_when_file() { + func test_path_when_file() throws { // Given - let path = try! AbsolutePath(validating: "/path/Info.list") + let path = try AbsolutePath(validating: "/path/Info.list") let subject: InfoPlist = .file(path: path) // Then diff --git a/Tests/XcodeGraphTests/Models/PackageInfoTests.swift b/Tests/XcodeGraphTests/Models/PackageInfoTests.swift index feb412e1..64d58048 100644 --- a/Tests/XcodeGraphTests/Models/PackageInfoTests.swift +++ b/Tests/XcodeGraphTests/Models/PackageInfoTests.swift @@ -1,7 +1,5 @@ import Foundation import Testing -import XcodeGraph - @testable import XcodeGraph struct PackageInfoTests { diff --git a/Tests/XcodeGraphTests/Models/PackageTests.swift b/Tests/XcodeGraphTests/Models/PackageTests.swift index cf09e0f8..e72502dd 100644 --- a/Tests/XcodeGraphTests/Models/PackageTests.swift +++ b/Tests/XcodeGraphTests/Models/PackageTests.swift @@ -1,13 +1,12 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class PackageTests: XCTestCase { - func test_codable_local() { + func test_codable_local() throws { // Given - let subject = Package.local(path: try! AbsolutePath(validating: "/path/to/workspace")) + let subject = Package.local(path: try AbsolutePath(validating: "/path/to/workspace")) // Then XCTAssertCodable(subject) @@ -24,9 +23,9 @@ final class PackageTests: XCTestCase { XCTAssertCodable(subject) } - func test_is_remote_local() { + func test_is_remote_local() throws { // Given - let subject = Package.local(path: try! AbsolutePath(validating: "/path/to/package")) + let subject = Package.local(path: try AbsolutePath(validating: "/path/to/package")) // Then XCTAssertFalse(subject.isRemote) diff --git a/Tests/XcodeGraphTests/Models/PlatformFilterTests.swift b/Tests/XcodeGraphTests/Models/PlatformFilterTests.swift index 6875351f..4d2b28e1 100644 --- a/Tests/XcodeGraphTests/Models/PlatformFilterTests.swift +++ b/Tests/XcodeGraphTests/Models/PlatformFilterTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class PlatformFilterTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/ProfileActionTests.swift b/Tests/XcodeGraphTests/Models/ProfileActionTests.swift index 7f9ad126..8cc98350 100644 --- a/Tests/XcodeGraphTests/Models/ProfileActionTests.swift +++ b/Tests/XcodeGraphTests/Models/ProfileActionTests.swift @@ -1,16 +1,15 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class ProfileActionTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = ProfileAction( configurationName: "name", executable: .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), arguments: .init( diff --git a/Tests/XcodeGraphTests/Models/ProjectGroupTests.swift b/Tests/XcodeGraphTests/Models/ProjectGroupTests.swift index a2868465..5df8b941 100644 --- a/Tests/XcodeGraphTests/Models/ProjectGroupTests.swift +++ b/Tests/XcodeGraphTests/Models/ProjectGroupTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class ProjectGroupTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/RawScriptBuildPhaseTests.swift b/Tests/XcodeGraphTests/Models/RawScriptBuildPhaseTests.swift index e59d454b..4196911b 100644 --- a/Tests/XcodeGraphTests/Models/RawScriptBuildPhaseTests.swift +++ b/Tests/XcodeGraphTests/Models/RawScriptBuildPhaseTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class RawScriptBuildPhaseTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/RequirementTests.swift b/Tests/XcodeGraphTests/Models/RequirementTests.swift index 2a8ee764..b2fa339f 100644 --- a/Tests/XcodeGraphTests/Models/RequirementTests.swift +++ b/Tests/XcodeGraphTests/Models/RequirementTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class RequirementTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/ResourceFileElementTests.swift b/Tests/XcodeGraphTests/Models/ResourceFileElementTests.swift index 0853be8a..f40721dd 100644 --- a/Tests/XcodeGraphTests/Models/ResourceFileElementTests.swift +++ b/Tests/XcodeGraphTests/Models/ResourceFileElementTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class ResourceFileElementTests: XCTestCase { - func test_codable_file() { + func test_codable_file() throws { // Given let subject = ResourceFileElement.file( - path: try! AbsolutePath(validating: "/path/to/element"), + path: try AbsolutePath(validating: "/path/to/element"), tags: [ "tag", ] @@ -18,10 +17,10 @@ final class ResourceFileElementTests: XCTestCase { XCTAssertCodable(subject) } - func test_codable_folderReference() { + func test_codable_folderReference() throws { // Given let subject = ResourceFileElement.folderReference( - path: try! AbsolutePath(validating: "/path/to/folder"), + path: try AbsolutePath(validating: "/path/to/folder"), tags: [ "tag", ] diff --git a/Tests/XcodeGraphTests/Models/ResourceSynthesizerTests.swift b/Tests/XcodeGraphTests/Models/ResourceSynthesizerTests.swift index 9b83a36b..b8afcff1 100644 --- a/Tests/XcodeGraphTests/Models/ResourceSynthesizerTests.swift +++ b/Tests/XcodeGraphTests/Models/ResourceSynthesizerTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class ResourceSynthesizerTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/RunActionTests.swift b/Tests/XcodeGraphTests/Models/RunActionTests.swift index 0b8b3d67..3ac0bd03 100644 --- a/Tests/XcodeGraphTests/Models/RunActionTests.swift +++ b/Tests/XcodeGraphTests/Models/RunActionTests.swift @@ -1,21 +1,20 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class RunActionTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = RunAction( configurationName: "name", attachDebugger: true, - customLLDBInitFile: try! AbsolutePath(validating: "/path/to/project"), + customLLDBInitFile: try AbsolutePath(validating: "/path/to/project"), executable: .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), - filePath: try! AbsolutePath(validating: "/path/to/file"), + filePath: try AbsolutePath(validating: "/path/to/file"), arguments: .init( environmentVariables: [ "key": EnvironmentVariable(value: "value", isEnabled: true), diff --git a/Tests/XcodeGraphTests/Models/SDKSourceTests.swift b/Tests/XcodeGraphTests/Models/SDKSourceTests.swift index 87b96943..485e9451 100644 --- a/Tests/XcodeGraphTests/Models/SDKSourceTests.swift +++ b/Tests/XcodeGraphTests/Models/SDKSourceTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class SDKSourceTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/SchemeTests.swift b/Tests/XcodeGraphTests/Models/SchemeTests.swift index fa0b518b..b155a491 100644 --- a/Tests/XcodeGraphTests/Models/SchemeTests.swift +++ b/Tests/XcodeGraphTests/Models/SchemeTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class SchemeTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/SettingsTests.swift b/Tests/XcodeGraphTests/Models/SettingsTests.swift index 1111301a..333d5ad9 100644 --- a/Tests/XcodeGraphTests/Models/SettingsTests.swift +++ b/Tests/XcodeGraphTests/Models/SettingsTests.swift @@ -12,16 +12,16 @@ final class SettingsTests: XCTestCase { XCTAssertCodable(subject) } - func testXcconfigs() { + func testXcconfigs() throws { // Given let configurations: [BuildConfiguration: Configuration?] = [ BuildConfiguration(name: "D", variant: .debug): Configuration( settings: [:], - xcconfig: try! AbsolutePath(validating: "/D") + xcconfig: try AbsolutePath(validating: "/D") ), .release("C"): nil, - .debug("A"): Configuration(settings: [:], xcconfig: try! AbsolutePath(validating: "/A")), - .release("B"): Configuration(settings: [:], xcconfig: try! AbsolutePath(validating: "/B")), + .debug("A"): Configuration(settings: [:], xcconfig: try AbsolutePath(validating: "/A")), + .release("B"): Configuration(settings: [:], xcconfig: try AbsolutePath(validating: "/B")), ] // When diff --git a/Tests/XcodeGraphTests/Models/SourceFileTests.swift b/Tests/XcodeGraphTests/Models/SourceFileTests.swift index c46b7dbf..62dcfc7b 100644 --- a/Tests/XcodeGraphTests/Models/SourceFileTests.swift +++ b/Tests/XcodeGraphTests/Models/SourceFileTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class SourceFileTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = SourceFile( - path: try! AbsolutePath(validating: "/path/to/file"), + path: try AbsolutePath(validating: "/path/to/file"), compilerFlags: "flag", contentHash: "hash" ) diff --git a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift index e3a070a7..6c9b9524 100644 --- a/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetDependencyTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class TargetDependencyTests: XCTestCase { - func test_codable_framework() { + func test_codable_framework() throws { // Given let subject = TargetDependency.framework( - path: try! AbsolutePath(validating: "/path/to/framework"), + path: try AbsolutePath(validating: "/path/to/framework"), status: .required ) @@ -16,47 +15,47 @@ final class TargetDependencyTests: XCTestCase { XCTAssertCodable(subject) } - func test_codable_project() { + func test_codable_project() throws { // Given - let subject = TargetDependency.project(target: "target", path: try! AbsolutePath(validating: "/path/to/target")) + let subject = TargetDependency.project(target: "target", path: try AbsolutePath(validating: "/path/to/target")) // Then XCTAssertCodable(subject) } - func test_codable_library() { + func test_codable_library() throws { // Given let subject = TargetDependency.library( - path: try! AbsolutePath(validating: "/path/to/library"), - publicHeaders: try! AbsolutePath(validating: "/path/to/publicheaders"), - swiftModuleMap: try! AbsolutePath(validating: "/path/to/swiftModuleMap") + path: try AbsolutePath(validating: "/path/to/library"), + publicHeaders: try AbsolutePath(validating: "/path/to/publicheaders"), + swiftModuleMap: try AbsolutePath(validating: "/path/to/swiftModuleMap") ) // Then XCTAssertCodable(subject) } - func test_filtering() { + func test_filtering() throws { let expected: PlatformCondition? = .when([.macos]) let subjects: [TargetDependency] = [ - .framework(path: try! AbsolutePath(validating: "/"), status: .required, condition: expected), + .framework(path: try AbsolutePath(validating: "/"), status: .required, condition: expected), .library( - path: try! AbsolutePath(validating: "/"), - publicHeaders: try! AbsolutePath(validating: "/"), - swiftModuleMap: try! AbsolutePath(validating: "/"), + path: try AbsolutePath(validating: "/"), + publicHeaders: try AbsolutePath(validating: "/"), + swiftModuleMap: try AbsolutePath(validating: "/"), condition: expected ), .sdk(name: "", status: .required, condition: expected), .package(product: "", type: .plugin, condition: expected), .target(name: "", condition: expected), .xcframework( - path: try! AbsolutePath(validating: "/"), + path: try AbsolutePath(validating: "/"), expectedSignature: nil, status: .required, condition: expected ), - .project(target: "", path: try! AbsolutePath(validating: "/"), condition: expected), + .project(target: "", path: try AbsolutePath(validating: "/"), condition: expected), ] for subject in subjects { diff --git a/Tests/XcodeGraphTests/Models/TargetReferenceTests.swift b/Tests/XcodeGraphTests/Models/TargetReferenceTests.swift index 04310200..dcb897ac 100644 --- a/Tests/XcodeGraphTests/Models/TargetReferenceTests.swift +++ b/Tests/XcodeGraphTests/Models/TargetReferenceTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class TargetReferenceTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = TargetReference( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ) diff --git a/Tests/XcodeGraphTests/Models/TestActionTests.swift b/Tests/XcodeGraphTests/Models/TestActionTests.swift index 8f93f8b1..01242f58 100644 --- a/Tests/XcodeGraphTests/Models/TestActionTests.swift +++ b/Tests/XcodeGraphTests/Models/TestActionTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class TestActionTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/TestPlanTests.swift b/Tests/XcodeGraphTests/Models/TestPlanTests.swift index 49c46193..38ec3608 100644 --- a/Tests/XcodeGraphTests/Models/TestPlanTests.swift +++ b/Tests/XcodeGraphTests/Models/TestPlanTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class TestPlanTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = TestPlan( - path: try! AbsolutePath(validating: "/path/to"), + path: try AbsolutePath(validating: "/path/to"), testTargets: [], isDefault: true ) diff --git a/Tests/XcodeGraphTests/Models/TestableTargetTests.swift b/Tests/XcodeGraphTests/Models/TestableTargetTests.swift index 6e56f7f7..8222f3ec 100644 --- a/Tests/XcodeGraphTests/Models/TestableTargetTests.swift +++ b/Tests/XcodeGraphTests/Models/TestableTargetTests.swift @@ -1,15 +1,14 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class TestableTargetTests: XCTestCase { - func test_codable_with_deprecated_parallelizable() { + func test_codable_with_deprecated_parallelizable() throws { // Given let subject = TestableTarget.test( target: .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), skipped: true, @@ -21,11 +20,11 @@ final class TestableTargetTests: XCTestCase { XCTAssertCodable(subject) } - func test_codable() { + func test_codable() throws { // Given let subject = TestableTarget( target: .init( - projectPath: try! AbsolutePath(validating: "/path/to/project"), + projectPath: try AbsolutePath(validating: "/path/to/project"), name: "name" ), skipped: true, diff --git a/Tests/XcodeGraphTests/Models/WorkspaceGenerationOptionsTests.swift b/Tests/XcodeGraphTests/Models/WorkspaceGenerationOptionsTests.swift index 25ea1ca6..187802cc 100644 --- a/Tests/XcodeGraphTests/Models/WorkspaceGenerationOptionsTests.swift +++ b/Tests/XcodeGraphTests/Models/WorkspaceGenerationOptionsTests.swift @@ -1,6 +1,5 @@ import Foundation import XCTest - @testable import XcodeGraph final class WorkspaceGenerationOptionsTests: XCTestCase { diff --git a/Tests/XcodeGraphTests/Models/WorkspaceTests.swift b/Tests/XcodeGraphTests/Models/WorkspaceTests.swift index a7540e94..f104de8c 100644 --- a/Tests/XcodeGraphTests/Models/WorkspaceTests.swift +++ b/Tests/XcodeGraphTests/Models/WorkspaceTests.swift @@ -1,14 +1,13 @@ import Foundation import Path import XCTest - @testable import XcodeGraph final class WorkspaceTests: XCTestCase { - func test_codable() { + func test_codable() throws { // Given let subject = Workspace.test( - path: try! AbsolutePath(validating: "/path/to/workspace"), + path: try AbsolutePath(validating: "/path/to/workspace"), name: "name" ) diff --git a/Tests/XcodeGraphTests/Models/XCFrameworkInfoPlistTests.swift b/Tests/XcodeGraphTests/Models/XCFrameworkInfoPlistTests.swift index e786141f..0dad6326 100644 --- a/Tests/XcodeGraphTests/Models/XCFrameworkInfoPlistTests.swift +++ b/Tests/XcodeGraphTests/Models/XCFrameworkInfoPlistTests.swift @@ -4,7 +4,7 @@ import XCTest @testable import XcodeGraph final class XCFrameworkInfoPlistTests: XCTestCase { - func test_codable() throws { + func test_codable() { // Given let subject: XCFrameworkInfoPlist = .test() From 9980e29731e05b4d59e8d17bb546762b4d0f9917 Mon Sep 17 00:00:00 2001 From: fortmarek Date: Fri, 13 Feb 2026 16:04:32 +0100 Subject: [PATCH 7/7] fix: avoid nested #require macro to fix recursive expansion on Linux Co-Authored-By: Claude Opus 4.6 --- .../Settings/XCConfigurationMapperTests.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift b/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift index d6e6216f..3af80b78 100644 --- a/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift +++ b/Tests/XcodeGraphMapperTests/MapperTests/Settings/XCConfigurationMapperTests.swift @@ -37,12 +37,11 @@ struct XCConfigurationMapperTests { // Then #expect(settings.configurations.count == 1) - let configKey = settings.configurations.keys.first - try #require(configKey != nil) - #expect(configKey?.name == "Debug") - #expect(configKey?.variant == .debug) + let configKey = try #require(settings.configurations.keys.first) + #expect(configKey.name == "Debug") + #expect(configKey.variant == .debug) - let debugConfig = try #require(settings.configurations[try #require(configKey)]) + let debugConfig = try #require(settings.configurations[configKey]) #expect(debugConfig?.settings["PRODUCT_BUNDLE_IDENTIFIER"] == "com.example.debug") }