diff --git a/LSUnusedResources/Info.plist b/LSUnusedResources/Info.plist index 07f6cf5..e7d857d 100644 --- a/LSUnusedResources/Info.plist +++ b/LSUnusedResources/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1 + 1.0 CFBundleSignature ???? CFBundleVersion - 2 + 3 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/LSUnusedResources/Model/ResourceStringSearcher.h b/LSUnusedResources/Model/ResourceStringSearcher.h index a53e826..a4f8ac1 100644 --- a/LSUnusedResources/Model/ResourceStringSearcher.h +++ b/LSUnusedResources/Model/ResourceStringSearcher.h @@ -17,7 +17,7 @@ extern NSString * const kNotificationResourceStringQueryDone; + (instancetype)sharedObject; -- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs; +- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs; - (void)reset; - (BOOL)containsResourceName:(NSString *)name; diff --git a/LSUnusedResources/Model/ResourceStringSearcher.m b/LSUnusedResources/Model/ResourceStringSearcher.m index 8f902f3..4ef2bd6 100644 --- a/LSUnusedResources/Model/ResourceStringSearcher.m +++ b/LSUnusedResources/Model/ResourceStringSearcher.m @@ -29,6 +29,7 @@ @interface ResourceStringSearcher () @property (strong, nonatomic) NSMutableSet *resStringSet; @property (strong, nonatomic) NSString *projectPath; +@property (strong, nonatomic) NSArray *resSuffixs; @property (strong, nonatomic) NSArray *fileSuffixs; @property (assign, nonatomic) BOOL isRunning; @@ -46,7 +47,7 @@ + (instancetype)sharedObject { return _sharedInstance; } -- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs { +- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs { if (self.isRunning) { return; } @@ -56,6 +57,7 @@ - (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)file self.isRunning = YES; self.projectPath = projectPath; + self.resSuffixs = resourceSuffixs; self.fileSuffixs = fileSuffixs; [self runSearchTask]; @@ -193,7 +195,7 @@ - (void)parseFileAtPath:(NSString *)path withType:(LSFileType)fileType { case LSFileTypePlist: case LSFileTypeH: case LSFileTypeC: - pattern = @"(\\S+)\\.(png|gif|jpg|jpeg)";//*.png + pattern = [NSString stringWithFormat:@"([a-zA-Z0-9_-]+)\\.(%@)", self.resSuffixs.count ? [self.resSuffixs componentsJoinedByString:@"|"] : @"png|gif|jpg|jpeg"]; //*.(png|gif|jpg|jpeg) groupIndex = 1; break; default: diff --git a/LSUnusedResources/ViewController/MainViewController.m b/LSUnusedResources/ViewController/MainViewController.m index 2671e2f..b933971 100644 --- a/LSUnusedResources/ViewController/MainViewController.m +++ b/LSUnusedResources/ViewController/MainViewController.m @@ -134,7 +134,7 @@ - (IBAction)onSearchButtonClicked:(id)sender { NSArray *fileSuffixs = [self includeFileSuffixs]; [[ResourceFileSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs]; - [[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath fileSuffixs:fileSuffixs]; + [[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs fileSuffixs:fileSuffixs]; } - (IBAction)onExportButtonClicked:(id)sender { diff --git a/Release/LSUnusedResources.app.zip b/Release/LSUnusedResources.app.zip index 38d2cd1..ffe5135 100644 Binary files a/Release/LSUnusedResources.app.zip and b/Release/LSUnusedResources.app.zip differ