Skip to content

Commit

Permalink
Preliminary support for target dependency condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrottmann committed Jun 15, 2023
1 parent 1c9b5f7 commit 5176490
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ extension IntermediatePackageSwiftFile.Target.Dependency {

private enum ProductComponent: Decodable {
case string(String)
case condition(Condition)
case null

init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let str = try? container.decode(String.self) {
self = .string(str)
} else if let condition = try? container.decode(Condition.self) {
self = .condition(condition)
} else if container.decodeNil() {
self = .null
} else {
Expand All @@ -111,3 +114,9 @@ extension IntermediatePackageSwiftFile.Target.Dependency {
}
}
}

extension IntermediatePackageSwiftFile.Target.Dependency {
struct Condition: Decodable {
let platformNames: [String]
}
}

0 comments on commit 5176490

Please sign in to comment.