Skip to content

Commit c493b32

Browse files
authored
Add 'macro' product type to package collection model (#6199)
1 parent 91fa9c9 commit c493b32

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ extension PackageModel.ProductType {
417417
self = .snippet
418418
case .test:
419419
self = .test
420+
case .macro:
421+
self = .macro
420422
}
421423
}
422424
}

Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,15 @@ extension PackageCollectionModel.V1 {
340340

341341
/// A test product.
342342
case test
343+
344+
/// A macro product.
345+
case `macro`
343346
}
344347
}
345348

346349
extension PackageCollectionModel.V1.ProductType: Codable {
347350
private enum CodingKeys: String, CodingKey {
348-
case library, executable, plugin, snippet, test
351+
case library, executable, plugin, snippet, test, `macro`
349352
}
350353

351354
public func encode(to encoder: Encoder) throws {
@@ -362,6 +365,8 @@ extension PackageCollectionModel.V1.ProductType: Codable {
362365
try container.encodeNil(forKey: .snippet)
363366
case .test:
364367
try container.encodeNil(forKey: .test)
368+
case .macro:
369+
try container.encodeNil(forKey: .macro)
365370
}
366371
}
367372

@@ -383,6 +388,8 @@ extension PackageCollectionModel.V1.ProductType: Codable {
383388
self = .snippet
384389
case .test:
385390
self = .test
391+
case .macro:
392+
self = .macro
386393
}
387394
}
388395
}

0 commit comments

Comments
 (0)