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

Commit 6b3571d

Browse files
authored
feat: add mapping of local packages (#116)
* feat: add mapping of local packages * Add missing XcodeGraph dependency in XcodeMetadata
1 parent ce94b77 commit 6b3571d

18 files changed

Lines changed: 1738 additions & 40 deletions

File tree

Package.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ let targets: [Target] = [
1919
.product(name: "FileSystem", package: "FileSystem"),
2020
.product(name: "Mockable", package: "Mockable"),
2121
.product(name: "MachOKitC", package: "MachOKit"),
22+
"XcodeGraph",
2223
],
2324
swiftSettings: [
2425
.enableExperimentalFeature("StrictConcurrency"),
@@ -43,6 +44,7 @@ let targets: [Target] = [
4344
],
4445
swiftSettings: [
4546
.enableExperimentalFeature("StrictConcurrency"),
47+
.define("MOCKING", .when(configuration: .debug)),
4648
]
4749
),
4850
.testTarget(
@@ -60,6 +62,7 @@ let targets: [Target] = [
6062
],
6163
swiftSettings: [
6264
.enableExperimentalFeature("StrictConcurrency"),
65+
.define("MOCKING", .when(configuration: .debug)),
6366
]
6467
),
6568
]

Sources/XcodeGraph/Models/Target.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
6262
public let onDemandResourcesTags: OnDemandResourcesTags?
6363
public let metadata: TargetMetadata
6464
public let type: TargetType
65+
/// Package directories
66+
public let packages: [AbsolutePath]
6567

6668
// MARK: - Init
6769

@@ -94,7 +96,8 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
9496
mergeable: Bool = false,
9597
onDemandResourcesTags: OnDemandResourcesTags? = nil,
9698
metadata: TargetMetadata = .metadata(tags: []),
97-
type: TargetType = .local
99+
type: TargetType = .local,
100+
packages: [AbsolutePath] = []
98101
) {
99102
self.name = name
100103
self.product = product
@@ -125,6 +128,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
125128
self.onDemandResourcesTags = onDemandResourcesTags
126129
self.metadata = metadata
127130
self.type = type
131+
self.packages = packages
128132
}
129133

130134
/// Given a target name, it obtains the product name by turning "-" characters into "_" and "/" into "_"

Sources/XcodeGraph/Models/Version.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public struct Version: Hashable, Codable, Sendable {
3939
public var xcodeStringValue: String {
4040
"\(major)\(minor)\(patch)"
4141
}
42+
43+
public func encode(to encoder: any Encoder) throws {
44+
var container = encoder.singleValueContainer()
45+
try container.encode(description)
46+
}
4247
}
4348

4449
extension Version: Comparable {

0 commit comments

Comments
 (0)