Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let targets: [Target] = [
.product(name: "FileSystem", package: "FileSystem"),
.product(name: "Mockable", package: "Mockable"),
.product(name: "MachOKitC", package: "MachOKit"),
"XcodeGraph",
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
Expand All @@ -43,6 +44,7 @@ let targets: [Target] = [
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
.define("MOCKING", .when(configuration: .debug)),
]
),
.testTarget(
Expand All @@ -60,6 +62,7 @@ let targets: [Target] = [
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
.define("MOCKING", .when(configuration: .debug)),
]
),
]
Expand Down
6 changes: 5 additions & 1 deletion Sources/XcodeGraph/Models/Target.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
public let onDemandResourcesTags: OnDemandResourcesTags?
public let metadata: TargetMetadata
public let type: TargetType
/// Package directories
public let packages: [AbsolutePath]

// MARK: - Init

Expand Down Expand Up @@ -94,7 +96,8 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
mergeable: Bool = false,
onDemandResourcesTags: OnDemandResourcesTags? = nil,
metadata: TargetMetadata = .metadata(tags: []),
type: TargetType = .local
type: TargetType = .local,
packages: [AbsolutePath] = []
) {
self.name = name
self.product = product
Expand Down Expand Up @@ -125,6 +128,7 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable {
self.onDemandResourcesTags = onDemandResourcesTags
self.metadata = metadata
self.type = type
self.packages = packages
}

/// Given a target name, it obtains the product name by turning "-" characters into "_" and "/" into "_"
Expand Down
5 changes: 5 additions & 0 deletions Sources/XcodeGraph/Models/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public struct Version: Hashable, Codable, Sendable {
public var xcodeStringValue: String {
"\(major)\(minor)\(patch)"
}

public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(description)
}
}

extension Version: Comparable {
Expand Down
Loading