mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-18 08:33:06 +00:00
PCProjectBuilder.[hm]: stop logging when building/cleaning. Cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@17542 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
78ecb14e67
commit
6541a8d081
3 changed files with 58 additions and 67 deletions
|
@ -87,8 +87,7 @@
|
|||
- (void) logStdOut: (NSNotification *)aNotif;
|
||||
- (void) logErrOut: (NSNotification *)aNotif;
|
||||
|
||||
- (void) buildDidTerminate: (NSNotification *)aNotif;
|
||||
//- (void) buildDidTerminate: (int)status;
|
||||
- (void) buildDidTerminate;
|
||||
|
||||
- (void) copyPackageTo: (NSString *)path;
|
||||
|
||||
|
|
|
@ -571,11 +571,9 @@
|
|||
|
||||
// Prepearing to building
|
||||
logPipe = [NSPipe pipe];
|
||||
// readHandle = [[logPipe fileHandleForReading] retain];
|
||||
readHandle = [logPipe fileHandleForReading];
|
||||
|
||||
errorPipe = [NSPipe pipe];
|
||||
// errorReadHandle = [[errorPipe fileHandleForReading] retain];
|
||||
errorReadHandle = [errorPipe fileHandleForReading];
|
||||
|
||||
[readHandle waitForDataInBackgroundAndNotify];
|
||||
|
@ -607,75 +605,68 @@
|
|||
toTarget: self
|
||||
withObject: data];
|
||||
|
||||
[NOTIFICATION_CENTER addObserver: self
|
||||
selector: @selector (buildDidTerminate:)
|
||||
name: NSTaskDidTerminateNotification
|
||||
object: makeTask];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
- (void)buildDidTerminate:(NSNotification *)aNotif
|
||||
- (void)buildDidTerminate
|
||||
{
|
||||
int status = [[aNotif object] terminationStatus];
|
||||
int status = [makeTask terminationStatus];
|
||||
|
||||
if ([aNotif object] == makeTask)
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: readHandle];
|
||||
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: errorReadHandle];
|
||||
|
||||
RELEASE (readHandle);
|
||||
RELEASE (errorReadHandle);
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: readHandle];
|
||||
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: errorReadHandle];
|
||||
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSTaskDidTerminateNotification
|
||||
object: makeTask];
|
||||
// RELEASE (readHandle);
|
||||
// RELEASE (errorReadHandle);
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
[self logString:
|
||||
[NSString stringWithFormat: @"=== %@ succeeded!", buildTarget]
|
||||
error: NO
|
||||
newLine: NO];
|
||||
[buildStatusField setStringValue: [NSString stringWithFormat: @"%@ - %@ succeeded...", [currentProject projectName], buildTarget]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self logString: [NSString stringWithFormat: @"=== %@ terminated!", buildTarget] error: NO newLine: NO];
|
||||
[buildStatusField setStringValue: [NSString stringWithFormat:
|
||||
@"%@ - %@ terminated...", [currentProject projectName], buildTarget]];
|
||||
}
|
||||
|
||||
// Rstore buttons state
|
||||
if ([buildTarget isEqualToString: @"Build"])
|
||||
{
|
||||
[buildButton setState: NSOffState];
|
||||
[cleanButton setEnabled:YES];
|
||||
[installButton setEnabled:YES];
|
||||
}
|
||||
else if ([buildTarget isEqualToString: @"Clean"])
|
||||
{
|
||||
[cleanButton setState: NSOffState];
|
||||
[buildButton setEnabled:YES];
|
||||
[installButton setEnabled:YES];
|
||||
}
|
||||
else if ([buildTarget isEqualToString: @"Install"])
|
||||
{
|
||||
[installButton setState: NSOffState];
|
||||
[buildButton setEnabled:YES];
|
||||
[cleanButton setEnabled:YES];
|
||||
}
|
||||
|
||||
[buildArgs removeAllObjects];
|
||||
[buildTarget setString: @"Default"];
|
||||
|
||||
/* RELEASE (makeTask);*/
|
||||
makeTask = nil;
|
||||
[self logString:
|
||||
[NSString stringWithFormat: @"=== %@ succeeded!", buildTarget]
|
||||
error: NO newLine: NO];
|
||||
[buildStatusField setStringValue:
|
||||
[NSString stringWithFormat:
|
||||
@"%@ - %@ succeeded...", [currentProject projectName], buildTarget]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self logString:
|
||||
[NSString stringWithFormat: @"=== %@ terminated!", buildTarget]
|
||||
error: NO newLine: NO];
|
||||
[buildStatusField setStringValue:
|
||||
[NSString stringWithFormat:
|
||||
@"%@ - %@ terminated...", [currentProject projectName], buildTarget]];
|
||||
}
|
||||
|
||||
// Rstore buttons state
|
||||
if ([buildTarget isEqualToString: @"Build"])
|
||||
{
|
||||
[buildButton setState: NSOffState];
|
||||
[cleanButton setEnabled: YES];
|
||||
[installButton setEnabled: YES];
|
||||
}
|
||||
else if ([buildTarget isEqualToString: @"Clean"])
|
||||
{
|
||||
[cleanButton setState: NSOffState];
|
||||
[buildButton setEnabled: YES];
|
||||
[installButton setEnabled: YES];
|
||||
}
|
||||
else if ([buildTarget isEqualToString: @"Install"])
|
||||
{
|
||||
[installButton setState: NSOffState];
|
||||
[buildButton setEnabled: YES];
|
||||
[cleanButton setEnabled: YES];
|
||||
}
|
||||
|
||||
[buildArgs removeAllObjects];
|
||||
[buildTarget setString: @"Default"];
|
||||
|
||||
RELEASE(makeTask);
|
||||
makeTask = nil;
|
||||
}
|
||||
|
||||
- (void)popupChanged:(id)sender
|
||||
|
@ -799,6 +790,8 @@
|
|||
postProcess = NULL;
|
||||
}
|
||||
|
||||
[self buildDidTerminate];
|
||||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,6 @@ enum {
|
|||
* Clean up...
|
||||
*
|
||||
*/
|
||||
|
||||
[NOTIFICATION_CENTER removeObserver:self
|
||||
name:NSFileHandleDataAvailableNotification
|
||||
object:readHandle];
|
||||
|
|
Loading…
Reference in a new issue