mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-02 00:43:35 +00:00
Fixed: in some cases nib2cib would write to stdout, which wasn't captured by XcodeCapp.
Previously, only stderr was checked for response text. In some edge cases it would write an error message to stdout. In addition, the default error message provided when the return status was non-zero and the output was empty was implemented incorrectly. Now all output from nib2cib is correctly captured. Also updated help to indicate how to enable debug logging.
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user