From ea0c5e291fa8469ecd6e1a8dae6fce12c990032f Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Thu, 6 Nov 2014 09:38:30 -0800 Subject: [PATCH] Fixed: notification xib converted wasn't displayed anymore Previously, the notification xib converted didn't show up. Now it does again. This PR fixes another issue. Now when checking the the compilation issues, we only pass objj file to the command objj. --- .../XcodeCapp/ProcessSourceOperation.m | 10 +++----- Tools/XcodeCapp/XcodeCapp/XcodeCapp.m | 25 +++++++++++++++---- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m b/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m index 2c4858f2b..f41ffbddf 100644 --- a/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m +++ b/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m @@ -158,20 +158,16 @@ } else if (!self.xcc.isLoadingProject) { - BOOL showFinalNotification = NO; + BOOL showFinalNotification = YES; // At this point, we should only detect warnings - if ([self.xcc shouldProcessWithObjjWarnings]) + if ([self.xcc shouldProcessWithObjjWarnings] && ![self.xcc isXibFile:self.sourcePath]) { showFinalNotification = [self.xcc checkObjjWarningsForPath:[NSArray arrayWithObject:self.sourcePath]]; [self.xcc showObjjWarnings]; } - else - { - showFinalNotification = YES; - } - if ([self.xcc shouldProcessWithCappLint]) + if ([self.xcc shouldProcessWithCappLint] && ![self.xcc isXibFile:self.sourcePath]) { showFinalNotification = [self.xcc checkCappLintForPath:[NSArray arrayWithObject:self.sourcePath]] && showFinalNotification; [self.xcc showCappLintWarnings]; diff --git a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m index 52f3920f6..f3998a0a3 100644 --- a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m +++ b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m @@ -1852,15 +1852,26 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, DDLogVerbose(@"Checking path %@ with objj", paths); NSUInteger numberOfFiles = [paths count]; + NSUInteger i = 0; + NSMutableArray *objjPaths = [NSMutableArray array]; - if (!numberOfFiles) + // We only want the objj files + for (i = 0; i < numberOfFiles; i++) + { + NSString *path = [paths objectAtIndex:i]; + + if ([self isObjjFile:path]) + [objjPaths addObject:path]; + } + + if (![objjPaths count]) return YES; [[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidStartNotification object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:XCCObjjDidStartNotification object:self]; NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"-I", [self _getObjjIncludePaths], @"-m", nil]; - [arguments addObjectsFromArray:paths]; + [arguments addObjectsFromArray:objjPaths]; NSDictionary *taskResult = [self runTaskWithLaunchPath:self.executablePaths[@"objj"] arguments:arguments @@ -1879,7 +1890,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, NSMutableArray *errors = [NSMutableArray arrayWithArray:[response componentsSeparatedByString:@"\n\n"]]; NSInteger numberOfErrors = [errors count]; - NSInteger i = 0; + i = 0; NSMutableArray *dicts = [NSMutableArray array]; // When checking of the entire project, we have to be ready to find errors @@ -1906,8 +1917,12 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, if (![matches count]) { - DDLogVerbose(@"Error %@ has been ignored by xCodeCapp, the error doesn't respect any pattern", error); - continue; + // This shouldn't happen + DDLogVerbose(@"Error %@ doesn't respect any pattern", error); + + path = @""; + line = 0; + messageError = [NSString stringWithFormat:@"Compiling issue at line %@ of file %@:\n%@", line, path.lastPathComponent, error]; } for (NSTextCheckingResult *match in matches)