launch executable directly without openapp/opentool. Removed execToolName

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@28676 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2009-09-14 22:38:28 +00:00
parent 2fc703c5de
commit 05c75052d3
4 changed files with 36 additions and 17 deletions

View file

@ -1,3 +1,13 @@
2009-09-15 Riccardo Mottola <rmottola@users.sf.net>
* Headers/ProjectCenter/PCProject.h
* Framework/PCProject.m
Removed execToolName
* Framework/PCProjectLauncher.m
Launch executable directly without openapp/opentool and do not use
execToolName to determine the project type
2009-06-23 18:22-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Framework/PCProject.m

View file

@ -753,10 +753,6 @@ NSString
return NO;
}
- (NSString *)execToolName
{
return [[self projectBundleInfoTable] objectForKey:@"ExecToolName"];
}
- (NSArray *)buildTargets
{

View file

@ -286,24 +286,38 @@ enum {
- (void)run:(id)sender
{
NSMutableArray *args = [[NSMutableArray alloc] init];
NSPipe *logPipe;
NSPipe *errorPipe;
NSString *openPath;
NSMutableArray *args = [[NSMutableArray alloc] init];
NSPipe *logPipe;
NSPipe *errorPipe;
NSMutableString *executablePath;
executablePath = [NSMutableString string];
[executablePath appendString:[project projectPath]];
// Check if project type is executable
if ([project isExecutable])
{
openPath = [project execToolName];
if ([openPath isEqualToString: @"openapp"])
NSString *prjType;
prjType = [project projectTypeName];
NSLog(@"project is executable");
if ([prjType isEqualToString: @"Application"])
{
/* openapp ./MyApplication.app */
[args addObject: [NSString stringWithFormat: @"./%@", [project projectName]]];
/* MyApplication.app/MyApplication */
[executablePath appendString:@"/"];
[executablePath appendString:[project projectName]];
[executablePath appendString:@".app/"];
[executablePath appendString:[project projectName]];
}
else if ([prjType isEqualToString: @"Tool"])
{
/* obj/MyTool */
[executablePath appendString:@"/obj/"];
[executablePath appendString:[project projectName]];
}
else
{
/* opentool MyTool */
[args addObject: [project projectName]];
NSLog(@"Unknown project type to execute: %@", prjType);
}
}
else
@ -314,7 +328,7 @@ enum {
[runButton setState:NSOffState];
return;
}
NSLog(@"executable launch path: %@", executablePath);
// [makeTask isRunning] doesn't work here.
// "waitpid 7045, result -1, error No child processes" is printed.
if (launchTask)
@ -357,7 +371,7 @@ enum {
object:launchTask];
[launchTask setArguments:args];
[launchTask setCurrentDirectoryPath:[project projectPath]];
[launchTask setLaunchPath:openPath];
[launchTask setLaunchPath:executablePath];
[launchTask setStandardOutput:logPipe];
[launchTask setStandardError:errorPipe];
[launchTask launch];

View file

@ -138,7 +138,6 @@ extern NSString *PCProjectBreakpointNotification;
- (Class)builderClass;
- (NSString *)projectDescription;
- (BOOL)isExecutable;
- (NSString *)execToolName;
- (BOOL)canHavePublicHeaders;
- (NSArray *)publicHeaders;
- (void)setHeaderFile:(NSString *)file public:(BOOL)yn;