├── README.md
├── JXUnusedFilesFinder.xcodeproj
├── xcuserdata
│ └── wangyang.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── JXUnusedFilesFinder.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── wangyang.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
└── JXUnusedFilesFinder
├── ViewController.h
├── main.m
├── AppDelegate.h
├── JXFileSearcher.h
├── JXFileInfo.m
├── JXFileInfo.h
├── NSString+Tools.h
├── AppDelegate.m
├── JXUnusedFilesFinder.h
├── Info.plist
├── Assets.xcassets
└── AppIcon.appiconset
│ └── Contents.json
├── NSString+Tools.m
├── JXFileSearcher.m
├── ViewController.m
├── JXUnusedFilesFinder.m
└── Base.lproj
└── Main.storyboard
/README.md:
--------------------------------------------------------------------------------
1 | # JXUnusedFilesFinder
2 | A Mac App to find unused source files in XCode project.
3 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/xcuserdata/wangyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/project.xcworkspace/xcuserdata/wangyang.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomatoeggs/JXUnusedFilesFinder/HEAD/JXUnusedFilesFinder.xcodeproj/project.xcworkspace/xcuserdata/wangyang.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : NSViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXFileSearcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // JXFileSearcher.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface JXFileSearcher : NSObject
12 |
13 | +(NSArray *)filesInDirectory:(NSString *)directoryPath excludeFolders:(NSArray *)excludeFolders fileSuffixs:(NSArray *)fileSuffixs;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXFileInfo.m:
--------------------------------------------------------------------------------
1 | //
2 | // JXFileInfo.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "JXFileInfo.h"
10 |
11 | @implementation JXFileInfo
12 |
13 | -(instancetype)init
14 | {
15 | self = [super init];
16 | if (self)
17 | {
18 | self.parentFileKeyList = [NSMutableArray array];
19 | }
20 |
21 | return self;
22 | }
23 |
24 | -(BOOL)existSourceFile
25 | {
26 | return (self.sourceFilePath && self.sourceFilePath.length > 0);
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXFileInfo.h:
--------------------------------------------------------------------------------
1 | //
2 | // JXFileInfo.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface JXFileInfo : NSObject
12 |
13 | @property (nonatomic,strong) NSString *fileKey;
14 | @property (nonatomic,strong) NSString *headerFilePath;
15 | @property (nonatomic,strong) NSString *sourceFilePath;
16 |
17 | @property (nonatomic,strong) NSMutableArray *parentFileKeyList;
18 |
19 | @property (nonatomic,readonly) BOOL existSourceFile;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/NSString+Tools.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+Tools.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSString (Tools)
12 |
13 | -(NSArray *)getMatchedStringsWithPattern:(NSString*)pattern groupIndex:(NSInteger)index;
14 |
15 | -(NSString *)stringByReplacingMatchedComponentWithPattern:(NSString*)pattern groupIndex:(NSInteger)index withString:(NSString *)string;
16 |
17 | -(NSString *)stringByDeletingPathExtension;
18 |
19 | -(NSString *)trimString;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
18 | // Insert code here to initialize your application
19 | }
20 |
21 |
22 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
23 | // Insert code here to tear down your application
24 | }
25 |
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/xcuserdata/wangyang.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | JXUnusedFilesFinder.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | D35A98CE1EC4DC910003B933
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXUnusedFilesFinder.h:
--------------------------------------------------------------------------------
1 | //
2 | // JXUnusedFilesFinder.h
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_OPTIONS(NSUInteger, SearchOptions) {
12 |
13 | SearchOptionsIgnoreCategory = 1 << 0
14 | };
15 |
16 | typedef void(^SearchCompletionBlock)(NSArray *resultList);
17 |
18 | @interface JXUnusedFilesFinder : NSObject
19 |
20 | +(instancetype)sharedFinder;
21 |
22 | -(void)startSearchInDirectory:(NSString *)directory withSearchOptions:(SearchOptions)searchOptions completion:(SearchCompletionBlock)completion;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2017年 yancywang. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/NSString+Tools.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+Tools.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "NSString+Tools.h"
10 |
11 | @implementation NSString (Tools)
12 |
13 | -(NSArray *)getMatchedStringsWithPattern:(NSString*)pattern groupIndex:(NSInteger)index
14 | {
15 | NSRegularExpression* regexExpression = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive|NSRegularExpressionAnchorsMatchLines error:nil];
16 | NSArray* matchs = [regexExpression matchesInString:self options:0 range:NSMakeRange(0, self.length)];
17 |
18 | if (matchs.count)
19 | {
20 | NSMutableArray *list = [NSMutableArray array];
21 | for (NSTextCheckingResult *checkingResult in matchs)
22 | {
23 | NSString *res = [self substringWithRange:[checkingResult rangeAtIndex:index]];
24 | [list addObject:res];
25 | }
26 |
27 | return list;
28 | }
29 |
30 | return nil;
31 | }
32 |
33 | -(NSString *)stringByReplacingMatchedComponentWithPattern:(NSString*)pattern groupIndex:(NSInteger)index withString:(NSString *)string
34 | {
35 | NSArray *needDeleteStringList = [self getMatchedStringsWithPattern:pattern groupIndex:index];
36 |
37 | NSMutableArray *strList = [needDeleteStringList mutableCopy];
38 | [strList sortUsingComparator:^NSComparisonResult(NSString * _Nonnull obj1, NSString * _Nonnull obj2) {
39 |
40 | if (obj1.length > obj2.length)
41 | {
42 | return NSOrderedAscending;
43 | }
44 | else
45 | {
46 | return NSOrderedDescending;
47 | }
48 | }];
49 |
50 | NSString *newString = [self copy];
51 | for (NSString *needDeleteString in strList)
52 | {
53 | newString = [newString stringByReplacingOccurrencesOfString:needDeleteString withString:string];
54 | }
55 |
56 | return newString;
57 | }
58 |
59 | -(NSString *)stringByDeletingPathExtension
60 | {
61 | return [self stringByReplacingOccurrencesOfString:[@"." stringByAppendingString:[self pathExtension]] withString:@""];
62 | }
63 |
64 | -(NSString *)trimString
65 | {
66 | return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/xcuserdata/wangyang.xcuserdatad/xcschemes/JXUnusedFilesFinder.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXFileSearcher.m:
--------------------------------------------------------------------------------
1 | //
2 | // JXFileSearcher.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "JXFileSearcher.h"
10 |
11 | @implementation JXFileSearcher
12 |
13 | +(NSArray *)filesInDirectory:(NSString *)directoryPath excludeFolders:(NSArray *)excludeFolders fileSuffixs:(NSArray *)fileSuffixs
14 | {
15 | if (directoryPath.length == 0 || fileSuffixs.count == 0)
16 | {
17 | return nil;
18 | }
19 |
20 | NSMutableArray *resources = [NSMutableArray array];
21 |
22 | for (NSString *fileType in fileSuffixs)
23 | {
24 | NSArray *pathList = [self searchDirectory:directoryPath excludeFolders:excludeFolders forFiletype:fileType];
25 |
26 | if (pathList.count)
27 | {
28 | [resources addObjectsFromArray:pathList];
29 | }
30 | }
31 |
32 | return resources;
33 | }
34 |
35 | +(NSArray *)searchDirectory:(NSString *)directoryPath excludeFolders:(NSArray *)excludeFolders forFiletype:(NSString *)filetype
36 | {
37 | // Create a find task
38 | NSTask *task = [[NSTask alloc] init];
39 | [task setLaunchPath: @"/usr/bin/find"];
40 |
41 | // Search for all files
42 | NSMutableArray *argvals = [NSMutableArray array];
43 | [argvals addObject:directoryPath];
44 | [argvals addObject:@"-name"];
45 | [argvals addObject:[NSString stringWithFormat:@"*.%@", filetype]];
46 |
47 | for (NSString *folder in excludeFolders)
48 | {
49 | [argvals addObject:@"!"];
50 | [argvals addObject:@"-path"];
51 | [argvals addObject:[NSString stringWithFormat:@"*/%@/*", folder]];
52 | }
53 |
54 | [task setArguments: argvals];
55 |
56 | NSPipe *pipe = [NSPipe pipe];
57 | [task setStandardOutput: pipe];
58 | NSFileHandle *file = [pipe fileHandleForReading];
59 |
60 | // Run task
61 | [task launch];
62 |
63 | // Read the response
64 | NSData *data = [file readDataToEndOfFile];
65 | NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
66 |
67 | // See if we can create a lines array
68 | if (string.length)
69 | {
70 | NSArray *lines = [string componentsSeparatedByString:@"\n"];
71 | return lines;
72 | }
73 |
74 | return nil;
75 | }
76 |
77 | // Toooooo Sloooooow
78 | +(NSArray *)searchDirectory:(NSString *)directoryPath excludeFolders:(NSArray *)excludeFolders forFiletypes:(NSArray *)filetypes
79 | {
80 | // find -E . -iregex ".*\.(html|plist)" ! -path "*/Movies/*" ! -path "*/Downloads/*" ! -path "*/Music/*"
81 | // Create a find task
82 | NSTask *task = [[NSTask alloc] init];
83 | [task setLaunchPath: @"/usr/bin/find"];
84 |
85 | // Search for all files
86 | NSMutableArray *argvals = [NSMutableArray array];
87 | [argvals addObject:@"-E"];
88 | [argvals addObject:directoryPath];
89 | [argvals addObject:@"-iregex"];
90 |
91 | [argvals addObject:[NSString stringWithFormat:@".*\\.(%@)", [filetypes componentsJoinedByString:@"|"]]];
92 |
93 | for (NSString *folder in excludeFolders)
94 | {
95 | [argvals addObject:@"!"];
96 | [argvals addObject:@"-path"];
97 | [argvals addObject:[NSString stringWithFormat:@"*/%@/*", folder]];
98 | }
99 |
100 | [task setArguments: argvals];
101 |
102 | NSPipe *pipe = [NSPipe pipe];
103 | [task setStandardOutput: pipe];
104 | NSFileHandle *file = [pipe fileHandleForReading];
105 |
106 | // Run task
107 | [task launch];
108 |
109 | // Read the response
110 | NSData *data = [file readDataToEndOfFile];
111 | NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
112 |
113 | // See if we can create a lines array
114 | if (string.length)
115 | {
116 | NSArray *lines = [string componentsSeparatedByString:@"\n"];
117 | return lines;
118 | }
119 |
120 | return nil;
121 | }
122 |
123 | @end
124 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "JXUnusedFilesFinder.h"
11 |
12 | @interface ViewController ()
13 |
14 | // Project
15 | @property (weak) IBOutlet NSButton *browseButton;
16 | @property (weak) IBOutlet NSTextField *pathTextField;
17 |
18 | // Settings
19 | @property (weak) IBOutlet NSButton *ignoreCategoryCheckBox;
20 |
21 | // Result
22 | @property (unsafe_unretained) IBOutlet NSTextView *resultTextView;
23 | @property (weak) IBOutlet NSProgressIndicator *processIndicator;
24 | @property (weak) IBOutlet NSTextField *statusLabel;
25 | @property (weak) IBOutlet NSButton *searchButton;
26 |
27 | // clear
28 | @property (weak) IBOutlet NSButton *clearButton;
29 | @property (nonatomic,strong) NSArray *resultList;
30 |
31 | @end
32 |
33 | @implementation ViewController
34 |
35 | #pragma mark - lifecycle
36 | -(void)viewDidLoad
37 | {
38 | [super viewDidLoad];
39 |
40 | [self.clearButton setEnabled:NO];
41 | }
42 |
43 | #pragma mark - UI
44 | - (void)showAlertWithStyle:(NSAlertStyle)style title:(NSString *)title subtitle:(NSString *)subtitle
45 | {
46 | NSAlert *alert = [[NSAlert alloc] init];
47 | alert.alertStyle = style;
48 | [alert setMessageText:title];
49 | [alert setInformativeText:subtitle];
50 | [alert runModal];
51 | }
52 |
53 | - (void)setUIEnabled:(BOOL)state
54 | {
55 | if (state)
56 | {
57 | [self.processIndicator stopAnimation:self];
58 | }
59 | else
60 | {
61 | [self.processIndicator startAnimation:self];
62 | }
63 |
64 | [self.browseButton setEnabled:state];
65 | [self.pathTextField setEnabled:state];
66 | [self.ignoreCategoryCheckBox setEnabled:state];
67 | [self.searchButton setEnabled:state];
68 | // [self.resultTextView setEditable:state];
69 | [self.processIndicator setHidden:state];
70 | [self.clearButton setEnabled:state];
71 | }
72 |
73 | -(NSUInteger)getSettings
74 | {
75 | NSUInteger setting = 0;
76 |
77 | if ([self.ignoreCategoryCheckBox state])
78 | {
79 | setting = setting | SearchOptionsIgnoreCategory;
80 | }
81 |
82 | return setting;
83 | }
84 |
85 | #pragma mark - Action
86 | - (IBAction)onBrowseButtonClicked:(id)sender
87 | {
88 | // Show an open panel
89 | NSOpenPanel *openPanel = [NSOpenPanel openPanel];
90 | [openPanel setCanChooseDirectories:YES];
91 | [openPanel setCanChooseFiles:NO];
92 |
93 | BOOL okButtonPressed = ([openPanel runModal] == NSModalResponseOK);
94 | if (okButtonPressed)
95 | {
96 | // Update the path text field
97 | NSString *path = [[openPanel URL] path];
98 | [self.pathTextField setStringValue:path];
99 | }
100 | }
101 |
102 | - (IBAction)onSearchButtonClicked:(id)sender
103 | {
104 | NSString *projectPath = self.pathTextField.stringValue;
105 | if (!projectPath.length)
106 | {
107 | [self showAlertWithStyle:NSAlertStyleWarning title:@"Path Error" subtitle:@"Project path is empty"];
108 | return;
109 | }
110 |
111 | BOOL pathExists = [[NSFileManager defaultManager] fileExistsAtPath:projectPath];
112 | if (!pathExists)
113 | {
114 | [self showAlertWithStyle:NSAlertStyleWarning title:@"Path Error" subtitle:@"Project folder is not exists"];
115 | return;
116 | }
117 |
118 | [self setUIEnabled:NO];
119 | self.statusLabel.stringValue = @"Searching...";
120 | [self.resultTextView setString:@""];
121 |
122 | NSUInteger settings = [self getSettings];
123 | __weak __typeof__(self) weakSelf = self;
124 | [[JXUnusedFilesFinder sharedFinder] startSearchInDirectory:projectPath withSearchOptions:settings completion:^(NSArray *resultList) {
125 |
126 | NSString *allResultStr = @"";
127 | for (NSString *path in resultList)
128 | {
129 | allResultStr = [allResultStr stringByAppendingFormat:@"%@\n",path];
130 | }
131 |
132 | [weakSelf.resultTextView setString:allResultStr];
133 | [weakSelf.statusLabel setStringValue:[NSString stringWithFormat:@"found unused files : %ld",resultList.count]];
134 | [weakSelf setUIEnabled:YES];
135 | weakSelf.resultList = resultList;
136 | }];
137 | }
138 |
139 | - (IBAction)clearAllButtonClicked:(id)sender
140 | {
141 | NSAlert *alert = [[NSAlert alloc] init];
142 | [alert setAlertStyle:NSAlertStyleWarning];
143 | [alert setMessageText:@"Confirm!"];
144 | [alert setInformativeText:@"This operation will comment out all the unused files, continue?"];
145 | [alert addButtonWithTitle:@"YES"];
146 | [alert addButtonWithTitle:@"NO"];
147 |
148 | [alert beginSheetModalForWindow:self.view.window completionHandler:^(NSModalResponse returnCode) {
149 |
150 | if (returnCode == NSAlertFirstButtonReturn)
151 | {
152 | [self commentOutAll];
153 | }
154 | }];
155 | }
156 |
157 | #pragma mark - clear
158 | -(void)commentOutAll
159 | {
160 | if (!self.resultList ||self.resultList.count == 0)
161 | {
162 | return;
163 | }
164 |
165 | self.statusLabel.stringValue = @"Processing...";
166 | [self setUIEnabled:NO];
167 |
168 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
169 |
170 | for (NSString *filePath in self.resultList)
171 | {
172 | NSString *content = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
173 | if (!content)
174 | {
175 | continue;
176 | }
177 |
178 | content = [content stringByReplacingOccurrencesOfString:@"\n" withString:@"\n//"];
179 | content = [[self createCommentHeader] stringByAppendingString:content];
180 | if(!content)
181 | {
182 | continue;
183 | }
184 |
185 | [content writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
186 | }
187 |
188 | dispatch_async(dispatch_get_main_queue(), ^{
189 |
190 | self.statusLabel.stringValue = [NSString stringWithFormat:@"unused files : %ld",self.resultList.count];
191 | self.resultList = nil;
192 | [self setUIEnabled:YES];
193 | [self.clearButton setEnabled:NO];
194 | [self showAlertWithStyle:NSAlertStyleInformational title:@"Done!" subtitle:@"All files are commented out."];
195 | });
196 | });
197 | }
198 |
199 | -(NSString *)createCommentHeader
200 | {
201 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
202 | [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
203 |
204 | NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]];
205 |
206 | return [NSString stringWithFormat:@"/******************** Commented out by JXUnusedFilesFinder on %@ ********************/\n\n//",dateStr];
207 | }
208 |
209 | @end
210 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/JXUnusedFilesFinder.m:
--------------------------------------------------------------------------------
1 | //
2 | // JXUnusedFilesFinder.m
3 | // JXUnusedFilesFinder
4 | //
5 | // Created by yancywang on 2017/4/12.
6 | // Copyright © 2017年 yancywang. All rights reserved.
7 | //
8 |
9 | #import "JXUnusedFilesFinder.h"
10 | #import "JXFileSearcher.h"
11 | #import "NSString+Tools.h"
12 | #import "JXFileInfo.h"
13 |
14 | #define COMMENT_PATTERN_1 @"(/\\*([^/]|[^\\*]/)*\\*/)" // pattern : /\*([^/]|[^\*]/)*\*/
15 | #define COMMENT_PATTERN_2 @"(//[^\\n]*\\n)" // pattern : ^([^/\n]|[^/\n]/)*(//[^\n]*\n)
16 | #define COMMENT_PATTERN_3 @"(//[^\\n]*$)"
17 |
18 | #define IMPORT_PATTERN @"#\\s*import\\s*\"([^\"]+/)?([a-zA-Z0-9\\+\\._-]+)\\.h\""
19 | #define INCLUDE_PATTERN @"#\\s*include\\s*\"([^\"]+/)?([a-zA-Z0-9\\+\\._-]+)\\.h\""
20 | #define INCLUDE_PATTERN_2 @"#\\s*include\\s*<([^>]+/)?([a-zA-Z0-9\\+\\._-]+)\\.h>"
21 | #define XIB_PATTERN @" customClass=\"([a-zA-Z0-9_-]+)\""
22 |
23 | @interface JXUnusedFilesFinder ()
24 |
25 | @property (nonatomic,strong) NSMutableDictionary *fileKeyDic;
26 | @property (nonatomic,strong) NSMutableArray *resultList;
27 |
28 | @end
29 |
30 | @implementation JXUnusedFilesFinder
31 |
32 | +(instancetype)sharedFinder
33 | {
34 | static JXUnusedFilesFinder *_sharedObj = nil;
35 | static dispatch_once_t onceToken;
36 | dispatch_once(&onceToken, ^{
37 |
38 | _sharedObj = [[JXUnusedFilesFinder alloc] init];
39 | });
40 |
41 | return _sharedObj;
42 | }
43 |
44 | -(instancetype)init
45 | {
46 | self = [super init];
47 | if (self)
48 | {
49 | self.fileKeyDic = [NSMutableDictionary dictionary];
50 | self.resultList = [NSMutableArray array];
51 | }
52 |
53 | return self;
54 | }
55 |
56 | -(void)startSearchInDirectory:(NSString *)directory withSearchOptions:(SearchOptions)searchOptions completion:(SearchCompletionBlock)completion
57 | {
58 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
59 |
60 | NSArray *fileList = [JXFileSearcher filesInDirectory:directory excludeFolders:nil fileSuffixs:@[@"h",@"c",@"m",@"mm",@"cpp",@"pch",@"storyboard"]];
61 |
62 | //build file name key dic
63 | [self.fileKeyDic removeAllObjects];
64 | for (NSString *filePath in fileList)
65 | {
66 | if ([filePath rangeOfString:@".framework/"].length > 0)
67 | {
68 | continue;
69 | }
70 |
71 | NSString *fileName = [filePath lastPathComponent];
72 | NSString *filePathExtension = [fileName pathExtension];
73 |
74 | if ([filePathExtension isEqualToString:@"h"] ||
75 | [filePathExtension isEqualToString:@"pch"] ||
76 | [filePathExtension isEqualToString:@"storyboard"] ||
77 | [fileName isEqualToString:@"main.m"])
78 | {
79 | NSString *fileKey = [fileName stringByDeletingPathExtension];
80 | JXFileInfo *fileInfo = [[JXFileInfo alloc] init];
81 | fileInfo.fileKey = fileKey;
82 | fileInfo.headerFilePath = filePath;
83 |
84 | if ([filePathExtension isEqualToString:@"pch"] ||
85 | [filePathExtension isEqualToString:@"storyboard"] ||
86 | [fileName isEqualToString:@"main.m"])
87 | {
88 | [fileInfo.parentFileKeyList addObject:@"__jx_system_hold"];
89 | }
90 |
91 | NSString *headerFileContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
92 | if (headerFileContent)
93 | {
94 | headerFileContent = [headerFileContent stringByReplacingMatchedComponentWithPattern:COMMENT_PATTERN_1 groupIndex:1 withString:@""];
95 | headerFileContent = [headerFileContent stringByReplacingMatchedComponentWithPattern:COMMENT_PATTERN_2 groupIndex:1 withString:@"\n"];
96 | headerFileContent = [headerFileContent stringByReplacingMatchedComponentWithPattern:COMMENT_PATTERN_3 groupIndex:1 withString:@""];
97 | headerFileContent = [headerFileContent trimString];
98 | }
99 |
100 | if (headerFileContent && headerFileContent.length > 0)
101 | {
102 | [self.fileKeyDic setObject:fileInfo forKey:fileKey];
103 | }
104 | }
105 | }
106 |
107 | for (NSString *filePath in fileList)
108 | {
109 | NSString *fileName = [filePath lastPathComponent];
110 | NSString *filePathExtension = [fileName pathExtension];
111 | NSString *fileKey = [fileName stringByDeletingPathExtension];
112 | JXFileInfo *fileInfo = self.fileKeyDic[fileKey];
113 | if (!fileInfo)
114 | {
115 | continue;
116 | }
117 |
118 | if ([filePathExtension isEqualToString:@"c"] ||
119 | [filePathExtension isEqualToString:@"m"] ||
120 | [filePathExtension isEqualToString:@"mm"] ||
121 | [filePathExtension isEqualToString:@"cpp"])
122 | {
123 | fileInfo.sourceFilePath = filePath;
124 | }
125 |
126 | NSString *content = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
127 | if (!content)
128 | {
129 | continue;
130 | }
131 |
132 | content = [content stringByReplacingMatchedComponentWithPattern:COMMENT_PATTERN_1 groupIndex:1 withString:@""];
133 | content = [content stringByReplacingMatchedComponentWithPattern:COMMENT_PATTERN_2 groupIndex:1 withString:@"\n"];
134 | if (content)
135 | {
136 | NSArray *importedFileName = [content getMatchedStringsWithPattern:IMPORT_PATTERN groupIndex:2];
137 | NSArray *includedFileName = [content getMatchedStringsWithPattern:INCLUDE_PATTERN groupIndex:2];
138 | NSArray *includedFileName_2 = [content getMatchedStringsWithPattern:INCLUDE_PATTERN_2 groupIndex:2];
139 | NSArray *xibHoldFileName = nil;
140 | if ([filePathExtension isEqualToString:@"storyboard"])
141 | {
142 | xibHoldFileName = [content getMatchedStringsWithPattern:XIB_PATTERN groupIndex:1];
143 | }
144 |
145 | NSArray *subFileNameKeyList = [NSArray array];
146 | subFileNameKeyList = [subFileNameKeyList arrayByAddingObjectsFromArray:importedFileName];
147 | subFileNameKeyList = [subFileNameKeyList arrayByAddingObjectsFromArray:includedFileName];
148 | subFileNameKeyList = [subFileNameKeyList arrayByAddingObjectsFromArray:includedFileName_2];
149 | subFileNameKeyList = [subFileNameKeyList arrayByAddingObjectsFromArray:xibHoldFileName];
150 |
151 | for (NSString *subFileKey in subFileNameKeyList)
152 | {
153 | if ([fileKey isEqualToString:subFileKey])
154 | {
155 | continue;
156 | }
157 |
158 | JXFileInfo *subFileInfo = self.fileKeyDic[subFileKey];
159 | if (subFileInfo)
160 | {
161 | [subFileInfo.parentFileKeyList addObject:fileKey];
162 | }
163 | }
164 | }
165 | }
166 |
167 | [self.resultList removeAllObjects];
168 | [self findUnusedFilesWithOptions:searchOptions completion:(SearchCompletionBlock)completion];
169 | });
170 | }
171 |
172 | -(void)findUnusedFilesWithOptions:(SearchOptions)options completion:(SearchCompletionBlock)completion
173 | {
174 | NSMutableArray *needDeleteKeyList = [NSMutableArray array];
175 |
176 | NSArray *keyList = [self.fileKeyDic.allKeys copy];
177 | for (NSString *key in keyList)
178 | {
179 | if ((options & SearchOptionsIgnoreCategory) > 0)
180 | {
181 | if ([key rangeOfString:@"+"].length > 0)
182 | {
183 | continue;
184 | }
185 | }
186 |
187 | JXFileInfo *fileInfo = self.fileKeyDic[key];
188 |
189 | if (fileInfo.parentFileKeyList.count == 0 &&
190 | fileInfo.existSourceFile == YES)
191 | {
192 | [self.resultList addObject:fileInfo.headerFilePath];
193 | [self.resultList addObject:fileInfo.sourceFilePath];
194 |
195 | [self.fileKeyDic removeObjectForKey:key];
196 | [needDeleteKeyList addObject:key];
197 | }
198 | }
199 |
200 | if (needDeleteKeyList.count > 0)
201 | {
202 | for (NSString *needDeleteKey in needDeleteKeyList)
203 | {
204 | for (JXFileInfo *fileInfo in self.fileKeyDic.allValues)
205 | {
206 | [fileInfo.parentFileKeyList removeObject:needDeleteKey];
207 | }
208 | }
209 |
210 | [self findUnusedFilesWithOptions:options completion:(SearchCompletionBlock)completion];
211 | }
212 | else
213 | {
214 | dispatch_async(dispatch_get_main_queue(), ^{
215 |
216 | if (completion)
217 | {
218 | completion(self.resultList);
219 | }
220 | });
221 | }
222 | }
223 |
224 | @end
225 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | D35A98D41EC4DC910003B933 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98D31EC4DC910003B933 /* AppDelegate.m */; };
11 | D35A98D71EC4DC910003B933 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98D61EC4DC910003B933 /* main.m */; };
12 | D35A98DA1EC4DC910003B933 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98D91EC4DC910003B933 /* ViewController.m */; };
13 | D35A98DC1EC4DC910003B933 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D35A98DB1EC4DC910003B933 /* Assets.xcassets */; };
14 | D35A98DF1EC4DC910003B933 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D35A98DD1EC4DC910003B933 /* Main.storyboard */; };
15 | D35A98E91EC4DD170003B933 /* JXFileSearcher.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98E81EC4DD170003B933 /* JXFileSearcher.m */; };
16 | D35A98F11EC4E7910003B933 /* JXUnusedFilesFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98F01EC4E7910003B933 /* JXUnusedFilesFinder.m */; };
17 | D35A98F61EC5731A0003B933 /* NSString+Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98F51EC5731A0003B933 /* NSString+Tools.m */; };
18 | D35A98FA1EC5B32E0003B933 /* JXFileInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D35A98F91EC5B32E0003B933 /* JXFileInfo.m */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXFileReference section */
22 | D35A98CF1EC4DC910003B933 /* JXUnusedFilesFinder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JXUnusedFilesFinder.app; sourceTree = BUILT_PRODUCTS_DIR; };
23 | D35A98D21EC4DC910003B933 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
24 | D35A98D31EC4DC910003B933 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
25 | D35A98D61EC4DC910003B933 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
26 | D35A98D81EC4DC910003B933 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
27 | D35A98D91EC4DC910003B933 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
28 | D35A98DB1EC4DC910003B933 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
29 | D35A98DE1EC4DC910003B933 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
30 | D35A98E01EC4DC910003B933 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | D35A98E71EC4DD170003B933 /* JXFileSearcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXFileSearcher.h; sourceTree = ""; };
32 | D35A98E81EC4DD170003B933 /* JXFileSearcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXFileSearcher.m; sourceTree = ""; };
33 | D35A98EF1EC4E7910003B933 /* JXUnusedFilesFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXUnusedFilesFinder.h; sourceTree = ""; };
34 | D35A98F01EC4E7910003B933 /* JXUnusedFilesFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXUnusedFilesFinder.m; sourceTree = ""; };
35 | D35A98F41EC5731A0003B933 /* NSString+Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Tools.h"; sourceTree = ""; };
36 | D35A98F51EC5731A0003B933 /* NSString+Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Tools.m"; sourceTree = ""; };
37 | D35A98F81EC5B32E0003B933 /* JXFileInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXFileInfo.h; sourceTree = ""; };
38 | D35A98F91EC5B32E0003B933 /* JXFileInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXFileInfo.m; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | D35A98CC1EC4DC910003B933 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | /* End PBXFrameworksBuildPhase section */
50 |
51 | /* Begin PBXGroup section */
52 | D35A98C61EC4DC910003B933 = {
53 | isa = PBXGroup;
54 | children = (
55 | D35A98D11EC4DC910003B933 /* JXUnusedFilesFinder */,
56 | D35A98D01EC4DC910003B933 /* Products */,
57 | );
58 | sourceTree = "";
59 | };
60 | D35A98D01EC4DC910003B933 /* Products */ = {
61 | isa = PBXGroup;
62 | children = (
63 | D35A98CF1EC4DC910003B933 /* JXUnusedFilesFinder.app */,
64 | );
65 | name = Products;
66 | sourceTree = "";
67 | };
68 | D35A98D11EC4DC910003B933 /* JXUnusedFilesFinder */ = {
69 | isa = PBXGroup;
70 | children = (
71 | D35A98D21EC4DC910003B933 /* AppDelegate.h */,
72 | D35A98D31EC4DC910003B933 /* AppDelegate.m */,
73 | D35A98E61EC4DCCD0003B933 /* Business */,
74 | D35A98F71EC579510003B933 /* ViewController */,
75 | D35A98DB1EC4DC910003B933 /* Assets.xcassets */,
76 | D35A98DD1EC4DC910003B933 /* Main.storyboard */,
77 | D35A98E01EC4DC910003B933 /* Info.plist */,
78 | D35A98D51EC4DC910003B933 /* Supporting Files */,
79 | );
80 | path = JXUnusedFilesFinder;
81 | sourceTree = "";
82 | };
83 | D35A98D51EC4DC910003B933 /* Supporting Files */ = {
84 | isa = PBXGroup;
85 | children = (
86 | D35A98D61EC4DC910003B933 /* main.m */,
87 | );
88 | name = "Supporting Files";
89 | sourceTree = "";
90 | };
91 | D35A98E61EC4DCCD0003B933 /* Business */ = {
92 | isa = PBXGroup;
93 | children = (
94 | D35A98F41EC5731A0003B933 /* NSString+Tools.h */,
95 | D35A98F51EC5731A0003B933 /* NSString+Tools.m */,
96 | D35A98E71EC4DD170003B933 /* JXFileSearcher.h */,
97 | D35A98E81EC4DD170003B933 /* JXFileSearcher.m */,
98 | D35A98F81EC5B32E0003B933 /* JXFileInfo.h */,
99 | D35A98F91EC5B32E0003B933 /* JXFileInfo.m */,
100 | D35A98EF1EC4E7910003B933 /* JXUnusedFilesFinder.h */,
101 | D35A98F01EC4E7910003B933 /* JXUnusedFilesFinder.m */,
102 | );
103 | name = Business;
104 | sourceTree = "";
105 | };
106 | D35A98F71EC579510003B933 /* ViewController */ = {
107 | isa = PBXGroup;
108 | children = (
109 | D35A98D81EC4DC910003B933 /* ViewController.h */,
110 | D35A98D91EC4DC910003B933 /* ViewController.m */,
111 | );
112 | name = ViewController;
113 | sourceTree = "";
114 | };
115 | /* End PBXGroup section */
116 |
117 | /* Begin PBXNativeTarget section */
118 | D35A98CE1EC4DC910003B933 /* JXUnusedFilesFinder */ = {
119 | isa = PBXNativeTarget;
120 | buildConfigurationList = D35A98E31EC4DC910003B933 /* Build configuration list for PBXNativeTarget "JXUnusedFilesFinder" */;
121 | buildPhases = (
122 | D35A98CB1EC4DC910003B933 /* Sources */,
123 | D35A98CC1EC4DC910003B933 /* Frameworks */,
124 | D35A98CD1EC4DC910003B933 /* Resources */,
125 | );
126 | buildRules = (
127 | );
128 | dependencies = (
129 | );
130 | name = JXUnusedFilesFinder;
131 | productName = JXUnusedFilesFinder;
132 | productReference = D35A98CF1EC4DC910003B933 /* JXUnusedFilesFinder.app */;
133 | productType = "com.apple.product-type.application";
134 | };
135 | /* End PBXNativeTarget section */
136 |
137 | /* Begin PBXProject section */
138 | D35A98C71EC4DC910003B933 /* Project object */ = {
139 | isa = PBXProject;
140 | attributes = {
141 | LastUpgradeCheck = 0830;
142 | ORGANIZATIONNAME = Tencent;
143 | TargetAttributes = {
144 | D35A98CE1EC4DC910003B933 = {
145 | CreatedOnToolsVersion = 8.3.2;
146 | DevelopmentTeam = C45R6D3474;
147 | ProvisioningStyle = Automatic;
148 | };
149 | };
150 | };
151 | buildConfigurationList = D35A98CA1EC4DC910003B933 /* Build configuration list for PBXProject "JXUnusedFilesFinder" */;
152 | compatibilityVersion = "Xcode 3.2";
153 | developmentRegion = English;
154 | hasScannedForEncodings = 0;
155 | knownRegions = (
156 | en,
157 | Base,
158 | );
159 | mainGroup = D35A98C61EC4DC910003B933;
160 | productRefGroup = D35A98D01EC4DC910003B933 /* Products */;
161 | projectDirPath = "";
162 | projectRoot = "";
163 | targets = (
164 | D35A98CE1EC4DC910003B933 /* JXUnusedFilesFinder */,
165 | );
166 | };
167 | /* End PBXProject section */
168 |
169 | /* Begin PBXResourcesBuildPhase section */
170 | D35A98CD1EC4DC910003B933 /* Resources */ = {
171 | isa = PBXResourcesBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | D35A98DC1EC4DC910003B933 /* Assets.xcassets in Resources */,
175 | D35A98DF1EC4DC910003B933 /* Main.storyboard in Resources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXResourcesBuildPhase section */
180 |
181 | /* Begin PBXSourcesBuildPhase section */
182 | D35A98CB1EC4DC910003B933 /* Sources */ = {
183 | isa = PBXSourcesBuildPhase;
184 | buildActionMask = 2147483647;
185 | files = (
186 | D35A98DA1EC4DC910003B933 /* ViewController.m in Sources */,
187 | D35A98F61EC5731A0003B933 /* NSString+Tools.m in Sources */,
188 | D35A98D71EC4DC910003B933 /* main.m in Sources */,
189 | D35A98FA1EC5B32E0003B933 /* JXFileInfo.m in Sources */,
190 | D35A98F11EC4E7910003B933 /* JXUnusedFilesFinder.m in Sources */,
191 | D35A98E91EC4DD170003B933 /* JXFileSearcher.m in Sources */,
192 | D35A98D41EC4DC910003B933 /* AppDelegate.m in Sources */,
193 | );
194 | runOnlyForDeploymentPostprocessing = 0;
195 | };
196 | /* End PBXSourcesBuildPhase section */
197 |
198 | /* Begin PBXVariantGroup section */
199 | D35A98DD1EC4DC910003B933 /* Main.storyboard */ = {
200 | isa = PBXVariantGroup;
201 | children = (
202 | D35A98DE1EC4DC910003B933 /* Base */,
203 | );
204 | name = Main.storyboard;
205 | sourceTree = "";
206 | };
207 | /* End PBXVariantGroup section */
208 |
209 | /* Begin XCBuildConfiguration section */
210 | D35A98E11EC4DC910003B933 /* Debug */ = {
211 | isa = XCBuildConfiguration;
212 | buildSettings = {
213 | ALWAYS_SEARCH_USER_PATHS = NO;
214 | CLANG_ANALYZER_NONNULL = YES;
215 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
216 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
217 | CLANG_CXX_LIBRARY = "libc++";
218 | CLANG_ENABLE_MODULES = YES;
219 | CLANG_ENABLE_OBJC_ARC = YES;
220 | CLANG_WARN_BOOL_CONVERSION = YES;
221 | CLANG_WARN_CONSTANT_CONVERSION = YES;
222 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
223 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
224 | CLANG_WARN_EMPTY_BODY = YES;
225 | CLANG_WARN_ENUM_CONVERSION = YES;
226 | CLANG_WARN_INFINITE_RECURSION = YES;
227 | CLANG_WARN_INT_CONVERSION = YES;
228 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
229 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
230 | CLANG_WARN_UNREACHABLE_CODE = YES;
231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
232 | CODE_SIGN_IDENTITY = "-";
233 | COPY_PHASE_STRIP = NO;
234 | DEBUG_INFORMATION_FORMAT = dwarf;
235 | ENABLE_STRICT_OBJC_MSGSEND = YES;
236 | ENABLE_TESTABILITY = YES;
237 | GCC_C_LANGUAGE_STANDARD = gnu99;
238 | GCC_DYNAMIC_NO_PIC = NO;
239 | GCC_NO_COMMON_BLOCKS = YES;
240 | GCC_OPTIMIZATION_LEVEL = 0;
241 | GCC_PREPROCESSOR_DEFINITIONS = (
242 | "DEBUG=1",
243 | "$(inherited)",
244 | );
245 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
246 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
247 | GCC_WARN_UNDECLARED_SELECTOR = YES;
248 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
249 | GCC_WARN_UNUSED_FUNCTION = YES;
250 | GCC_WARN_UNUSED_VARIABLE = YES;
251 | MACOSX_DEPLOYMENT_TARGET = 10.12;
252 | MTL_ENABLE_DEBUG_INFO = YES;
253 | ONLY_ACTIVE_ARCH = YES;
254 | SDKROOT = macosx;
255 | };
256 | name = Debug;
257 | };
258 | D35A98E21EC4DC910003B933 /* Release */ = {
259 | isa = XCBuildConfiguration;
260 | buildSettings = {
261 | ALWAYS_SEARCH_USER_PATHS = NO;
262 | CLANG_ANALYZER_NONNULL = YES;
263 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
265 | CLANG_CXX_LIBRARY = "libc++";
266 | CLANG_ENABLE_MODULES = YES;
267 | CLANG_ENABLE_OBJC_ARC = YES;
268 | CLANG_WARN_BOOL_CONVERSION = YES;
269 | CLANG_WARN_CONSTANT_CONVERSION = YES;
270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
271 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
272 | CLANG_WARN_EMPTY_BODY = YES;
273 | CLANG_WARN_ENUM_CONVERSION = YES;
274 | CLANG_WARN_INFINITE_RECURSION = YES;
275 | CLANG_WARN_INT_CONVERSION = YES;
276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
277 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
278 | CLANG_WARN_UNREACHABLE_CODE = YES;
279 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
280 | CODE_SIGN_IDENTITY = "-";
281 | COPY_PHASE_STRIP = NO;
282 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
283 | ENABLE_NS_ASSERTIONS = NO;
284 | ENABLE_STRICT_OBJC_MSGSEND = YES;
285 | GCC_C_LANGUAGE_STANDARD = gnu99;
286 | GCC_NO_COMMON_BLOCKS = YES;
287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
289 | GCC_WARN_UNDECLARED_SELECTOR = YES;
290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
291 | GCC_WARN_UNUSED_FUNCTION = YES;
292 | GCC_WARN_UNUSED_VARIABLE = YES;
293 | MACOSX_DEPLOYMENT_TARGET = 10.12;
294 | MTL_ENABLE_DEBUG_INFO = NO;
295 | SDKROOT = macosx;
296 | };
297 | name = Release;
298 | };
299 | D35A98E41EC4DC910003B933 /* Debug */ = {
300 | isa = XCBuildConfiguration;
301 | buildSettings = {
302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303 | COMBINE_HIDPI_IMAGES = YES;
304 | DEVELOPMENT_TEAM = C45R6D3474;
305 | INFOPLIST_FILE = JXUnusedFilesFinder/Info.plist;
306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
307 | PRODUCT_BUNDLE_IDENTIFIER = com.joox.JXUnusedFilesFinder;
308 | PRODUCT_NAME = "$(TARGET_NAME)";
309 | };
310 | name = Debug;
311 | };
312 | D35A98E51EC4DC910003B933 /* Release */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
316 | COMBINE_HIDPI_IMAGES = YES;
317 | DEVELOPMENT_TEAM = C45R6D3474;
318 | INFOPLIST_FILE = JXUnusedFilesFinder/Info.plist;
319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
320 | PRODUCT_BUNDLE_IDENTIFIER = com.joox.JXUnusedFilesFinder;
321 | PRODUCT_NAME = "$(TARGET_NAME)";
322 | };
323 | name = Release;
324 | };
325 | /* End XCBuildConfiguration section */
326 |
327 | /* Begin XCConfigurationList section */
328 | D35A98CA1EC4DC910003B933 /* Build configuration list for PBXProject "JXUnusedFilesFinder" */ = {
329 | isa = XCConfigurationList;
330 | buildConfigurations = (
331 | D35A98E11EC4DC910003B933 /* Debug */,
332 | D35A98E21EC4DC910003B933 /* Release */,
333 | );
334 | defaultConfigurationIsVisible = 0;
335 | defaultConfigurationName = Release;
336 | };
337 | D35A98E31EC4DC910003B933 /* Build configuration list for PBXNativeTarget "JXUnusedFilesFinder" */ = {
338 | isa = XCConfigurationList;
339 | buildConfigurations = (
340 | D35A98E41EC4DC910003B933 /* Debug */,
341 | D35A98E51EC4DC910003B933 /* Release */,
342 | );
343 | defaultConfigurationIsVisible = 0;
344 | defaultConfigurationName = Release;
345 | };
346 | /* End XCConfigurationList section */
347 | };
348 | rootObject = D35A98C71EC4DC910003B933 /* Project object */;
349 | }
350 |
--------------------------------------------------------------------------------
/JXUnusedFilesFinder/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
735 |
736 |
737 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
--------------------------------------------------------------------------------