@@ -123,6 +123,11 @@ class PIFTests: XCTestCase {
123
123
var settings = PIF . BuildSettings ( )
124
124
settings [ . TARGET_NAME] = " MyLibrary-Debug "
125
125
return settings
126
+ } ( ) ,
127
+ impartedBuildProperties: {
128
+ var settings = PIF . BuildSettings ( )
129
+ settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
130
+ return PIF . ImpartedBuildProperties ( settings: settings)
126
131
} ( )
127
132
) ,
128
133
PIF . BuildConfiguration (
@@ -132,6 +137,11 @@ class PIFTests: XCTestCase {
132
137
var settings = PIF . BuildSettings ( )
133
138
settings [ . TARGET_NAME] = " MyLibrary "
134
139
return settings
140
+ } ( ) ,
141
+ impartedBuildProperties: {
142
+ var settings = PIF . BuildSettings ( )
143
+ settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
144
+ return PIF . ImpartedBuildProperties ( settings: settings)
135
145
} ( )
136
146
) ,
137
147
] ,
@@ -148,11 +158,7 @@ class PIFTests: XCTestCase {
148
158
)
149
159
] ,
150
160
dependencies: [ ] ,
151
- impartedBuildSettings: {
152
- var settings = PIF . BuildSettings ( )
153
- settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
154
- return settings
155
- } ( )
161
+ impartedBuildSettings: PIF . BuildSettings ( )
156
162
) ,
157
163
PIF . AggregateTarget (
158
164
guid: " aggregate-target-guid " ,
@@ -161,24 +167,30 @@ class PIFTests: XCTestCase {
161
167
PIF . BuildConfiguration (
162
168
guid: " aggregate-target-config-debug-guid " ,
163
169
name: " Debug " ,
164
- buildSettings: PIF . BuildSettings ( )
170
+ buildSettings: PIF . BuildSettings ( ) ,
171
+ impartedBuildProperties: {
172
+ var settings = PIF . BuildSettings ( )
173
+ settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
174
+ return PIF . ImpartedBuildProperties ( settings: settings)
175
+ } ( )
165
176
) ,
166
177
PIF . BuildConfiguration (
167
178
guid: " aggregate-target-config-release-guid " ,
168
179
name: " Release " ,
169
- buildSettings: PIF . BuildSettings ( )
180
+ buildSettings: PIF . BuildSettings ( ) ,
181
+ impartedBuildProperties: {
182
+ var settings = PIF . BuildSettings ( )
183
+ settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
184
+ return PIF . ImpartedBuildProperties ( settings: settings)
185
+ } ( )
170
186
) ,
171
187
] ,
172
188
buildPhases: [ ] ,
173
189
dependencies: [
174
190
. init( targetGUID: " target-lib-guid " ) ,
175
191
. init( targetGUID: " target-exe-guid " ) ,
176
192
] ,
177
- impartedBuildSettings: {
178
- var settings = PIF . BuildSettings ( )
179
- settings [ . OTHER_CFLAGS] = [ " -fmodule-map-file=modulemap " , " $(inherited) " ]
180
- return settings
181
- } ( )
193
+ impartedBuildSettings: PIF . BuildSettings ( )
182
194
)
183
195
] ,
184
196
groupTree: PIF . Group ( guid: " main-group-guid " , path: " " , children: [
@@ -331,7 +343,6 @@ class PIFTests: XCTestCase {
331
343
XCTAssertEqual ( exeTargetContents [ " type " ] ? . string, " standard " )
332
344
XCTAssertEqual ( exeTargetContents [ " productTypeIdentifier " ] ? . string, " com.apple.product-type.tool " )
333
345
XCTAssertEqual ( exeTargetContents [ " buildRules " ] ? . array, [ ] )
334
- XCTAssertEqual ( exeTargetContents [ " impartedBuildProperties " ] ? . dictionary, [ " buildSettings " : JSON ( [ : ] ) ] )
335
346
336
347
XCTAssertEqual ( exeTargetContents [ " productReference " ] , JSON ( [
337
348
" type " : " file " ,
@@ -346,6 +357,7 @@ class PIFTests: XCTestCase {
346
357
let debugSettings = debugConfiguration [ " buildSettings " ]
347
358
XCTAssertEqual ( debugSettings ? [ " TARGET_NAME " ] ? . string, " MyExecutable " )
348
359
XCTAssertEqual ( debugSettings ? [ " EXECUTABLE_NAME " ] ? . string, " my-exe " )
360
+ XCTAssertEqual ( debugConfiguration [ " impartedBuildProperties " ] ? . dictionary, [ " buildSettings " : JSON ( [ : ] ) ] )
349
361
350
362
let releaseConfiguration = configurations [ 1 ]
351
363
XCTAssertEqual ( releaseConfiguration [ " guid " ] ? . string, " target-exe-config-release-guid " )
@@ -354,6 +366,7 @@ class PIFTests: XCTestCase {
354
366
XCTAssertEqual ( releaseSettings ? [ " TARGET_NAME " ] ? . string, " MyExecutable " )
355
367
XCTAssertEqual ( releaseSettings ? [ " EXECUTABLE_NAME " ] ? . string, " my-exe " )
356
368
XCTAssertEqual ( releaseSettings ? [ " SKIP_INSTALL " ] ? . string, " NO " )
369
+ XCTAssertEqual ( releaseConfiguration [ " impartedBuildProperties " ] ? . dictionary, [ " buildSettings " : JSON ( [ : ] ) ] )
357
370
} else {
358
371
XCTFail ( " invalid number of build configurations " )
359
372
}
@@ -396,23 +409,26 @@ class PIFTests: XCTestCase {
396
409
" name " : " MyLibrary "
397
410
] ) )
398
411
399
- XCTAssertEqual (
400
- libTargetContents [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
401
- [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
402
- )
403
-
404
412
if let configurations = libTargetContents [ " buildConfigurations " ] ? . array, configurations. count == 2 {
405
413
let debugConfiguration = configurations [ 0 ]
406
414
XCTAssertEqual ( debugConfiguration [ " guid " ] ? . string, " target-lib-config-debug-guid " )
407
415
XCTAssertEqual ( debugConfiguration [ " name " ] ? . string, " Debug " )
408
416
let debugSettings = debugConfiguration [ " buildSettings " ]
409
417
XCTAssertEqual ( debugSettings ? [ " TARGET_NAME " ] ? . string, " MyLibrary-Debug " )
418
+ XCTAssertEqual (
419
+ debugConfiguration [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
420
+ [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
421
+ )
410
422
411
423
let releaseConfiguration = configurations [ 1 ]
412
424
XCTAssertEqual ( releaseConfiguration [ " guid " ] ? . string, " target-lib-config-release-guid " )
413
425
XCTAssertEqual ( releaseConfiguration [ " name " ] ? . string, " Release " )
414
426
let releaseSettings = releaseConfiguration [ " buildSettings " ]
415
427
XCTAssertEqual ( releaseSettings ? [ " TARGET_NAME " ] ? . string, " MyLibrary " )
428
+ XCTAssertEqual (
429
+ releaseConfiguration [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
430
+ [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
431
+ )
416
432
} else {
417
433
XCTFail ( " invalid number of build configurations " )
418
434
}
@@ -441,23 +457,26 @@ class PIFTests: XCTestCase {
441
457
] )
442
458
XCTAssertEqual ( aggregateTargetContents [ " buildRules " ] , nil )
443
459
444
- XCTAssertEqual (
445
- aggregateTargetContents [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
446
- [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
447
- )
448
-
449
460
if let configurations = aggregateTargetContents [ " buildConfigurations " ] ? . array, configurations. count == 2 {
450
461
let debugConfiguration = configurations [ 0 ]
451
462
XCTAssertEqual ( debugConfiguration [ " guid " ] ? . string, " aggregate-target-config-debug-guid " )
452
463
XCTAssertEqual ( debugConfiguration [ " name " ] ? . string, " Debug " )
453
464
let debugSettings = debugConfiguration [ " buildSettings " ]
454
465
XCTAssertNotNil ( debugSettings)
466
+ XCTAssertEqual (
467
+ debugConfiguration [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
468
+ [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
469
+ )
455
470
456
471
let releaseConfiguration = configurations [ 1 ]
457
472
XCTAssertEqual ( releaseConfiguration [ " guid " ] ? . string, " aggregate-target-config-release-guid " )
458
473
XCTAssertEqual ( releaseConfiguration [ " name " ] ? . string, " Release " )
459
474
let releaseSettings = releaseConfiguration [ " buildSettings " ]
460
475
XCTAssertNotNil ( releaseSettings)
476
+ XCTAssertEqual (
477
+ releaseConfiguration [ " impartedBuildProperties " ] ? [ " buildSettings " ] ? [ " OTHER_CFLAGS " ] ? . array,
478
+ [ . string( " -fmodule-map-file=modulemap " ) , . string( " $(inherited) " ) ]
479
+ )
461
480
} else {
462
481
XCTFail ( " invalid number of build configurations " )
463
482
}
0 commit comments