Skip to content

Commit c35a2e0

Browse files
committed
update for today's Xcode 13.2.1
Use recommended project settings in Xcode as automatically performed. use angle brackets <> for included header files in public headers Replaced every heavy NSLog by **if ( DEBUG ) printf( ...** so the output remains readable.
1 parent f3234db commit c35a2e0

32 files changed

+2810
-143
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ xcuserdata
66
.DS_Store
77
build
88
.build
9+
doc
10+

Doxyfile

+2,658
Large diffs are not rendered by default.

Source/Include/XCBuildFile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "XcodeMemberType.h"
10+
#import <XcodeEditor/XcodeMemberType.h>
1111

1212
@protocol XCBuildFile <NSObject>
1313

Source/Include/XCBuildShellScript.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "XcodeGroupMember.h"
11-
#import "XcodeSourceFileType.h"
10+
#import <XcodeEditor/XcodeGroupMember.h>
11+
#import <XcodeEditor/XcodeSourceFileType.h>
1212

1313
@class XCProject;
1414

Source/Include/XCBuildShellScriptDefinition.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "XCAbstractDefinition.h"
10+
#import <XcodeEditor/XCAbstractDefinition.h>
1111

1212
@interface XCBuildShellScriptDefinition : XCAbstractDefinition
1313
{

Source/Include/XCClassDefinition.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
#import <Foundation/Foundation.h>
14-
#import "XCAbstractDefinition.h"
14+
#import <XcodeEditor/XCAbstractDefinition.h>
1515

1616
typedef enum
1717
{

Source/Include/XCFrameworkDefinition.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XCAbstractDefinition.h"
16-
#import "XcodeSourceTreeType.h"
15+
#import <XcodeEditor/XCAbstractDefinition.h>
16+
#import <XcodeEditor/XcodeSourceTreeType.h>
1717

1818
@interface XCFrameworkDefinition : XCAbstractDefinition
1919
{
@@ -37,4 +37,4 @@
3737

3838

3939

40-
@end
40+
@end

Source/Include/XCGroup.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212

1313
#import <Foundation/Foundation.h>
14-
#import "XcodeGroupMember.h"
15-
#import "XcodeSourceFileType.h"
16-
#import "XCBuildFile.h"
14+
#import <XcodeEditor/XcodeGroupMember.h>
15+
#import <XcodeEditor/XcodeSourceFileType.h>
16+
#import <XcodeEditor/XCBuildFile.h>
1717

1818
@class XCProject;
1919
@class XCClassDefinition;

Source/Include/XCProject+SubProject.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XCProject.h"
15+
#import <XcodeEditor/XCProject.h>
1616

1717
@interface XCProject (SubProject)
1818

@@ -40,4 +40,4 @@
4040

4141
- (NSString *)productsGroupKeyForKey:(NSString *)key;
4242

43-
@end
43+
@end

Source/Include/XCProject.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
////////////////////////////////////////////////////////////////////////////////
1111

1212
#import <Foundation/Foundation.h>
13-
#import "XcodeMemberType.h"
14-
#import "XcodeSourceFileType.h"
15-
#import "XcodeGroupMember.h"
13+
#import <XcodeEditor/XcodeMemberType.h>
14+
#import <XcodeEditor/XcodeSourceFileType.h>
15+
#import <XcodeEditor/XcodeGroupMember.h>
1616

1717
@class XCClassDefinition;
1818
@class XCGroup;

Source/Include/XCSourceFile.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XcodeGroupMember.h"
16-
#import "XcodeSourceFileType.h"
17-
#import "XCBuildFile.h"
15+
#import <XcodeEditor/XcodeGroupMember.h>
16+
#import <XcodeEditor/XcodeSourceFileType.h>
17+
#import <XcodeEditor/XCBuildFile.h>
1818

1919
@class XCProject;
2020

Source/Include/XCSourceFileDefinition.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XCAbstractDefinition.h"
16-
#import "XcodeSourceFileType.h"
15+
#import <XcodeEditor/XCAbstractDefinition.h>
16+
#import <XcodeEditor/XcodeSourceFileType.h>
1717

1818
@interface XCSourceFileDefinition : XCAbstractDefinition
1919
{

Source/Include/XCSubProjectDefinition.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XCAbstractDefinition.h"
16-
#import "XcodeSourceFileType.h"
15+
#import <XcodeEditor/XCAbstractDefinition.h>
16+
#import <XcodeEditor/XcodeSourceFileType.h>
1717

1818
@class XCProject;
1919

Source/Include/XCVersionGroup.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "XcodeGroupMember.h"
11-
#import "XCGroup.h"
12-
#import "XCBuildFile.h"
10+
#import <XcodeEditor/XcodeGroupMember.h>
11+
#import <XcodeEditor/XCGroup.h>
12+
#import <XcodeEditor/XCBuildFile.h>
1313

1414
@class XCProject;
1515
@class XCClassDefinition;

Source/Include/XCXibDefinition.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
#import <Foundation/Foundation.h>
15-
#import "XCAbstractDefinition.h"
15+
#import <XcodeEditor/XCAbstractDefinition.h>
1616

1717

1818
@interface XCXibDefinition : XCAbstractDefinition

Source/Include/XcodeEditor.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ FOUNDATION_EXPORT const unsigned char XcodeEditorVersionString[];
2020
// In this header, you should import all the public headers of your framework using statements like #import <XcodeEditor/PublicHeader.h>
2121

2222

23-
#import "XCAbstractDefinition.h"
24-
#import "XCGroup.h"
25-
#import "XCClassDefinition.h"
26-
#import "XCFileOperationQueue.h"
27-
#import "XCFrameworkDefinition.h"
28-
#import "XCProject.h"
29-
#import "XCSourceFile.h"
30-
#import "XCSourceFileDefinition.h"
31-
#import "XCSubProjectDefinition.h"
32-
#import "XCTarget.h"
33-
#import "XCXibDefinition.h"
34-
#import "XCKeyBuilder.h"
35-
#import "XCProject+SubProject.h"
36-
#import "XCProjectBuildConfig.h"
37-
#import "XCBuildShellScript.h"
38-
#import "XCBuildShellScriptDefinition.h"
39-
#import "XCVersionGroup.h"
23+
#import <XcodeEditor/XCAbstractDefinition.h>
24+
#import <XcodeEditor/XCGroup.h>
25+
#import <XcodeEditor/XCClassDefinition.h>
26+
#import <XcodeEditor/XCFileOperationQueue.h>
27+
#import <XcodeEditor/XCFrameworkDefinition.h>
28+
#import <XcodeEditor/XCProject.h>
29+
#import <XcodeEditor/XCSourceFile.h>
30+
#import <XcodeEditor/XCSourceFileDefinition.h>
31+
#import <XcodeEditor/XCSubProjectDefinition.h>
32+
#import <XcodeEditor/XCTarget.h>
33+
#import <XcodeEditor/XCXibDefinition.h>
34+
#import <XcodeEditor/XCKeyBuilder.h>
35+
#import <XcodeEditor/XCProject+SubProject.h>
36+
#import <XcodeEditor/XCProjectBuildConfig.h>
37+
#import <XcodeEditor/XCBuildShellScript.h>
38+
#import <XcodeEditor/XCBuildShellScriptDefinition.h>
39+
#import <XcodeEditor/XCVersionGroup.h>

Source/Include/XcodeGroupMember.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
#import "XcodeMemberType.h"
14+
#import <XcodeEditor/XcodeMemberType.h>
1515

1616
@protocol XcodeGroupMember <NSObject>
1717

@@ -25,4 +25,4 @@
2525
* Group members can either be other groups (PBXGroup) or source files (PBXFileReference).
2626
*/
2727
- (XcodeMemberType)groupMemberType;
28-
@end
28+
@end

Source/Resources/XcodeEditor-Prefix.pch

-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@
88

99
#endif
1010

11-
#if !DEBUG
12-
#define NSLog(...)
13-
#endif

Source/Utils/XCKeyBuilder.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ - (id)initHashValueMD5HashWithBytes:(const void*)bytes length:(NSUInteger)length
4545
self = [super init];
4646
if (self != nil)
4747
{
48-
CC_MD5(bytes, (int) length, _value);
48+
// CC_MD5(bytes, (int) length, _value);
49+
CC_SHA256(bytes, ( CC_LONG )length, _value);
4950
}
5051
return self;
5152
}

Source/XCFileOperationQueue.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ - (void)queueFrameworkWithFilePath:(NSString*)filePath inDirectory:(NSString*)di
8181

8282
- (void)queueDeletion:(NSString*)filePath
8383
{
84-
NSLog(@"Queue deletion at: %@", filePath);
84+
if ( DEBUG ) printf("Queue deletion at: %s\n", filePath.UTF8String);
8585
[_filesToDelete addObject:filePath];
8686
}
8787

@@ -125,7 +125,7 @@ - (void)performCopyFrameworks
125125
[_frameworksToCopy enumerateKeysAndObjectsUsingBlock:^(NSURL* destinationUrl, NSURL* frameworkPath, BOOL* stop)
126126
{
127127

128-
NSLog(@"$$$$$$$$$$$$$$ destination url: %@", destinationUrl);
128+
if ( DEBUG ) printf("$$$$$$$$$$$$$$ destination url: %s\n", destinationUrl.fileSystemRepresentation);
129129
NSFileManager* fileManager = [NSFileManager defaultManager];
130130

131131
if ([fileManager fileExistsAtPath:[destinationUrl path]])
@@ -150,12 +150,12 @@ - (void)performFileDeletions
150150

151151
if (![[NSFileManager defaultManager] removeItemAtPath:fullPath error:&error])
152152
{
153-
NSLog(@"failed to remove item at path; error == %@", error);
153+
if ( DEBUG ) fprintf(stderr, "failed to remove item at path; error == %s\n", error.description.UTF8String);
154154
[NSException raise:NSInternalInconsistencyException format:@"Error deleting file at filePath: %@", filePath];
155155
}
156156
else
157157
{
158-
NSLog(@"Deleted: %@", fullPath);
158+
if ( DEBUG ) printf("Deleted: %s\n", fullPath.UTF8String);
159159
}
160160
}
161161
[_filesToDelete removeAllObjects];
@@ -177,4 +177,4 @@ - (void)performCreateDirectories
177177
}
178178

179179

180-
@end
180+
@end

Source/XCGroup.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,16 @@ - (void)removeFromParentDeletingChildren:(BOOL)deleteChildren
9696
[_fileOperationQueue queueDeletion:[self pathRelativeToProjectRoot]];
9797
}
9898
NSDictionary *dictionary = [_project objects][_key];
99-
NSLog(@"Here's the dictionary: %@", dictionary);
99+
if (( dictionary ) && ( DEBUG )) printf("%s Dictionary: %s\n", __func__, dictionary.description.UTF8String ); else if ( DEBUG ) printf("%s No Dictionary\n", __func__);
100100

101101
[[_project objects] removeObjectForKey:_key];
102102

103103
dictionary = [_project objects][_key];
104-
NSLog(@"Here's the dictionary: %@", dictionary);
105-
104+
if (( dictionary ) && ( DEBUG )) printf("%s Dictionary: %s\n", __func__, dictionary.description.UTF8String ); else if ( DEBUG ) printf("%s No Dictionary\n", __func__ );
106105
for (XCTarget *target in [_project targets]) {
107106
[target removeMembersWithKeys:[self recursiveMembers]];
108107
}
109-
NSLog(@"Done!!!");
108+
if ( DEBUG ) puts("group removed");
110109
}
111110

112111
- (XCGroup *)parentGroup
@@ -179,9 +178,10 @@ - (void)removeHeader:(XCClassDefinition*)classDefinition {
179178

180179
- (void)addFramework:(XCFrameworkDefinition *)frameworkDefinition
181180
{
182-
if (([self memberWithDisplayName:[frameworkDefinition fileName]]) == nil) {
183-
NSLog(@"frame doesnt exists. creating %@", [frameworkDefinition fileName]);
184-
NSLog(@"existing members: %@", [self members]);
181+
if (([self memberWithDisplayName:[frameworkDefinition fileName]]) == nil)
182+
{
183+
if ( DEBUG ) printf("frame doesnt exists. creating %s\n", [frameworkDefinition fileName].UTF8String);
184+
if ( DEBUG ) printf("existing members: %s\n", [self members].description.UTF8String );
185185
NSDictionary *fileReference;
186186
if ([frameworkDefinition copyToDestination]) {
187187
fileReference = [self makeFileReferenceWithPath:[frameworkDefinition fileName] name:nil type:Framework

Source/XCProject.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ - (void)save
436436

437437
// Don't forget to reset the cache so that we'll always get the latest data.
438438
[self dropCache];
439-
440-
NSLog(@"Saved project");
439+
if ( DEBUG ) printf("Project %s saved\n", _filePath.lastPathComponent.UTF8String);
441440
}
442441

443442
- (NSMutableDictionary *)objects

Source/XCProjectBuildConfig.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ + (NSDictionary*)buildConfigurationsFromArray:(NSArray*)array inProject:(XCProje
6767

6868
if (![[NSFileManager defaultManager] fileExistsAtPath:path])
6969
{
70-
NSLog(@"XCConfig not found. Unable to find XCConfig file at %@", path);
70+
if ( DEBUG ) fprintf(stderr, "XCConfig not found. Unable to find XCConfig file at %s\n", path.UTF8String);
7171
}
7272

7373
}

Source/XCVersionGroup.m

+6-5
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,21 @@ - (void)removeFromParentDeletingChildren:(BOOL)deleteChildren
6969
[_fileOperationQueue queueDeletion:[self pathRelativeToProjectRoot]];
7070
}
7171
NSDictionary* dictionary = [_project objects][_key];
72-
NSLog(@"Here's the dictionary: %@", dictionary);
73-
72+
if (( dictionary ) &&( DEBUG )) printf("Dictionary: %s\n", dictionary.description.UTF8String ); else if ( DEBUG ) printf("No Dictionary\n");
73+
7474
[[_project objects] removeObjectForKey:_key];
7575

7676
dictionary = [_project objects][_key];
77-
NSLog(@"Here's the dictionary: %@", dictionary);
78-
77+
if ( DEBUG ) printf("%s",__func__);
78+
if (( dictionary ) && ( DEBUG )) printf("Dictionary: %s\n", dictionary.description.UTF8String ); else if ( DEBUG ) printf("No Dictionary\n");
79+
7980
for (XCTarget* target in [_project targets])
8081
{
8182
for (XCSourceFile *source in [self members]) {
8283
[target removeMemberWithKey:source.key];
8384
}
8485
}
85-
NSLog(@"Done!!!");
86+
if ( DEBUG ) puts("group removed");
8687
}
8788

8889
- (XCGroup*)parentGroup

0 commit comments

Comments
 (0)