@@ -26,11 +26,13 @@ struct PBXTargetMapperTests: Sendable {
2626 // When
2727 let mapper = PBXTargetMapper ( )
2828
29- let mapped = try await mapper. map (
30- pbxTarget: target,
31- xcodeProj: xcodeProj,
32- projectNativeTargets: [ : ] ,
33- packages: [ ]
29+ let mapped = try #require(
30+ try await mapper. map (
31+ pbxTarget: target,
32+ xcodeProj: xcodeProj,
33+ projectNativeTargets: [ : ] ,
34+ packages: [ ]
35+ )
3436 )
3537
3638 // Then
@@ -54,11 +56,13 @@ struct PBXTargetMapperTests: Sendable {
5456 let mapper = PBXTargetMapper ( )
5557
5658 // When
57- let mapped = try await mapper. map (
58- pbxTarget: target,
59- xcodeProj: xcodeProj,
60- projectNativeTargets: [ : ] ,
61- packages: [ ]
59+ let mapped = try #require(
60+ try await mapper. map (
61+ pbxTarget: target,
62+ xcodeProj: xcodeProj,
63+ projectNativeTargets: [ : ] ,
64+ packages: [ ]
65+ )
6266 )
6367
6468 // Then
@@ -81,11 +85,13 @@ struct PBXTargetMapperTests: Sendable {
8185 let mapper = PBXTargetMapper ( )
8286
8387 // When
84- let mapped = try await mapper. map (
85- pbxTarget: target,
86- xcodeProj: xcodeProj,
87- projectNativeTargets: [ : ] ,
88- packages: [ ]
88+ let mapped = try #require(
89+ try await mapper. map (
90+ pbxTarget: target,
91+ xcodeProj: xcodeProj,
92+ projectNativeTargets: [ : ] ,
93+ packages: [ ]
94+ )
8995 )
9096
9197 // Then
@@ -110,11 +116,13 @@ struct PBXTargetMapperTests: Sendable {
110116 let mapper = PBXTargetMapper ( )
111117
112118 // When
113- let mapped = try await mapper. map (
114- pbxTarget: target,
115- xcodeProj: xcodeProj,
116- projectNativeTargets: [ : ] ,
117- packages: [ ]
119+ let mapped = try #require(
120+ try await mapper. map (
121+ pbxTarget: target,
122+ xcodeProj: xcodeProj,
123+ projectNativeTargets: [ : ] ,
124+ packages: [ ]
125+ )
118126 )
119127
120128 // Then
@@ -151,11 +159,13 @@ struct PBXTargetMapperTests: Sendable {
151159 let mapper = PBXTargetMapper ( )
152160
153161 // When
154- let mapped = try await mapper. map (
155- pbxTarget: target,
156- xcodeProj: xcodeProj,
157- projectNativeTargets: [ : ] ,
158- packages: [ ]
162+ let mapped = try #require(
163+ try await mapper. map (
164+ pbxTarget: target,
165+ xcodeProj: xcodeProj,
166+ projectNativeTargets: [ : ] ,
167+ packages: [ ]
168+ )
159169 )
160170
161171 // Then
@@ -243,13 +253,15 @@ struct PBXTargetMapperTests: Sendable {
243253 )
244254
245255 // When
246- let mapped = try await mapper. map (
247- pbxTarget: target,
248- xcodeProj: xcodeProj,
249- projectNativeTargets: [ : ] ,
250- packages: [
251- packagePath,
252- ]
256+ let mapped = try #require(
257+ try await mapper. map (
258+ pbxTarget: target,
259+ xcodeProj: xcodeProj,
260+ projectNativeTargets: [ : ] ,
261+ packages: [
262+ packagePath,
263+ ]
264+ )
253265 )
254266
255267 // Then
@@ -331,7 +343,7 @@ struct PBXTargetMapperTests: Sendable {
331343 )
332344
333345 // Then
334- #expect( mapped. metadata. tags == Set ( [ " tag1 " , " tag2 " , " tag3 " ] ) )
346+ #expect( mapped? . metadata. tags == Set ( [ " tag1 " , " tag2 " , " tag3 " ] ) )
335347 }
336348
337349 @Test ( " Maps entitlements when CODE_SIGN_ENTITLEMENTS is set " )
@@ -389,7 +401,7 @@ struct PBXTargetMapperTests: Sendable {
389401 )
390402
391403 // Then
392- #expect( mapped. entitlements == . file(
404+ #expect( mapped? . entitlements == . file(
393405 path: entitlementsPath,
394406 configuration: BuildConfiguration ( name: " Debug " , variant: . debug)
395407 ) )
@@ -462,7 +474,7 @@ struct PBXTargetMapperTests: Sendable {
462474
463475 // Then
464476 #expect( {
465- switch mapped. infoPlist {
477+ switch mapped? . infoPlist {
466478 case let . file( path, _) :
467479 return path == plistPath
468480 default :
@@ -471,6 +483,29 @@ struct PBXTargetMapperTests: Sendable {
471483 } ( ) == true )
472484 }
473485
486+ @Test
487+ func testMapAggregateTarget( ) async throws {
488+ // Given
489+ let xcodeProj = try await XcodeProj . test ( )
490+ let target = PBXAggregateTarget (
491+ name: " App "
492+ )
493+
494+ try xcodeProj. write ( path: xcodeProj. path!)
495+ let mapper = PBXTargetMapper ( )
496+
497+ // When
498+ let mapped = try await mapper. map (
499+ pbxTarget: target,
500+ xcodeProj: xcodeProj,
501+ projectNativeTargets: [ : ] ,
502+ packages: [ ]
503+ )
504+
505+ // Then
506+ #expect( mapped == nil )
507+ }
508+
474509 // MARK: - Helper Methods
475510
476511 private func createTarget(
0 commit comments