Skip to content

Commit 2343d94

Browse files
Add some space before first build setting when comments are not generated
1 parent ea4f3dc commit 2343d94

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

BuildSettingExtractor/BuildSettingExtractor.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,18 @@ - (NSString *)stringRepresentationOfBuildSettings:(NSDictionary *)buildSettings
177177
// Sort build settings by name for easier reading and testing. Case insensitive compare should stay stable regardess of locale.
178178
NSArray *sortedKeys = [[buildSettings allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
179179

180+
BOOL firstKey = YES;
180181
for (NSString *key in sortedKeys) {
181182
id value = buildSettings[key];
182183

183184
if (self.includeBuildSettingInfoComments) {
184185
NSString *comment = [self.buildSettingInfoSource commentForBuildSettingWithName:key];
185186
[string appendString:comment];
187+
} else {
188+
if (firstKey) {
189+
[string appendString:@"\n\n"]; // Tack on some space before first setting, if there are no info comments
190+
firstKey = NO;
191+
}
186192
}
187193

188194
if ([value isKindOfClass:[NSString class]]) {

0 commit comments

Comments
 (0)