Skip to content

Commit b2c3a5c

Browse files
A few default file name string tweaks
Rename class methods to better match Cocoa API conventions Call [self class] instead of class name in case a subclass ever happens.
1 parent 06ac5d1 commit b2c3a5c

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification {
154154
NSDictionary *defaults = @{
155155
TPSOpenDirectoryInFinder:@(YES),
156156
TPSIncludeBuildSettingInfoComments:@(YES),
157-
TPSOutputFileNameShared:BuildSettingExtractor.sharedConfigNameDefault,
158-
TPSOutputFileNameProject:BuildSettingExtractor.projectConfigNameDefault,
159-
TPSOutputFileNameSeparator:BuildSettingExtractor.nameSeparatorDefault,
157+
TPSOutputFileNameShared:BuildSettingExtractor.defaultSharedConfigName,
158+
TPSOutputFileNameProject:BuildSettingExtractor.defaultProjectConfigName,
159+
TPSOutputFileNameSeparator:BuildSettingExtractor.defaultNameSeparator,
160160
};
161161
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
162162
}

BuildSettingExtractor/BuildSettingExtractor.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,35 @@
1111

1212
@interface BuildSettingExtractor : NSObject
1313

14+
/* The generated file names take the form '<ProjectOrTargetName><separator><BuildConfigurationName>.xcconfig'
15+
16+
For the <ProjectOrTargetName> piece:
17+
Target build setting files use the name of the target.
18+
Project build setting files use the value of -projectConfigName.
19+
20+
For the <BuildConfigurationName> piece:
21+
Files containing the settings unique to a Build Configuration use the name of the build configuration.
22+
Files containing settings common to all build configurations for a target use the value of -sharedConfigName.
23+
24+
For the <separator> piece:
25+
The separator used is the value of -nameSeparator.
26+
*/
27+
28+
// The default values for naming of generated files. Potentially useful to register as defaults in an app.
29+
+ (NSString *)defaultSharedConfigName; // "Shared" is the default.
30+
+ (NSString *)defaultProjectConfigName; // "Project" is the default.
31+
+ (NSString *)defaultNameSeparator; // "-" (hyphen) is the default.
32+
33+
1434
// The name that will be used to name common / shared config files.
1535
@property (copy) NSString *sharedConfigName;
16-
// "Shared" is the default.
17-
+ (NSString *)sharedConfigNameDefault;
1836

1937
// The name that will be used to name the project configuration.
2038
@property (copy) NSString *projectConfigName;
21-
// "Project" is the default.
22-
+ (NSString *)projectConfigNameDefault;
2339

2440
// The string that will separate filename components.
2541
@property (copy) NSString *nameSeparator;
26-
// "-" hyphen-case is the default.
27-
+ (NSString *)nameSeparatorDefault;
42+
2843

2944
// Should each build setting be commented with title and description, if available.
3045
@property (assign) BOOL includeBuildSettingInfoComments;

BuildSettingExtractor/BuildSettingExtractor.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ @interface BuildSettingExtractor ()
2121

2222
@implementation BuildSettingExtractor
2323

24-
+ (NSString *)sharedConfigNameDefault {
24+
+ (NSString *)defaultSharedConfigName {
2525
return @"Shared";
2626
}
2727

28-
+ (NSString *)projectConfigNameDefault {
28+
+ (NSString *)defaultProjectConfigName {
2929
return @"Project";
3030
}
3131

32-
+ (NSString *)nameSeparatorDefault {
32+
+ (NSString *)defaultNameSeparator {
3333
return @"-";
3434
}
3535

3636
- (instancetype)init {
3737
self = [super init];
3838
if (self) {
39-
_sharedConfigName = BuildSettingExtractor.sharedConfigNameDefault;
40-
_projectConfigName = BuildSettingExtractor.projectConfigNameDefault;
41-
_nameSeparator = BuildSettingExtractor.nameSeparatorDefault;
39+
_sharedConfigName = [[self class] defaultSharedConfigName];
40+
_projectConfigName = [[self class] defaultProjectConfigName];
41+
_nameSeparator = [[self class] defaultNameSeparator];
4242
_buildSettingsByTarget = [[NSMutableDictionary alloc] init];
4343
_buildSettingInfoSource = [[BuildSettingInfoSource alloc] init];
4444
}

0 commit comments

Comments
 (0)