File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -346,16 +346,21 @@ + (NSString *)stringRepresentationOfBuildSettings:(NSDictionary *)buildSettings
346346 }
347347
348348 BOOL firstKey = YES ;
349+ NSString *previousKey = nil ;
349350 for (NSString *key in sortedKeys) {
350351 id value = buildSettings[key];
352+
353+ // If same base setting name as previous key, this is a conditional build setting.
354+ // Don't put newlines between them and don't repeat the build setting info comment.
355+ BOOL sameBaseSettingName = [previousKey tps_baseBuildSettingNameIsEqualTo: key]; // nil previousKey returns nil aka NO
351356
352- if (!firstKey){
357+ if (!firstKey && !sameBaseSettingName ){
353358 for (NSInteger i = 0 ; i < linesBetweenSettings; i++) {
354359 [string appendString: @" \n " ];
355360 }
356361 }
357362
358- if (includeBuildSettingInfoComments) {
363+ if (includeBuildSettingInfoComments && !sameBaseSettingName ) {
359364 NSString *comment = [buildSettingCommentGenerator commentForBuildSettingWithName: key];
360365 [string appendString: comment];
361366 }
@@ -376,6 +381,7 @@ + (NSString *)stringRepresentationOfBuildSettings:(NSDictionary *)buildSettings
376381 [NSException raise: @" Should not get here!" format: @" Unexpected class: %@ in %s " , [value class ], __PRETTY_FUNCTION__];
377382 }
378383
384+ previousKey = key;
379385 firstKey = NO ;
380386 }
381387
You can’t perform that action at this time.
0 commit comments