Skip to content

Commit 04dea45

Browse files
Trim whitespace and newlines from generated files
Change use of term 'common' to 'shared'
1 parent 8ae0b1f commit 04dea45

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

BuildSettingExtractor/BuildSettingExtractor.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,19 @@ - (void)extractBuildSettingsFromProject:(NSURL *)projectWrapperURL toDestination
100100
*/
101101
- (void)writeConfigFilesToDestinationFolder:(NSURL *)destinationURL {
102102

103-
NSString *commonConfigName = self.sharedConfigName;
104-
105103
[self.buildSettingsByTarget enumerateKeysAndObjectsUsingBlock:^(id targetName, id obj, BOOL *stop) {
106104
[obj enumerateKeysAndObjectsUsingBlock:^(id configName, id settings, BOOL *stop) {
107105

108-
// If the config name is not the common config, we need to import the common config
109-
if (![configName isEqualToString:commonConfigName]) {
110-
NSString *configFilename = [self configFilenameWithTargetName:targetName configName:commonConfigName];
106+
// If the config name is not the shared config, we need to import the shared config
107+
if (![configName isEqualToString:self.sharedConfigName]) {
108+
NSString *configFilename = [self configFilenameWithTargetName:targetName configName:self.sharedConfigName];
111109
NSString *includeDirective = [NSString stringWithFormat:@"#include \"%@\"\n\n", configFilename];
112110
settings = [includeDirective stringByAppendingString:settings];
113111
}
114112

113+
// Trim whitespace and newlines
114+
settings = [settings stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
115+
115116
NSString *filename = [self configFilenameWithTargetName:targetName configName:configName];
116117

117118
NSURL *fileURL = [destinationURL URLByAppendingPathComponent:filename];

0 commit comments

Comments
 (0)