diff --git a/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m b/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m index 4e225c2de..e40530853 100644 --- a/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m +++ b/Tools/XcodeCapp/XcodeCapp/ProcessSourceOperation.m @@ -101,7 +101,7 @@ NSDictionary *taskResult = [self.xcc runTaskWithLaunchPath:launchPath arguments:arguments - returnType:kTaskReturnTypeStdError]; + returnType:kTaskReturnTypeAny]; status = [taskResult[@"status"] intValue]; response = taskResult[@"response"]; @@ -113,11 +113,11 @@ if (status != 0) { - if (response.length == 0) - response = @"An unspecified error occurred"; - if ([self.xcc isXibFile:self.sourcePath]) { + if (response.length == 0) + response = @"An unspecified error occurred"; + notificationTitle = @"Error converting xib"; NSString *message = [NSString stringWithFormat:@"%@\n%@", self.sourcePath.lastPathComponent, response]; @@ -144,20 +144,12 @@ for (NSDictionary *error in errors) { - NSMutableDictionary *info = [error mutableCopy]; - info[@"projectId"] = self.projectId; - info[@"message"] = [NSString stringWithFormat:@"%@, line %d\n%@", [error[@"path"] lastPathComponent], [error[@"line"] intValue], error[@"message"]]; - info[@"status"] = taskResult[@"status"]; - - if (self.isCancelled) - return; - - [center postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info]; + [self postErrorNotificationForPath:error[@"path"] line:[error[@"line"] intValue] message:error[@"message"] status:status]; } } @catch (NSException *exception) { - DDLogError(@"%@\n%@", exception.reason, response); + [self postErrorNotificationForPath:self.sourcePath line:0 message:response status:status]; } } @@ -177,6 +169,23 @@ } } +- (void)postErrorNotificationForPath:(NSString *)path line:(int)line message:(NSString *)message status:(NSInteger)status +{ + NSMutableDictionary *info = [NSMutableDictionary dictionaryWithObjectsAndKeys: + path, @"path", + [NSNumber numberWithInt:line], @"line", + [NSNumber numberWithInteger:status], @"status", + nil]; + + info[@"projectId"] = self.projectId; + info[@"message"] = [NSString stringWithFormat:@"%@, line %d\n%@", [self.sourcePath lastPathComponent], 0, message]; + + if (self.isCancelled) + return; + + [[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info]; +} + - (void)notifyUserWithTitle:(NSString *)title message:(NSString *)message { NSDictionary *info = @{ @"projectId":self.projectId, @"title":title, @"message":message }; diff --git a/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages b/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages index 82f4aff42..73b168d3f 100644 Binary files a/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages and b/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages differ diff --git a/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf b/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf index bb4ece531..550ba1d08 100644 Binary files a/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf and b/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf differ diff --git a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h index 6ceb38619..0e7e90c1a 100644 --- a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h +++ b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h @@ -30,7 +30,8 @@ enum XCCAPIMode { enum XCCTaskReturnType { kTaskReturnTypeNone, kTaskReturnTypeStdOut, - kTaskReturnTypeStdError + kTaskReturnTypeStdError, + kTaskReturnTypeAny }; typedef enum XCCTaskReturnType XCCTaskReturnType; diff --git a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m index 3d826026d..249482620 100644 --- a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m +++ b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m @@ -1188,7 +1188,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, @param launchPath The executable to launch @param arguments NSArray containing the NSTask arguments - @param returnType Determines whether to return stdout, stderr, or nothing in the response + @param returnType Determines whether to return stdout, stderr, either, or nothing in the response @return NSDictionary containing the return status (NSNumber) and the response (NSString) */ - (NSDictionary *)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments returnType:(XCCTaskReturnType)returnType @@ -1211,7 +1211,14 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, DDLogVerbose(@"Task exited: %@:%d", launchPath, task.terminationStatus); - NSData *data = [[(returnType == kTaskReturnTypeStdOut ? task.standardOutput : task.standardError) fileHandleForReading] availableData]; + NSData *data = nil; + + if (returnType == kTaskReturnTypeStdOut || returnType == kTaskReturnTypeAny) + data = [[task.standardOutput fileHandleForReading] availableData]; + + if (returnType == kTaskReturnTypeStdError || (returnType == kTaskReturnTypeAny && [data length] == 0)) + data = [[task.standardError fileHandleForReading] availableData]; + NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSNumber *status = [NSNumber numberWithInt:task.terminationStatus]; diff --git a/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib b/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib index 9743d0279..b6fe97ddd 100644 --- a/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib +++ b/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib @@ -326,7 +326,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {315, 77} - + 256 @@ -343,6 +343,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {550, 201} + YES NO @@ -410,7 +411,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA -1832910848 - 2 + 5 15 0 NO @@ -420,6 +421,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{1, 1}, {550, 201}} + @@ -430,6 +432,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA -2147483392 {{535, 1}, {16, 45}} + NO @@ -441,6 +444,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA -2147483392 {{1, 273}, {512, 16}} + NO 1 @@ -451,6 +455,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{-1, 35}, {552, 203}} + 133682 @@ -466,6 +471,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 289 {{352, 8}, {85, 19}} + YES @@ -492,6 +498,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 292 {{20, 8}, {85, 19}} + YES @@ -514,6 +521,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 289 {{445, 8}, {85, 19}} + + YES -2080374784 @@ -532,6 +541,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {550, 237} + + {{0, 0}, {2560, 1418}} @@ -566,6 +577,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 81}, {271, 18}} + YES @@ -599,6 +611,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 51}, {241, 18}} + YES @@ -623,6 +636,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{15, 20}, {106, 17}} + _NS:1535 YES @@ -643,6 +657,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{124, 14}, {56, 26}} + _NS:9 YES @@ -711,12 +726,14 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{1, 1}, {395, 112}} + _NS:11 {{17, 149}, {397, 128}} + _NS:9 {0, 0} @@ -750,6 +767,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 73}, {363, 18}} + YES @@ -774,6 +792,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{35, 17}, {81, 18}} + YES @@ -798,6 +817,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{137, 17}, {60, 18}} + YES @@ -822,6 +842,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 43}, {306, 17}} + _NS:1535 YES @@ -840,12 +861,14 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{1, 1}, {395, 104}} + _NS:11 {{17, 16}, {397, 120}} + _NS:9 {0, 0} @@ -869,6 +892,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {431, 292} + {{0, 0}, {2560, 1418}} @@ -2138,7 +2162,157 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 876 - + + + + AppController + NSObject + + id + id + id + id + id + + + + loadProject: + id + + + openAbout: + id + + + openHelp: + id + + + openPreferences: + id + + + showInFinder: + id + + + + NSPanel + PDFView + NSWindow + NSMenuItem + NSMenuItem + NSMenuItem + NSUserDefaultsController + NSWindow + NSMenu + XcodeCapp + + + + aboutWindow + NSPanel + + + helpView + PDFView + + + helpWindow + NSWindow + + + menuItemHistory + NSMenuItem + + + menuItemOpenProject + NSMenuItem + + + menuItemShowInFinder + NSMenuItem + + + preferencesController + NSUserDefaultsController + + + preferencesWindow + NSWindow + + + statusMenu + NSMenu + + + xcc + XcodeCapp + + + + IBProjectSource + ./Classes/AppController.h + + + + XcodeCapp + NSObject + + id + id + id + id + id + + + + clearErrors: + id + + + openErrorInEditor: + id + + + openErrorsPanel: + id + + + openXcodeProject: + id + + + synchronizeProject: + id + + + + NSArrayController + NSTableView + NSPanel + + + + errorListController + NSArrayController + + + errorTable + NSTableView + + + errorsPanel + NSPanel + + + + IBProjectSource + ./Classes/XcodeCapp.h + + + + 0 IBCocoaFramework