mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-22 11:21:29 +00:00
bugfixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/UNSTABLE_0_4@18954 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c075cc2665
commit
926cb09f05
26 changed files with 520 additions and 403 deletions
|
@ -119,6 +119,7 @@ ProjectCenter_RESOURCE_FILES = \
|
||||||
Resources/class.template \
|
Resources/class.template \
|
||||||
Resources/gsmarkup.template \
|
Resources/gsmarkup.template \
|
||||||
Resources/header.template \
|
Resources/header.template \
|
||||||
|
Resources/postamble.template \
|
||||||
Resources/protocol.template
|
Resources/protocol.template
|
||||||
|
|
||||||
-include GNUmakefile.preamble
|
-include GNUmakefile.preamble
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver:self
|
addObserver:self
|
||||||
selector:@selector(activeProjectDidChange:)
|
selector:@selector(activeProjectDidChange:)
|
||||||
name:ActiveProjectDidChangeNotification
|
name:PCActiveProjectDidChangeNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
if (![self setFrameUsingName: @"ProjectBuilder"])
|
if (![self setFrameUsingName: @"ProjectBuilder"])
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver:self
|
addObserver:self
|
||||||
selector:@selector(activeProjectDidChange:)
|
selector:@selector(activeProjectDidChange:)
|
||||||
name:ActiveProjectDidChangeNotification
|
name:PCActiveProjectDidChangeNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
if (![self setFrameUsingName: @"LoadedFiles"])
|
if (![self setFrameUsingName: @"LoadedFiles"])
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver:self
|
addObserver:self
|
||||||
selector:@selector(activeProjectDidChange:)
|
selector:@selector(activeProjectDidChange:)
|
||||||
name:ActiveProjectDidChangeNotification
|
name:PCActiveProjectDidChangeNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
if (![self setFrameUsingName: @"ProjectLauncher"])
|
if (![self setFrameUsingName: @"ProjectLauncher"])
|
||||||
|
|
|
@ -36,27 +36,14 @@
|
||||||
- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target;
|
- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target;
|
||||||
- (void)appendResources;
|
- (void)appendResources;
|
||||||
- (void)appendResourceItems:(NSArray *)array;
|
- (void)appendResourceItems:(NSArray *)array;
|
||||||
|
|
||||||
- (void)appendSubprojects:(NSArray*)array;
|
- (void)appendSubprojects:(NSArray*)array;
|
||||||
|
|
||||||
- (NSData *)encodedMakefile;
|
- (NSData *)encodedMakefile;
|
||||||
|
|
||||||
- (void)appendTailForLibrary;
|
|
||||||
- (void)appendTailForTool;
|
- (void)appendTailForTool;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface PCMakefileFactory (LibraryProject)
|
|
||||||
|
|
||||||
- (void)appendLibrary;
|
|
||||||
- (void)appendLibraryInstallDir:(NSString*)dir;
|
|
||||||
- (void)appendLibraryLibraries:(NSArray*)array;
|
|
||||||
- (void)appendLibraryHeaders:(NSArray*)array;
|
|
||||||
- (void)appendLibraryClasses:(NSArray *)array;
|
|
||||||
- (void)appendLibraryOtherSources:(NSArray *)array;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface PCMakefileFactory (ToolProject)
|
@interface PCMakefileFactory (ToolProject)
|
||||||
|
|
||||||
- (void)appendTool;
|
- (void)appendTool;
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
* Project ProjectCenter
|
* Project ProjectCenter
|
||||||
*
|
*
|
||||||
* Created with ProjectCenter - http://www.gnustep.org
|
* Created with ProjectCenter - http://www.gnustep.org
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PCDefines.h"
|
#include "PCDefines.h"
|
||||||
|
@ -281,22 +279,6 @@ static PCMakefileFactory *_factory = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should be removed
|
// Should be removed
|
||||||
- (void)appendTailForLibrary
|
|
||||||
{
|
|
||||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
NSString *hinst;
|
|
||||||
|
|
||||||
[self appendString:@"\n\n"];
|
|
||||||
|
|
||||||
hinst = [NSString stringWithFormat:@"HEADERS_INSTALL = $(%@_HEADER_FILES)\n\n",libnme];
|
|
||||||
[self appendString:hinst];
|
|
||||||
|
|
||||||
[self appendString:@"-include GNUmakefile.preamble\n"];
|
|
||||||
[self appendString:@"-include GNUmakefile.local\n"];
|
|
||||||
[self appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"];
|
|
||||||
[self appendString:@"-include GNUmakefile.postamble\n"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendTailForTool
|
- (void)appendTailForTool
|
||||||
{
|
{
|
||||||
[self appendString:@"\n\n"];
|
[self appendString:@"\n\n"];
|
||||||
|
@ -310,77 +292,6 @@ static PCMakefileFactory *_factory = nil;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation PCMakefileFactory (LibraryProject)
|
|
||||||
|
|
||||||
- (void)appendLibrary
|
|
||||||
{
|
|
||||||
NSString *libnme;
|
|
||||||
|
|
||||||
[self appendString:COMMENT_LIBRARY];
|
|
||||||
|
|
||||||
[self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]];
|
|
||||||
[self appendString:[NSString stringWithFormat:@"LIBRARY_VAR=%@\n",[pnme uppercaseString]]];
|
|
||||||
|
|
||||||
libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
[self appendString:[NSString stringWithFormat:@"LIBRARY_NAME=%@\n",libnme]];
|
|
||||||
|
|
||||||
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_DIR=.\n",libnme]];
|
|
||||||
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libnme,pnme]];
|
|
||||||
|
|
||||||
[self appendString:@"ADDITIONAL_INCLUDE_DIRS = -I..\n"];
|
|
||||||
[self appendString:@"srcdir = .\n"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendLibraryInstallDir:(NSString*)dir
|
|
||||||
{
|
|
||||||
[self appendString:[NSString stringWithFormat:@"%@_INSTALLATION_DIR=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]];
|
|
||||||
[self appendString:[NSString stringWithFormat:@"%@_INSTALL_PREFIX=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendLibraryLibraries:(NSArray*)array
|
|
||||||
{
|
|
||||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
|
|
||||||
[self appendString:COMMENT_LIBRARIES];
|
|
||||||
|
|
||||||
[self appendString:
|
|
||||||
[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",libnme]];
|
|
||||||
|
|
||||||
if( array && [array count] )
|
|
||||||
{
|
|
||||||
NSString *tmp;
|
|
||||||
NSEnumerator *enumerator = [array objectEnumerator];
|
|
||||||
|
|
||||||
while ((tmp = [enumerator nextObject]))
|
|
||||||
{
|
|
||||||
if (![tmp isEqualToString:@"gnustep-base"])
|
|
||||||
{
|
|
||||||
[self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendLibraryHeaders:(NSArray*)array
|
|
||||||
{
|
|
||||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
[self appendHeaders: array forTarget: libnme];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendLibraryClasses:(NSArray *)array
|
|
||||||
{
|
|
||||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
[self appendClasses: array forTarget: libnme];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)appendLibraryOtherSources:(NSArray *)array
|
|
||||||
{
|
|
||||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
|
||||||
[self appendOtherSources: array forTarget: libnme];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCMakefileFactory (ToolProject)
|
@implementation PCMakefileFactory (ToolProject)
|
||||||
|
|
||||||
- (void)appendTool
|
- (void)appendTool
|
||||||
|
|
|
@ -115,6 +115,8 @@ extern NSString *PCProjectDictDidSaveNotification;
|
||||||
// ==== To be overriden!
|
// ==== To be overriden!
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
- (BOOL)isEditableCategory:(NSString *)category;
|
||||||
|
|
||||||
// TEMP! For compatibility with old PC*Project subclasses
|
// TEMP! For compatibility with old PC*Project subclasses
|
||||||
- (void)updateValuesFromProjectDict;
|
- (void)updateValuesFromProjectDict;
|
||||||
|
|
||||||
|
|
|
@ -311,6 +311,14 @@ NSString
|
||||||
|
|
||||||
- (void)setProjectDictObject:(id)object forKey:(NSString *)key
|
- (void)setProjectDictObject:(id)object forKey:(NSString *)key
|
||||||
{
|
{
|
||||||
|
id currentObject = [projectDict objectForKey:key];
|
||||||
|
|
||||||
|
if ([object isKindOfClass:[NSString class]]
|
||||||
|
&& [currentObject isEqualToString:object])
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[projectDict setObject:object forKey:key];
|
[projectDict setObject:object forKey:key];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
|
@ -349,6 +357,25 @@ NSString
|
||||||
// ==== To be overriden
|
// ==== To be overriden
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
- (BOOL)isEditableCategory:(NSString *)category
|
||||||
|
{
|
||||||
|
NSString *key = [self keyForCategory:category];
|
||||||
|
|
||||||
|
if ([key isEqualToString:PCClasses]
|
||||||
|
|| [key isEqualToString:PCHeaders]
|
||||||
|
|| [key isEqualToString:PCSupportingFiles]
|
||||||
|
|| [key isEqualToString:PCDocuFiles]
|
||||||
|
|| [key isEqualToString:PCOtherSources]
|
||||||
|
|| [key isEqualToString:PCOtherResources]
|
||||||
|
|| [key isEqualToString:PCNonProject]
|
||||||
|
|| [key isEqualToString:PCGSMarkupFiles])
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
// TEMP! For compatibility with old PC*Project subclasses
|
// TEMP! For compatibility with old PC*Project subclasses
|
||||||
- (void)updateValuesFromProjectDict
|
- (void)updateValuesFromProjectDict
|
||||||
{
|
{
|
||||||
|
@ -585,6 +612,7 @@ NSString
|
||||||
[self addFiles:[NSArray arrayWithObjects:toFile,nil]
|
[self addFiles:[NSArray arrayWithObjects:toFile,nil]
|
||||||
forKey:selectedCategoryKey];
|
forKey:selectedCategoryKey];
|
||||||
|
|
||||||
|
NSLog(@"PCproject: move %@ to %@", fromPath, toPath);
|
||||||
[fm movePath:fromPath toPath:toPath handler:nil];
|
[fm movePath:fromPath toPath:toPath handler:nil];
|
||||||
|
|
||||||
[projectBrowser setPathForFile:toFile category:selectedCategory];
|
[projectBrowser setPathForFile:toFile category:selectedCategory];
|
||||||
|
|
|
@ -45,11 +45,10 @@ extern NSString *PCBrowserDidSetPathNotification;
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// ==== Accessor methods
|
// ==== Accessory methods
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
- (NSView *)view;
|
- (NSView *)view;
|
||||||
|
|
||||||
- (BOOL)isEditableCategory:(NSString *)category file: (NSString *)title;
|
|
||||||
- (NSString *)nameOfSelectedFile;
|
- (NSString *)nameOfSelectedFile;
|
||||||
- (NSString *)pathOfSelectedFile;
|
- (NSString *)pathOfSelectedFile;
|
||||||
- (NSArray *)selectedFiles;
|
- (NSArray *)selectedFiles;
|
||||||
|
|
|
@ -78,7 +78,7 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// ==== Accessor methods
|
// ==== Accessory methods
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
- (NSView *)view
|
- (NSView *)view
|
||||||
|
@ -86,31 +86,6 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
return browser;
|
return browser;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is responsibility of PC*Project classes
|
|
||||||
- (BOOL)isEditableCategory:(NSString *)category file:(NSString *)title
|
|
||||||
{
|
|
||||||
NSString *key = [project keyForCategory:category];
|
|
||||||
|
|
||||||
if ([key isEqualToString:PCClasses]
|
|
||||||
|| [key isEqualToString:PCHeaders]
|
|
||||||
|| [key isEqualToString:PCSupportingFiles]
|
|
||||||
|| [key isEqualToString:PCDocuFiles]
|
|
||||||
|| [key isEqualToString:PCOtherSources]
|
|
||||||
|| [key isEqualToString:PCOtherResources]
|
|
||||||
|| [key isEqualToString:PCNonProject])
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([key isEqualToString:PCGSMarkupFiles]
|
|
||||||
&& [[title pathExtension] isEqual: @"gorm"] == NO)
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)nameOfSelectedFile
|
- (NSString *)nameOfSelectedFile
|
||||||
{
|
{
|
||||||
NSString *name = nil;
|
NSString *name = nil;
|
||||||
|
@ -183,13 +158,18 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (void)click:(id)sender
|
- (void)click:(id)sender
|
||||||
{
|
{
|
||||||
|
if (sender != browser)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ([[sender selectedCell] isLeaf] && [[self selectedFiles] count] == 1)
|
if ([[sender selectedCell] isLeaf] && [[self selectedFiles] count] == 1)
|
||||||
{
|
{
|
||||||
NSString *category = [[sender selectedCellInColumn:0] stringValue];
|
NSString *category = [[sender selectedCellInColumn:0] stringValue];
|
||||||
NSString *fn = [[sender selectedCell] stringValue];
|
NSString *fn = [[sender selectedCell] stringValue];
|
||||||
NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn];
|
NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn];
|
||||||
|
|
||||||
if ([self isEditableCategory:category file:fn])
|
if ([project isEditableCategory:category])
|
||||||
{
|
{
|
||||||
[[project projectEditor] editorForFile:fp
|
[[project projectEditor] editorForFile:fp
|
||||||
category:category
|
category:category
|
||||||
|
@ -204,13 +184,18 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (void)doubleClick:(id)sender
|
- (void)doubleClick:(id)sender
|
||||||
{
|
{
|
||||||
|
if (sender != browser)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ([[sender selectedCell] isLeaf])
|
if ([[sender selectedCell] isLeaf])
|
||||||
{
|
{
|
||||||
NSString *category = [[sender selectedCellInColumn:0] stringValue];
|
NSString *category = [[sender selectedCellInColumn:0] stringValue];
|
||||||
NSString *fn = [[sender selectedCell] stringValue];
|
NSString *fn = [[sender selectedCell] stringValue];
|
||||||
NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn];
|
NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn];
|
||||||
|
|
||||||
if ([self isEditableCategory:category file: fn])
|
if ([project isEditableCategory:category])
|
||||||
{
|
{
|
||||||
[[project projectEditor] editorForFile:fp
|
[[project projectEditor] editorForFile:fp
|
||||||
category:category
|
category:category
|
||||||
|
@ -235,21 +220,17 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (void)projectDictDidChange:(NSNotification *)aNotif
|
- (void)projectDictDidChange:(NSNotification *)aNotif
|
||||||
{
|
{
|
||||||
if (browser)
|
if (browser && ([aNotif object] == project))
|
||||||
{
|
{
|
||||||
NSString *browserPath = [browser path];
|
NSString *browserPath = [browser path];
|
||||||
NSString *path = nil;
|
|
||||||
NSString *slctdCategory = [project selectedRootCategory];
|
NSString *slctdCategory = [project selectedRootCategory];
|
||||||
|
|
||||||
if (slctdCategory && browserPath && ![browserPath isEqualToString:@"/"])
|
if (slctdCategory && browserPath && ![browserPath isEqualToString:@"/"])
|
||||||
{
|
{
|
||||||
path = [[browserPath componentsSeparatedByString:@"/"]
|
|
||||||
objectAtIndex:1];
|
|
||||||
|
|
||||||
if ([[[project projectEditor] allEditors] count] == 0
|
if ([[[project projectEditor] allEditors] count] == 0
|
||||||
&& [self isEditableCategory:slctdCategory file:nil])
|
&& [project isEditableCategory:slctdCategory])
|
||||||
{
|
{
|
||||||
[self setPathForFile:nil category:path];
|
[self setPathForFile:nil category:slctdCategory];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,16 +244,20 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (void)browser:(NSBrowser *)sender createRowsForColumn:(int)column inMatrix:(NSMatrix *)matrix
|
- (void)browser:(NSBrowser *)sender createRowsForColumn:(int)column inMatrix:(NSMatrix *)matrix
|
||||||
{
|
{
|
||||||
NSString *pathToCol = [sender pathToColumn:column];
|
NSString *pathToCol = nil;
|
||||||
NSArray *files = [project contentAtCategoryPath:pathToCol];
|
NSArray *files = nil;
|
||||||
int i;
|
int i = 0;
|
||||||
int count = [files count];
|
int count = 0;
|
||||||
|
|
||||||
if (sender != browser)
|
if (sender != browser)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pathToCol = [sender pathToColumn:column];
|
||||||
|
files = [project contentAtCategoryPath:pathToCol];
|
||||||
|
count = [files count];
|
||||||
|
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
NSMutableString *categoryPath = nil;
|
NSMutableString *categoryPath = nil;
|
||||||
|
|
|
@ -192,6 +192,11 @@
|
||||||
|
|
||||||
- (int)numberOfRowsInTableView: (NSTableView *)aTableView
|
- (int)numberOfRowsInTableView: (NSTableView *)aTableView
|
||||||
{
|
{
|
||||||
|
if (aTableView != filesList)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return [editedFiles count];
|
return [editedFiles count];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,6 +204,11 @@
|
||||||
objectValueForTableColumn: (NSTableColumn *)aTableColumn
|
objectValueForTableColumn: (NSTableColumn *)aTableColumn
|
||||||
row: (int)rowIndex
|
row: (int)rowIndex
|
||||||
{
|
{
|
||||||
|
if (aTableView != filesList)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
return [editedFiles objectAtIndex: rowIndex];
|
return [editedFiles objectAtIndex: rowIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
- (void)mouseDown:(NSEvent *)theEvent
|
- (void)mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
[self setEditableField:YES];
|
[self setEditableField:YES];
|
||||||
// [super mouseDown:theEvent];
|
[super mouseDown:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)textShouldSetEditable
|
- (BOOL)textShouldSetEditable
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver:self
|
addObserver:self
|
||||||
selector:@selector(activeProjectDidChange:)
|
selector:@selector(activeProjectDidChange:)
|
||||||
name:ActiveProjectDidChangeNotification
|
name:PCActiveProjectDidChangeNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
[self inspectorPopupDidChange:inspectorPopup];
|
[self inspectorPopupDidChange:inspectorPopup];
|
||||||
|
@ -226,7 +226,8 @@
|
||||||
NSString *newEntry = [sender stringValue];
|
NSString *newEntry = [sender stringValue];
|
||||||
|
|
||||||
// Build Atributes
|
// Build Atributes
|
||||||
if (sender == installPathField)
|
if (sender == installPathField
|
||||||
|
&& ![[[project projectDict] objectForKey:PCInstallDir] isEqualToString:newEntry])
|
||||||
{
|
{
|
||||||
[project setProjectDictObject:newEntry forKey:PCInstallDir];
|
[project setProjectDictObject:newEntry forKey:PCInstallDir];
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include <ProjectCenter/ProjectDelegate.h>
|
#include <ProjectCenter/ProjectDelegate.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern NSString *ActiveProjectDidChangeNotification;
|
extern NSString *PCActiveProjectDidChangeNotification;
|
||||||
|
|
||||||
@interface PCProjectManager : NSObject <ProjectBuilder>
|
@interface PCProjectManager : NSObject <ProjectBuilder>
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
#define SavePeriodDCN @"SavePeriodDidChangeNotification"
|
#define SavePeriodDCN @"SavePeriodDidChangeNotification"
|
||||||
|
|
||||||
NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
||||||
|
|
||||||
@implementation PCProjectManager
|
@implementation PCProjectManager
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
||||||
[activeProject projectName]);
|
[activeProject projectName]);
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
postNotificationName:ActiveProjectDidChangeNotification
|
postNotificationName:PCActiveProjectDidChangeNotification
|
||||||
object:activeProject];
|
object:activeProject];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,22 +355,42 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
||||||
|
|
||||||
- (PCProject *)loadProjectAt:(NSString *)aPath
|
- (PCProject *)loadProjectAt:(NSString *)aPath
|
||||||
{
|
{
|
||||||
NSDictionary *projectFile = nil;
|
NSMutableDictionary *projectFile = nil;
|
||||||
NSString *projectTypeName = nil;
|
NSString *projectTypeName = nil;
|
||||||
NSString *projectClassName = nil;
|
NSString *projectClassName = nil;
|
||||||
id<ProjectType> projectCreator;
|
id<ProjectType> projectCreator;
|
||||||
PCProject *project = nil;
|
PCProject *project = nil;
|
||||||
|
|
||||||
projectFile = [NSDictionary dictionaryWithContentsOfFile:aPath];
|
projectFile = [NSMutableDictionary dictionaryWithContentsOfFile:aPath];
|
||||||
|
|
||||||
// For compatibility with 0.3.x projects
|
// For compatibility with 0.3.x projects
|
||||||
projectClassName = [projectFile objectForKey:PCProjectBuilderClass];
|
projectClassName = [projectFile objectForKey:PCProjectBuilderClass];
|
||||||
|
|
||||||
if (projectClassName == nil)
|
if (projectClassName == nil)
|
||||||
{
|
{
|
||||||
projectTypeName = [projectFile objectForKey:PCProjectType];
|
projectTypeName = [projectFile objectForKey:PCProjectType];
|
||||||
projectClassName = [[delegate projectTypes]objectForKey:projectTypeName];
|
projectClassName = [[delegate projectTypes]objectForKey:projectTypeName];
|
||||||
}
|
}
|
||||||
|
|
||||||
projectCreator = [NSClassFromString(projectClassName) sharedCreator];
|
projectCreator = [NSClassFromString(projectClassName) sharedCreator];
|
||||||
|
|
||||||
|
if (projectTypeName == nil)
|
||||||
|
{
|
||||||
|
NSString *pPath = nil;
|
||||||
|
|
||||||
|
pPath = [[aPath stringByDeletingLastPathComponent]
|
||||||
|
stringByAppendingPathComponent:@"PC.project"];
|
||||||
|
|
||||||
|
[[NSFileManager defaultManager] removeFileAtPath:aPath handler:nil];
|
||||||
|
|
||||||
|
[projectFile removeObjectForKey:PCProjectBuilderClass];
|
||||||
|
projectTypeName = [projectCreator projectTypeName];
|
||||||
|
[projectFile setObject:projectTypeName forKey:PCProjectType];
|
||||||
|
[projectFile writeToFile:pPath atomically:YES];
|
||||||
|
|
||||||
|
aPath = pPath;
|
||||||
|
}
|
||||||
|
|
||||||
if ((project = [projectCreator openProjectAt:aPath]))
|
if ((project = [projectCreator openProjectAt:aPath]))
|
||||||
{
|
{
|
||||||
NSLog (@"Project loaded as %@", [projectCreator projectTypeName]);
|
NSLog (@"Project loaded as %@", [projectCreator projectTypeName]);
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver:self
|
addObserver:self
|
||||||
selector:@selector(activeProjectDidChange:)
|
selector:@selector(activeProjectDidChange:)
|
||||||
name:ActiveProjectDidChangeNotification
|
name:PCActiveProjectDidChangeNotification
|
||||||
object:project];
|
object:project];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,6 @@ Resources/AppController.h \
|
||||||
Resources/AppController.m \
|
Resources/AppController.m \
|
||||||
Resources/main.m \
|
Resources/main.m \
|
||||||
Resources/PC.project \
|
Resources/PC.project \
|
||||||
Resources/GNUmakefile.preamble \
|
|
||||||
Resources/GNUmakefile.postamble \
|
|
||||||
Resources/Main.gorm \
|
Resources/Main.gorm \
|
||||||
Resources/Inspector.gorm
|
Resources/Inspector.gorm
|
||||||
|
|
||||||
|
|
|
@ -51,30 +51,6 @@ NSString *PCITextFieldGetFocus = @"PCITextFieldGetFocusNotification";
|
||||||
|
|
||||||
- (void)createProjectAttributes
|
- (void)createProjectAttributes
|
||||||
{
|
{
|
||||||
/* if (projectAttributesView)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Icons, Main NIB file, Help file
|
|
||||||
/* _iconsBox = [[NSBox alloc] init];
|
|
||||||
[_iconsBox setFrame:NSMakeRect(6,6,290,259)];
|
|
||||||
[_iconsBox setContentViewMargins:NSMakeSize(4.0, 4.0)];
|
|
||||||
[_iconsBox setTitlePosition:NSNoTitle];
|
|
||||||
[projectAttributesView addSubview:_iconsBox];*/
|
|
||||||
|
|
||||||
// Icon view
|
|
||||||
/* _iconViewBox = [[NSBox alloc] initWithFrame:NSMakeRect(220,189,56,56)];
|
|
||||||
[_iconViewBox setTitlePosition:NSNoTitle];
|
|
||||||
[_iconViewBox setBorderType:NSBezelBorder];
|
|
||||||
[_iconViewBox setContentViewMargins:NSMakeSize(2.0, 2.0)];
|
|
||||||
[_iconsBox addSubview:_iconViewBox];
|
|
||||||
RELEASE(_iconViewBox);
|
|
||||||
|
|
||||||
iconView = [[NSImageView alloc] initWithFrame:NSMakeRect(220,0,56,56)];
|
|
||||||
[_iconViewBox addSubview:iconView];
|
|
||||||
RELEASE(iconView);*/
|
|
||||||
|
|
||||||
// TFs Buttons
|
// TFs Buttons
|
||||||
[setFieldButton setRefusesFirstResponder:YES];
|
[setFieldButton setRefusesFirstResponder:YES];
|
||||||
[clearFieldButton setRefusesFirstResponder:YES];
|
[clearFieldButton setRefusesFirstResponder:YES];
|
||||||
|
|
|
@ -316,6 +316,10 @@
|
||||||
success = YES;
|
success = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ([super renameFile:ff toFile:tf] == YES)
|
||||||
|
{
|
||||||
|
success = YES;
|
||||||
|
}
|
||||||
|
|
||||||
[projectBrowser setPathForFile:toFile
|
[projectBrowser setPathForFile:toFile
|
||||||
category:[self categoryForKey:key]];
|
category:[self categoryForKey:key]];
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
$Id$
|
$Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Foundation/NSString.h>
|
|
||||||
#include <ProjectCenter/PCFileCreator.h>
|
#include <ProjectCenter/PCFileCreator.h>
|
||||||
|
|
||||||
#include "PCBundleProj.h"
|
#include "PCBundleProj.h"
|
||||||
|
@ -70,10 +69,10 @@ static PCBundleProj *_creator = nil;
|
||||||
if ([fm createDirectoryAtPath:path attributes:nil])
|
if ([fm createDirectoryAtPath:path attributes:nil])
|
||||||
{
|
{
|
||||||
NSBundle *projectBundle;
|
NSBundle *projectBundle;
|
||||||
|
NSMutableDictionary *projectDict;
|
||||||
NSString *_file;
|
NSString *_file;
|
||||||
NSString *_2file;
|
NSString *_2file;
|
||||||
// NSString *_resourcePath;
|
// NSString *_resourcePath;
|
||||||
NSMutableDictionary *projectDict;
|
|
||||||
PCFileCreator *pcfc = [PCFileCreator sharedCreator];
|
PCFileCreator *pcfc = [PCFileCreator sharedCreator];
|
||||||
|
|
||||||
project = [[[PCBundleProject alloc] init] autorelease];
|
project = [[[PCBundleProject alloc] init] autorelease];
|
||||||
|
@ -90,14 +89,6 @@ static PCBundleProj *_creator = nil;
|
||||||
[projectDict setObject:[path lastPathComponent] forKey:PCPrincipalClass];
|
[projectDict setObject:[path lastPathComponent] forKey:PCPrincipalClass];
|
||||||
|
|
||||||
// Copy the project files to the provided path
|
// Copy the project files to the provided path
|
||||||
_file = [projectBundle pathForResource:@"GNUmakefile"
|
|
||||||
ofType:@"postamble"];
|
|
||||||
_2file = [path stringByAppendingPathComponent:@"GNUmakefile.postamble"];
|
|
||||||
[fm copyPath:_file toPath:_2file handler:nil];
|
|
||||||
|
|
||||||
_file = [projectBundle pathForResource:@"GNUmakefile" ofType:@"preamble"];
|
|
||||||
_2file = [path stringByAppendingPathComponent:@"GNUmakefile.preamble"];
|
|
||||||
[fm copyPath:_file toPath:_2file handler:nil];
|
|
||||||
|
|
||||||
// $PROJECTNAME$.m
|
// $PROJECTNAME$.m
|
||||||
_file = [NSString stringWithFormat:@"%@", [path lastPathComponent]];
|
_file = [NSString stringWithFormat:@"%@", [path lastPathComponent]];
|
||||||
|
@ -140,15 +131,18 @@ static PCBundleProj *_creator = nil;
|
||||||
writeToFile:[path stringByAppendingPathComponent:@"PC.project"]
|
writeToFile:[path stringByAppendingPathComponent:@"PC.project"]
|
||||||
atomically:YES];
|
atomically:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (PCProject *)openProjectAt:(NSString *)path
|
- (PCProject *)openProjectAt:(NSString *)path
|
||||||
{
|
{
|
||||||
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
|
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
|
||||||
|
NSString *pPath = [path stringByDeletingLastPathComponent];
|
||||||
|
|
||||||
return [[[PCBundleProject alloc] initWithProjectDictionary:dict
|
return [[[PCBundleProject alloc]
|
||||||
path:[path stringByDeletingLastPathComponent]] autorelease];
|
initWithProjectDictionary:dict
|
||||||
|
path:pPath] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -40,31 +40,33 @@
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
rootKeys = [[NSArray arrayWithObjects: PCClasses,
|
rootKeys = [[NSArray arrayWithObjects:
|
||||||
PCHeaders,
|
PCClasses,
|
||||||
PCOtherSources,
|
PCHeaders,
|
||||||
PCInterfaces,
|
PCOtherSources,
|
||||||
PCImages,
|
PCInterfaces,
|
||||||
PCOtherResources,
|
PCImages,
|
||||||
PCSubprojects,
|
PCOtherResources,
|
||||||
PCDocuFiles,
|
PCSubprojects,
|
||||||
PCSupportingFiles,
|
PCDocuFiles,
|
||||||
PCLibraries,
|
PCSupportingFiles,
|
||||||
PCNonProject,
|
PCLibraries,
|
||||||
nil] retain];
|
PCNonProject,
|
||||||
|
nil] retain];
|
||||||
|
|
||||||
rootCategories = [[NSArray arrayWithObjects: @"Classes",
|
rootCategories = [[NSArray arrayWithObjects:
|
||||||
@"Headers",
|
@"Classes",
|
||||||
@"Other Sources",
|
@"Headers",
|
||||||
@"Interfaces",
|
@"Other Sources",
|
||||||
@"Images",
|
@"Interfaces",
|
||||||
@"Other Resources",
|
@"Images",
|
||||||
@"Subprojects",
|
@"Other Resources",
|
||||||
@"Documentation",
|
@"Subprojects",
|
||||||
@"Supporting Files",
|
@"Documentation",
|
||||||
@"Libraries",
|
@"Supporting Files",
|
||||||
@"Non Project Files",
|
@"Libraries",
|
||||||
nil] retain];
|
@"Non Project Files",
|
||||||
|
nil] retain];
|
||||||
|
|
||||||
rootEntries = [[NSDictionary
|
rootEntries = [[NSDictionary
|
||||||
dictionaryWithObjects:rootCategories forKeys:rootKeys] retain];
|
dictionaryWithObjects:rootCategories forKeys:rootKeys] retain];
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
LANGUAGE = "English";
|
LANGUAGE = "English";
|
||||||
LAST_EDITING = "";
|
LAST_EDITING = "";
|
||||||
LIBRARIES = ("gnustep-base","gnustep-gui");
|
LIBRARIES = ("gnustep-base","gnustep-gui");
|
||||||
MAININTERFACE = "";
|
|
||||||
MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)";
|
MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)";
|
||||||
INSTALLDIR = "$(HOME)/GNUstep/Library/Bundles";
|
INSTALLDIR = "$(HOME)/GNUstep/Library/Bundles";
|
||||||
OBJC_COMPILEROPTIONS = "";
|
OBJC_COMPILEROPTIONS = "";
|
||||||
|
|
|
@ -11,12 +11,6 @@
|
||||||
include $(GNUSTEP_MAKEFILES)/common.make
|
include $(GNUSTEP_MAKEFILES)/common.make
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Subprojects
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bundle
|
# Bundle
|
||||||
#
|
#
|
||||||
|
@ -37,8 +31,9 @@ LibraryProject_LIBRARIES_DEPEND_UPON += -lProjectCenter
|
||||||
#
|
#
|
||||||
|
|
||||||
LibraryProject_RESOURCE_FILES= \
|
LibraryProject_RESOURCE_FILES= \
|
||||||
PC.proj \
|
Resources/PC.project \
|
||||||
Version
|
Resources/Version \
|
||||||
|
Resources/Inspector.gorm
|
||||||
|
|
||||||
#
|
#
|
||||||
# Header files
|
# Header files
|
||||||
|
@ -64,3 +59,4 @@ LibraryProject_C_FILES=
|
||||||
|
|
||||||
include ../GNUmakefile.bundles
|
include ../GNUmakefile.bundles
|
||||||
include $(GNUSTEP_MAKEFILES)/bundle.make
|
include $(GNUSTEP_MAKEFILES)/bundle.make
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
You should have received a copy of the GNU General Public
|
You should have received a copy of the GNU General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PCLIBPROJ_H
|
#ifndef _PCLIBPROJ_H
|
||||||
|
@ -41,9 +39,7 @@
|
||||||
+ (id)sharedCreator;
|
+ (id)sharedCreator;
|
||||||
|
|
||||||
- (Class)projectClass;
|
- (Class)projectClass;
|
||||||
|
|
||||||
- (NSString *)projectTypeName;
|
- (NSString *)projectTypeName;
|
||||||
- (NSDictionary *)typeTable;
|
|
||||||
|
|
||||||
- (PCProject *)createProjectAt:(NSString *)path;
|
- (PCProject *)createProjectAt:(NSString *)path;
|
||||||
- (PCProject *)openProjectAt:(NSString *)path;
|
- (PCProject *)openProjectAt:(NSString *)path;
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
You should have received a copy of the GNU General Public
|
You should have received a copy of the GNU General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -31,12 +29,13 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ProjectCenter/PCFileCreator.h>
|
||||||
|
|
||||||
#include "PCLibProj.h"
|
#include "PCLibProj.h"
|
||||||
#include "PCLibProject.h"
|
#include "PCLibProject.h"
|
||||||
|
|
||||||
@implementation PCLibProj
|
@implementation PCLibProj
|
||||||
|
|
||||||
static NSString *_projTypeName = @"Library";
|
|
||||||
static PCLibProj *_creator = nil;
|
static PCLibProj *_creator = nil;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -45,97 +44,113 @@ static PCLibProj *_creator = nil;
|
||||||
|
|
||||||
+ (id)sharedCreator
|
+ (id)sharedCreator
|
||||||
{
|
{
|
||||||
if (!_creator) {
|
if (!_creator)
|
||||||
_creator = [[[self class] alloc] init];
|
{
|
||||||
|
_creator = [[[self class] alloc] init];
|
||||||
}
|
}
|
||||||
return _creator;
|
|
||||||
|
return _creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (Class)projectClass
|
- (Class)projectClass
|
||||||
{
|
{
|
||||||
return [PCLibProject class];
|
return [PCLibProject class];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)projectTypeName
|
- (NSString *)projectTypeName
|
||||||
{
|
{
|
||||||
return _projTypeName;
|
return @"Library";
|
||||||
}
|
|
||||||
|
|
||||||
- (NSDictionary *)typeTable
|
|
||||||
{
|
|
||||||
NSString *_path = [[NSBundle bundleForClass:[self class]] pathForResource:@"Info" ofType:@"table"];
|
|
||||||
|
|
||||||
return [NSDictionary dictionaryWithContentsOfFile:_path];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (PCProject *)createProjectAt:(NSString *)path
|
- (PCProject *)createProjectAt:(NSString *)path
|
||||||
{
|
{
|
||||||
PCLibProject *project = nil;
|
PCLibProject *project = nil;
|
||||||
NSFileManager *fm = [NSFileManager defaultManager];
|
NSFileManager *fm = [NSFileManager defaultManager];
|
||||||
|
|
||||||
NSAssert(path,@"No valid project path provided!");
|
NSAssert(path,@"No valid project path provided!");
|
||||||
|
|
||||||
if ([fm createDirectoryAtPath:path attributes:nil]) {
|
if ([fm createDirectoryAtPath:path attributes:nil])
|
||||||
NSString *_file;
|
{
|
||||||
//NSString *_resourcePath;
|
NSBundle *projectBundle = nil;
|
||||||
NSMutableDictionary *dict;
|
NSMutableDictionary *projectDict;
|
||||||
NSString *projectFile;
|
NSString *_file = nil;
|
||||||
|
NSString *_2file = nil;
|
||||||
|
// NSString *_resourcePath;
|
||||||
|
PCFileCreator *pcfc = [PCFileCreator sharedCreator];
|
||||||
|
|
||||||
project = [[[PCLibProject alloc] init] autorelease];
|
project = [[[PCLibProject alloc] init] autorelease];
|
||||||
|
projectBundle = [NSBundle bundleForClass:[self class]];
|
||||||
|
|
||||||
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"];
|
_file = [projectBundle pathForResource:@"PC" ofType:@"project"];
|
||||||
dict = [NSMutableDictionary dictionaryWithContentsOfFile:_file];
|
projectDict = [NSMutableDictionary dictionaryWithContentsOfFile:_file];
|
||||||
|
|
||||||
// Customise the project
|
|
||||||
[dict setObject:[path lastPathComponent] forKey:PCProjectName];
|
|
||||||
[dict setObject:[self projectTypeName] forKey:PCProjectType];
|
|
||||||
|
|
||||||
// Save the project to disc
|
// Customise the project
|
||||||
projectFile = [NSString stringWithString:[path lastPathComponent]];
|
[project setProjectName:[path lastPathComponent]];
|
||||||
projectFile = [projectFile stringByAppendingPathExtension:@"pcproj"];
|
[projectDict setObject:[path lastPathComponent] forKey:PCProjectName];
|
||||||
[dict writeToFile:[path stringByAppendingPathComponent:projectFile]
|
[projectDict setObject:[self projectTypeName] forKey:PCProjectType];
|
||||||
atomically:YES];
|
|
||||||
|
|
||||||
// Copy the project files to the provided path
|
// Copy the project files to the provided path
|
||||||
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"];
|
|
||||||
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.postamble"] handler:nil];
|
|
||||||
|
|
||||||
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"preamble"];
|
|
||||||
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.preamble"] handler:nil];
|
|
||||||
|
|
||||||
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"main" ofType:@"m"];
|
// $PROJECTNAME$.m
|
||||||
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"main.m"] handler:nil];
|
_file = [NSString stringWithFormat:@"%@", [path lastPathComponent]];
|
||||||
|
_2file = [NSString stringWithFormat:@"%@.m", [path lastPathComponent]];
|
||||||
|
[pcfc createFileOfType:ObjCClass
|
||||||
|
path:[path stringByAppendingPathComponent:_file]
|
||||||
|
project:project];
|
||||||
|
[projectDict setObject:[NSArray arrayWithObjects:_2file,nil]
|
||||||
|
forKey:PCClasses];
|
||||||
|
|
||||||
// Resources
|
// $PROJECTNAME$.h already created by creating $PROJECTNAME$.m
|
||||||
/*
|
_file = [NSString stringWithFormat:@"%@.h", [path lastPathComponent]];
|
||||||
_resourcePath = [path stringByAppendingPathComponent:@"English.lproj"];
|
[projectDict setObject:[NSArray arrayWithObjects:_file,nil]
|
||||||
[fm createDirectoryAtPath:_resourcePath attributes:nil];
|
forKey:PCHeaders];
|
||||||
*/
|
|
||||||
|
|
||||||
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil];
|
// Resources
|
||||||
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Version" ofType:@""];
|
/*
|
||||||
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"Version"] handler:nil];
|
_resourcePath = [path stringByAppendingPathComponent:@"English.lproj"];
|
||||||
|
[fm createDirectoryAtPath:_resourcePath attributes:nil];
|
||||||
|
*/
|
||||||
|
_file = [path stringByAppendingPathComponent:@"Images"];
|
||||||
|
[fm createDirectoryAtPath:_file attributes:nil];
|
||||||
|
_file = [path stringByAppendingPathComponent:@"Documentation"];
|
||||||
|
[fm createDirectoryAtPath:_file attributes:nil];
|
||||||
|
|
||||||
// The path cannot be in the PC.project file!
|
_file = [projectBundle pathForResource:@"Version" ofType:@""];
|
||||||
[project setProjectPath:path];
|
_2file = [path stringByAppendingPathComponent:@"Version"];
|
||||||
|
[fm copyPath:_file toPath:_2file handler:nil];
|
||||||
|
|
||||||
|
// The path cannot be in the PC.project file!
|
||||||
|
[project setProjectPath:path];
|
||||||
|
|
||||||
|
// Set the new dictionary - this causes the GNUmakefile
|
||||||
|
// to be written to disc
|
||||||
|
if (![project assignProjectDict:projectDict])
|
||||||
|
{
|
||||||
|
NSRunAlertPanel(@"Attention!",
|
||||||
|
@"Could not load %@!",
|
||||||
|
@"OK",nil,nil,path);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the project to disc
|
||||||
|
[projectDict
|
||||||
|
writeToFile:[path stringByAppendingPathComponent:@"PC.project"]
|
||||||
|
atomically:YES];
|
||||||
|
|
||||||
// Set the new dictionary - this causes the GNUmakefile to be written to disc
|
|
||||||
if(![project assignProjectDict:dict]) {
|
|
||||||
NSRunAlertPanel(@"Attention!",@"Could not load %@!",@"OK",nil,nil,path);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return project;
|
|
||||||
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (PCProject *)openProjectAt:(NSString *)path
|
- (PCProject *)openProjectAt:(NSString *)path
|
||||||
{
|
{
|
||||||
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
|
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
|
||||||
|
NSString *pPath = [path stringByDeletingLastPathComponent];
|
||||||
if ([[dict objectForKey:PCProjectBuilderClass] isEqualToString:@"PCLibProj"]) {
|
|
||||||
return [[[PCLibProject alloc] initWithProjectDictionary:dict path:[path stringByDeletingLastPathComponent]] autorelease];
|
return [[[PCLibProject alloc] initWithProjectDictionary:dict
|
||||||
}
|
path:pPath] autorelease];
|
||||||
return nil;
|
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -20,16 +20,14 @@
|
||||||
You should have received a copy of the GNU General Public
|
You should have received a copy of the GNU General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Description:
|
Description:
|
||||||
|
|
||||||
This is the project type 'Application' for GNUstep. You never should create it yourself but
|
|
||||||
use PCLibProj for doing this. Otherwise needed files don't get copied to the right place.
|
|
||||||
|
|
||||||
|
This is the project type 'Library' for GNUstep. You never should create it
|
||||||
|
yourself but use PCLibProj for doing this. Otherwise needed files don't get
|
||||||
|
copied to the right place.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PCLIBPROJECT_H
|
#ifndef _PCLIBPROJECT_H
|
||||||
|
@ -38,8 +36,14 @@
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
#include <ProjectCenter/PCProject.h>
|
#include <ProjectCenter/PCProject.h>
|
||||||
|
|
||||||
|
@class PCMakefileFactory;
|
||||||
|
|
||||||
@interface PCLibProject : PCProject
|
@interface PCLibProject : PCProject
|
||||||
{
|
{
|
||||||
|
IBOutlet NSBox *projectAttributesView;
|
||||||
|
IBOutlet NSTextField *projectTypeField;
|
||||||
|
IBOutlet NSTextField *projectNameField;
|
||||||
|
IBOutlet NSTextField *projectLanguageField;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -49,22 +53,23 @@
|
||||||
- (id)init;
|
- (id)init;
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
@end
|
||||||
// Project
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- (Class)builderClass;
|
@interface PCLibProject (GeneratedFiles)
|
||||||
|
|
||||||
- (BOOL)writeMakefile;
|
- (BOOL)writeMakefile;
|
||||||
|
- (void)appendHead:(PCMakefileFactory *)mff;
|
||||||
- (NSArray *)sourceFileKeys;
|
- (void)appendLibraries:(PCMakefileFactory*)mff;
|
||||||
- (NSArray *)resourceFileKeys;
|
- (void)appendTail:(PCMakefileFactory *)mff;
|
||||||
- (NSArray *)otherKeys;
|
|
||||||
- (NSArray *)buildTargets;
|
|
||||||
- (NSString *)projectDescription;
|
|
||||||
|
|
||||||
- (void)updateValuesFromProjectDict;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface PCLibProject (Inspector)
|
||||||
|
|
||||||
|
- (NSView *)projectAttributesView;
|
||||||
|
- (void)updateInspectorValues:(NSNotification *)aNotif;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -51,33 +51,36 @@
|
||||||
|
|
||||||
- (id)init
|
- (id)init
|
||||||
{
|
{
|
||||||
if ((self = [super init])) {
|
if ((self = [super init]))
|
||||||
rootKeys = [[NSArray arrayWithObjects: PCClasses,
|
{
|
||||||
PCHeaders,
|
rootKeys = [[NSArray arrayWithObjects:
|
||||||
PCOtherSources,
|
PCClasses,
|
||||||
PCOtherResources,
|
PCHeaders,
|
||||||
PCSubprojects,
|
PCOtherSources,
|
||||||
PCDocuFiles,
|
PCOtherResources,
|
||||||
PCSupportingFiles,
|
PCSubprojects,
|
||||||
PCLibraries,
|
PCDocuFiles,
|
||||||
PCNonProject,
|
PCSupportingFiles,
|
||||||
nil] retain];
|
PCLibraries,
|
||||||
|
PCNonProject,
|
||||||
|
nil] retain];
|
||||||
|
|
||||||
rootCategories = [[NSArray arrayWithObjects: @"Classes",
|
rootCategories = [[NSArray arrayWithObjects:
|
||||||
@"Headers",
|
@"Classes",
|
||||||
@"Other Sources",
|
@"Headers",
|
||||||
@"Other Resources",
|
@"Other Sources",
|
||||||
@"Subprojects",
|
@"Other Resources",
|
||||||
@"Documentation",
|
@"Subprojects",
|
||||||
@"Supporting Files",
|
@"Documentation",
|
||||||
@"Libraries",
|
@"Supporting Files",
|
||||||
@"Non Project Files",
|
@"Libraries",
|
||||||
nil] retain];
|
@"Non Project Files",
|
||||||
|
nil] retain];
|
||||||
|
|
||||||
rootEntries = [[NSDictionary
|
rootEntries = [[NSDictionary
|
||||||
dictionaryWithObjects:rootCategories forKeys:rootKeys] retain];
|
dictionaryWithObjects:rootCategories forKeys:rootKeys] retain];
|
||||||
|
}
|
||||||
}
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +89,7 @@
|
||||||
[rootCategories release];
|
[rootCategories release];
|
||||||
[rootKeys release];
|
[rootKeys release];
|
||||||
[rootEntries release];
|
[rootEntries release];
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,76 +99,261 @@
|
||||||
|
|
||||||
- (Class)builderClass
|
- (Class)builderClass
|
||||||
{
|
{
|
||||||
return [PCLibProj class];
|
return [PCLibProj class];
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)writeMakefile
|
|
||||||
{
|
|
||||||
NSData *mfd;
|
|
||||||
NSString *mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
|
|
||||||
PCMakefileFactory *mf = [PCMakefileFactory sharedFactory];
|
|
||||||
NSDictionary *dict = [self projectDict];
|
|
||||||
|
|
||||||
// Save the project file
|
|
||||||
[super writeMakefile];
|
|
||||||
|
|
||||||
[mf createMakefileForProject:[self projectName]];
|
|
||||||
[mf appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"];
|
|
||||||
[mf appendString:@"include Version\n"];
|
|
||||||
[mf appendSubprojects:[dict objectForKey:PCSubprojects]];
|
|
||||||
|
|
||||||
[mf appendLibrary];
|
|
||||||
[mf appendLibraryInstallDir:[dict objectForKey:PCInstallDir]];
|
|
||||||
[mf appendLibraryLibraries:[dict objectForKey:PCLibraries]];
|
|
||||||
|
|
||||||
[mf appendLibraryHeaders:[dict objectForKey:PCHeaders]];
|
|
||||||
[mf appendLibraryClasses:[dict objectForKey:PCClasses]];
|
|
||||||
[mf appendLibraryOtherSources:[dict objectForKey:PCOtherSources]];
|
|
||||||
|
|
||||||
[mf appendTailForLibrary];
|
|
||||||
|
|
||||||
// Write the new file to disc!
|
|
||||||
if ((mfd = [mf encodedMakefile]))
|
|
||||||
{
|
|
||||||
if ([mfd writeToFile:mfl atomically:YES])
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)sourceFileKeys
|
|
||||||
{
|
|
||||||
return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)resourceFileKeys
|
|
||||||
{
|
|
||||||
return [NSArray array];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)otherKeys
|
|
||||||
{
|
|
||||||
return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)buildTargets
|
|
||||||
{
|
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)projectDescription
|
- (NSString *)projectDescription
|
||||||
{
|
{
|
||||||
return @"Project that handles GNUstep/ObjC based libraries.";
|
return @"GNUstep Objective-C library project";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateValuesFromProjectDict
|
- (BOOL)isExecutable
|
||||||
{
|
{
|
||||||
[super updateValuesFromProjectDict];
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
//[appClassField setStringValue:[projectDict objectForKey:PCAppClass]];
|
- (NSString *)execToolName
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)fileTypesForCategory:(NSString *)category
|
||||||
|
{
|
||||||
|
if ([category isEqualToString:PCClasses])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"m",nil];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCHeaders])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"h",nil];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCOtherSources])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"c",@"C",nil];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCInterfaces])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"gmodel",@"gorm",nil];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCImages])
|
||||||
|
{
|
||||||
|
return [NSImage imageFileTypes];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCSubprojects])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"subproj",nil];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCLibraries])
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)dirForCategory:(NSString *)category
|
||||||
|
{
|
||||||
|
if ([category isEqualToString:PCImages])
|
||||||
|
{
|
||||||
|
return [projectPath stringByAppendingPathComponent:@"Images"];
|
||||||
|
}
|
||||||
|
else if ([category isEqualToString:PCDocuFiles])
|
||||||
|
{
|
||||||
|
return [projectPath stringByAppendingPathComponent:@"Documentation"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return projectPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)buildTargets
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:
|
||||||
|
@"library", @"debug", @"profile", @"dist", nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)sourceFileKeys
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)resourceFileKeys
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:PCInterfaces,PCOtherResources,PCImages,nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)otherKeys
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)allowableSubprojectTypes
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:
|
||||||
|
@"Bundle", @"Tool", @"Palette", nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)defaultLocalizableKeys
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:PCInterfaces, nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)localizableKeys
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects:
|
||||||
|
PCInterfaces, PCImages, PCOtherResources, PCDocuFiles, nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation PCLibProject (GeneratedFiles)
|
||||||
|
|
||||||
|
- (BOOL)writeMakefile
|
||||||
|
{
|
||||||
|
PCMakefileFactory *mf = [PCMakefileFactory sharedFactory];
|
||||||
|
int i,j;
|
||||||
|
NSString *mfl = nil;
|
||||||
|
NSData *mfd = nil;
|
||||||
|
|
||||||
|
// Save the GNUmakefile backup
|
||||||
|
[super writeMakefile];
|
||||||
|
|
||||||
|
// Save GNUmakefile.preamble
|
||||||
|
[mf createPreambleForProject:self];
|
||||||
|
|
||||||
|
// Create the new file
|
||||||
|
[mf createMakefileForProject:projectName];
|
||||||
|
|
||||||
|
// Head
|
||||||
|
[self appendHead:mf];
|
||||||
|
|
||||||
|
// Libraries
|
||||||
|
[self appendLibraries:mf];
|
||||||
|
|
||||||
|
// Subprojects
|
||||||
|
if ([[projectDict objectForKey:PCSubprojects] count] > 0)
|
||||||
|
{
|
||||||
|
[mf appendSubprojects:[projectDict objectForKey:PCSubprojects]];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resources
|
||||||
|
[mf appendResources];
|
||||||
|
for (i = 0; i < [[self resourceFileKeys] count]; i++)
|
||||||
|
{
|
||||||
|
NSString *k = [[self resourceFileKeys] objectAtIndex:i];
|
||||||
|
NSMutableArray *resources = [[projectDict objectForKey:k] mutableCopy];
|
||||||
|
|
||||||
|
if ([k isEqualToString:PCImages])
|
||||||
|
{
|
||||||
|
for (j=0; j<[resources count]; j++)
|
||||||
|
{
|
||||||
|
[resources replaceObjectAtIndex:j
|
||||||
|
withObject:[NSString stringWithFormat:@"Images/%@",
|
||||||
|
[resources objectAtIndex:j]]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[mf appendResourceItems:resources];
|
||||||
|
[resources release];
|
||||||
|
}
|
||||||
|
|
||||||
|
[mf appendHeaders:[projectDict objectForKey:PCHeaders]
|
||||||
|
forTarget:[NSString stringWithFormat:@"lib%@",projectName]];
|
||||||
|
[mf appendClasses:[projectDict objectForKey:PCClasses]
|
||||||
|
forTarget:[NSString stringWithFormat:@"lib%@",projectName]];
|
||||||
|
[mf appendOtherSources:[projectDict objectForKey:PCOtherSources]
|
||||||
|
forTarget:[NSString stringWithFormat:@"lib%@",projectName]];
|
||||||
|
|
||||||
|
// Tail
|
||||||
|
[self appendTail:mf];
|
||||||
|
|
||||||
|
// Write the new file to disc!
|
||||||
|
mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
|
||||||
|
if ((mfd = [mf encodedMakefile]))
|
||||||
|
{
|
||||||
|
if ([mfd writeToFile:mfl atomically:YES])
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)appendHead:(PCMakefileFactory *)mff
|
||||||
|
{
|
||||||
|
[mff appendString:@"\n#\n# Bundle\n#\n"];
|
||||||
|
[mff appendString:[NSString stringWithFormat:@"PACKAGE_NAME = %@\n",
|
||||||
|
projectName]];
|
||||||
|
[mff appendString:[NSString stringWithFormat:@"LIBRARY_VAR = %@\n",
|
||||||
|
[projectName uppercaseString]]];
|
||||||
|
[mff appendString:[NSString stringWithFormat:@"LIBRARY_NAME = lib%@\n",
|
||||||
|
projectName]];
|
||||||
|
[mff appendString:[NSString stringWithFormat:@"lib%@_HEADER_FILES_DIR = %@\n",
|
||||||
|
projectName,@"."]];
|
||||||
|
[mff appendString:[NSString stringWithFormat:
|
||||||
|
@"lib%@_HEADER_FILES_INSTALL_DIR = /%@\n", projectName, projectName]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)appendLibraries:(PCMakefileFactory *)mff
|
||||||
|
{
|
||||||
|
NSArray *libs = [projectDict objectForKey:PCLibraries];
|
||||||
|
|
||||||
|
[mff appendString:@"\n#\n# Libraries\n#\n"];
|
||||||
|
|
||||||
|
[mff appendString:
|
||||||
|
[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",projectName]];
|
||||||
|
|
||||||
|
if (libs && [libs count])
|
||||||
|
{
|
||||||
|
NSString *tmp;
|
||||||
|
NSEnumerator *enumerator = [libs objectEnumerator];
|
||||||
|
|
||||||
|
while ((tmp = [enumerator nextObject]))
|
||||||
|
{
|
||||||
|
if (![tmp isEqualToString:@"gnustep-base"] &&
|
||||||
|
![tmp isEqualToString:@"gnustep-gui"])
|
||||||
|
{
|
||||||
|
[mff appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)appendTail:(PCMakefileFactory *)mff
|
||||||
|
{
|
||||||
|
[mff appendString:@"\n\n#\n# Makefiles\n#\n"];
|
||||||
|
[mff appendString:@"-include GNUmakefile.preamble\n"];
|
||||||
|
[mff appendString:@"include $(GNUSTEP_MAKEFILES)/aggregate.make\n"];
|
||||||
|
[mff appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"];
|
||||||
|
[mff appendString:@"-include GNUmakefile.postamble\n"];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation PCLibProject (Inspector)
|
||||||
|
|
||||||
|
- (NSView *)projectAttributesView
|
||||||
|
{
|
||||||
|
if (projectAttributesView == nil)
|
||||||
|
{
|
||||||
|
if ([NSBundle loadNibNamed:@"Inspector" owner:self] == NO)
|
||||||
|
{
|
||||||
|
NSLog(@"PCLibraryProject: error loading Inspector NIB!");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
[projectAttributesView retain];
|
||||||
|
[self updateInspectorValues:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
return projectAttributesView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateInspectorValues:(NSNotification *)aNotif
|
||||||
|
{
|
||||||
|
[projectTypeField setStringValue:@"Library"];
|
||||||
|
[projectNameField setStringValue:projectName];
|
||||||
|
[projectLanguageField setStringValue:[projectDict objectForKey:@"LANGUAGE"]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue