From 467036bf3448d86b3d24c86782db037f8bcc817c Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Wed, 24 Apr 2013 15:07:59 -0400 Subject: [PATCH] Fixed: any .xcodecapp-ignore file was parsed. Previously any .xcodecapp-ignore file within the monitored directories would be parsed. This commit ensures that only the project's root .xcodecapp-ignore file is parsed. --- Tools/XcodeCapp/XcodeCapp/TNXcodeCapp.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/XcodeCapp/XcodeCapp/TNXcodeCapp.m b/Tools/XcodeCapp/XcodeCapp/TNXcodeCapp.m index 4d022c8b1..3a21feff6 100644 --- a/Tools/XcodeCapp/XcodeCapp/TNXcodeCapp.m +++ b/Tools/XcodeCapp/XcodeCapp/TNXcodeCapp.m @@ -71,6 +71,7 @@ NSArray *XCCDefaultIgnoredPathRegexes = nil; @property NSDate *appStartedTimestamp; @property NSMutableDictionary *pathModificationDates; @property NSMutableDictionary *projectPathsForSourcePaths; +@property NSString *xcodecappIgnorePath; @end @@ -98,7 +99,8 @@ NSArray *XCCDefaultIgnoredPathRegexes = nil; @"*/.*/", @"*/NS_*.j", @"*/main.j", - @"*/.*" + @"*/.*", + @"!*/.xcodecapp-ignore" ]; XCCDefaultIgnoredPathRegexes = [self parseIgnorePaths:defaultIgnoredPaths]; @@ -117,6 +119,7 @@ NSArray *XCCDefaultIgnoredPathRegexes = nil; self.lastEventId = [[NSUserDefaults standardUserDefaults] objectForKey:kDefaultLastEventId]; self.appStartedTimestamp = [NSDate date]; self.projectPathsForSourcePaths = [NSMutableDictionary new]; + self.xcodecappIgnorePath = @""; self.isListening = NO; self.isUsingFileLevelAPI = NO; @@ -329,6 +332,7 @@ NSArray *XCCDefaultIgnoredPathRegexes = nil; [self clearErrors:self]; self.currentProjectPath = path; + self.xcodecappIgnorePath = [self.currentProjectPath stringByAppendingPathComponent:@".xcodecapp-ignore"]; self.projectPathsForSourcePaths = [NSMutableDictionary new]; [self computeIgnoredPaths]; @@ -783,7 +787,7 @@ NSArray *XCCDefaultIgnoredPathRegexes = nil; - (BOOL)isXCCIgnoreFile:(NSString *)path { - return [path.lastPathComponent isEqual:@".xcodecapp-ignore"]; + return [path isEqualToString:self.xcodecappIgnorePath]; } - (NSString *)projectPathForSourcePath:(NSString *)path