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

Commit 7c326d6

Browse files
committed
feat: add mapping of local packages
1 parent bd558c6 commit 7c326d6

18 files changed

Lines changed: 1737 additions & 40 deletions

File tree

Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ let targets: [Target] = [
4343
],
4444
swiftSettings: [
4545
.enableExperimentalFeature("StrictConcurrency"),
46+
.define("MOCKING", .when(configuration: .debug)),
4647
]
4748
),
4849
.testTarget(
@@ -60,6 +61,7 @@ let targets: [Target] = [
6061
],
6162
swiftSettings: [
6263
.enableExperimentalFeature("StrictConcurrency"),
64+
.define("MOCKING", .when(configuration: .debug)),
6365
]
6466
),
6567
]

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)