mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
Support for bundles
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12926 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
66bdfda587
commit
5561cc5006
2 changed files with 121 additions and 48 deletions
|
@ -25,8 +25,6 @@
|
|||
|
||||
- (void)appendString:(NSString *)aString;
|
||||
|
||||
- (void)appendApplication;
|
||||
|
||||
- (void)appendHeaders:(NSArray *)array;
|
||||
- (void)appendClasses:(NSArray *)array;
|
||||
- (void)appendCFiles:(NSArray *)array;
|
||||
|
@ -34,11 +32,7 @@
|
|||
- (void)appendResources;
|
||||
- (void)appendResourceItems:(NSArray *)array;
|
||||
|
||||
- (void)appendInstallDir:(NSString*)dir;
|
||||
- (void)appendAppIcon:(NSString*)icn;
|
||||
|
||||
- (void)appendSubprojects:(NSArray*)array;
|
||||
- (void)appendGuiLibraries:(NSArray*)array;
|
||||
|
||||
- (void)appendTailForApp;
|
||||
- (void)appendTailForLibrary;
|
||||
|
@ -50,5 +44,23 @@
|
|||
|
||||
@end
|
||||
|
||||
@interface PCMakefileFactory (ApplicationProject)
|
||||
|
||||
- (void)appendApplication;
|
||||
- (void)appendAppIcon:(NSString*)icn;
|
||||
- (void)appendGuiLibraries:(NSArray*)array;
|
||||
- (void)appendInstallDir:(NSString*)dir;
|
||||
|
||||
@end
|
||||
|
||||
@interface PCMakefileFactory (BundleProject)
|
||||
|
||||
- (void)appendBundle;
|
||||
- (void)appendPrincipalClass:(NSString *)cname;
|
||||
- (void)appendBundleInstallDir:(NSString*)dir;
|
||||
- (void)appendLibraries:(NSArray*)array;
|
||||
|
||||
@end
|
||||
|
||||
#endif // _PCMAKEFILEFACTORY_H_
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#define COMMENT_SUBPROJECTS @"\n\n#\n# Subprojects\n#\n\n"
|
||||
#define COMMENT_APP @"\n\n#\n# Main application\n#\n\n"
|
||||
#define COMMENT_LIBRARIES @"\n\n#\n# Additional libraries\n#\n\n"
|
||||
#define COMMENT_BUNDLE @"\n\n#\n# Bundle\n#\n\n"
|
||||
|
||||
@implementation PCMakefileFactory
|
||||
|
||||
|
@ -65,14 +66,6 @@ static PCMakefileFactory *_factory = nil;
|
|||
[mfile appendString:aString];
|
||||
}
|
||||
|
||||
- (void)appendApplication
|
||||
{
|
||||
[self appendString:COMMENT_APP];
|
||||
|
||||
[self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"APP_NAME=%@\n",pnme]];
|
||||
}
|
||||
|
||||
- (void)appendHeaders:(NSArray *)array
|
||||
{
|
||||
[self appendString:COMMENT_HEADERS];
|
||||
|
@ -140,18 +133,6 @@ static PCMakefileFactory *_factory = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)appendInstallDir:(NSString*)dir
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR=%@\n",dir]];
|
||||
}
|
||||
|
||||
- (void)appendAppIcon:(NSString*)icn
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"%@_APPLICATION_ICON=%@\n",pnme, icn]];
|
||||
}
|
||||
|
||||
- (void)appendSubprojects:(NSArray*)array
|
||||
{
|
||||
[self appendString:COMMENT_SUBPROJECTS];
|
||||
|
@ -168,27 +149,6 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
}
|
||||
|
||||
- (void)appendGuiLibraries:(NSArray*)array
|
||||
{
|
||||
[self appendString:COMMENT_LIBRARIES];
|
||||
[self appendString:@"ADDITIONAL_GUI_LIBS += "];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
if (![tmp isEqualToString:@"gnustep-base"] &&
|
||||
![tmp isEqualToString:@"gnustep-gui"])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendTailForApp
|
||||
{
|
||||
[self appendString:@"\n\n"];
|
||||
|
@ -212,7 +172,12 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
- (void)appendTailForBundle
|
||||
{
|
||||
[self appendString:@""];
|
||||
[self appendString:@"\n\n"];
|
||||
|
||||
[self appendString:@"-include GNUmakefile.preamble\n"];
|
||||
[self appendString:@"-include GNUmakefile.local\n"];
|
||||
[self appendString:@"include $(GNUSTEP_MAKEFILES)/bundle.make\n"];
|
||||
[self appendString:@"-include GNUmakefile.postamble\n"];
|
||||
}
|
||||
|
||||
- (void)appendTailForGormApp
|
||||
|
@ -228,3 +193,99 @@ static PCMakefileFactory *_factory = nil;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation PCMakefileFactory (ApplicationProject)
|
||||
|
||||
- (void)appendApplication
|
||||
{
|
||||
[self appendString:COMMENT_APP];
|
||||
|
||||
[self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"APP_NAME=%@\n",pnme]];
|
||||
}
|
||||
|
||||
- (void)appendAppIcon:(NSString*)icn
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"%@_APPLICATION_ICON=%@\n",pnme, icn]];
|
||||
}
|
||||
|
||||
- (void)appendGuiLibraries:(NSArray*)array
|
||||
{
|
||||
[self appendString:COMMENT_LIBRARIES];
|
||||
[self appendString:@"ADDITIONAL_GUI_LIBS += "];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
if (![tmp isEqualToString:@"gnustep-base"] &&
|
||||
![tmp isEqualToString:@"gnustep-gui"])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendInstallDir:(NSString*)dir
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR=%@\n",dir]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation PCMakefileFactory (BundleProject)
|
||||
|
||||
- (void)appendBundle
|
||||
{
|
||||
[self appendString:COMMENT_BUNDLE];
|
||||
|
||||
[self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"BUNDLE_NAME=%@\n",pnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"BUNDLE_EXTENSION=.bundle\n"]];
|
||||
|
||||
}
|
||||
|
||||
- (void)appendPrincipalClass:(NSString *)cname
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS=%@\n",pnme,cname]];
|
||||
|
||||
}
|
||||
|
||||
- (void)appendBundleInstallDir:(NSString*)dir
|
||||
{
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"BUNDLE_INSTALL_DIR=%@\n",dir]];
|
||||
}
|
||||
|
||||
- (void)appendLibraries:(NSArray*)array
|
||||
{
|
||||
[self appendString:COMMENT_LIBRARIES];
|
||||
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",pnme]];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
if (![tmp isEqualToString:@"gnustep-base"] &&
|
||||
![tmp isEqualToString:@"gnustep-gui"])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue