From bd0f495c2ddb414a4f313c021f7a5a316bec98a0 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Tue, 30 Mar 2004 16:09:38 +0000 Subject: [PATCH] TooProject update related cleanups git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/UNSTABLE_0_4@18975 72102866-910b-0410-8b05-ffd578937521 --- GNUmakefile | 4 +- Library/PCDefines.h | 15 +++- Library/PCMakefileFactory.h | 46 ++++++----- Library/PCMakefileFactory.m | 81 ++++++------------- Library/PCProject.h | 36 ++++----- Library/PCProject.m | 41 +++++----- Library/Resources/cfile.template | 2 +- Library/Resources/cheader.template | 2 +- Library/Resources/class.template | 2 +- Library/Resources/header.template | 2 +- Library/Resources/protocol.template | 2 +- .../Resources/AppController.h | 4 +- .../Resources/AppController.m | 4 +- Modules/ApplicationProject/Resources/main.m | 2 +- Modules/BundleProject/Resources/PC.project | 1 - Modules/GNUmakefile | 4 +- Modules/LibraryProject/PCLibProj.m | 1 - Modules/LibraryProject/PCLibProject.m | 18 +---- Modules/LibraryProject/Resources/PC.project | 1 - .../Resources/AppController.h | 8 +- .../Resources/AppController.m | 8 +- Modules/RenaissanceProject/Resources/main.m | 8 ++ 22 files changed, 132 insertions(+), 160 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 2413bcf..a6fbfcb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -80,8 +80,8 @@ Images/subprojectSuitcaseH.tiff \ Modules/ApplicationProject/ApplicationProject.bundle \ Modules/BundleProject/BundleProject.bundle \ Modules/LibraryProject/LibraryProject.bundle \ -Modules/ToolProject/ToolProject.bundle \ -Modules/RenaissanceProject/RenaissanceProject.bundle +Modules/RenaissanceProject/RenaissanceProject.bundle \ +Modules/ToolProject/ToolProject.bundle # diff --git a/Library/PCDefines.h b/Library/PCDefines.h index b358151..a7ed162 100644 --- a/Library/PCDefines.h +++ b/Library/PCDefines.h @@ -171,7 +171,6 @@ static NSString * const PCLibraries = @"LIBRARIES"; static NSString * const PCNonProject = @"NON_PROJECT_FILES"; static NSString * const PCGSMarkupFiles = @"INTERFACES"; -static NSString * const PCAppIcon = @"APPLICATIONICON"; static NSString * const PCBuildTool = @"BUILDTOOL"; static NSString * const PCCompilerOptions = @"COMPILEROPTIONS"; static NSString * const PCPreprocessorOptions = @"CPPOPTIONS"; @@ -200,17 +199,25 @@ static NSString * const PCSearchHeaders = @"SEARCH_HEADER_DIRS"; static NSString * const PCSearchLibs = @"SEARCH_LIB_DIRS"; // Application specific +static NSString * const PCAppIcon = @"APPLICATIONICON"; static NSString * const PCMainInterfaceFile = @"MAININTERFACE"; static NSString * const PCHelpFile = @"HELP_FILE"; +// Library specific +static NSString * const PCHeadersToInstall = @"HEADERS_TO_INSTALL"; +static NSString * const PCHeadersInstallDir = @"HEADERS_INSTALL_DIR"; + // Bundle specific static NSString * const PCBundleExtension = @"BUNDLE_EXTENSION"; -// Uncategorized -static NSString * const PCToolIcon = @"TOOLICON"; -static NSString * const PCProjectBuilderClass = @"PROJECT_BUILDER"; // Will be removed +// Tool specific +static NSString * const PCToolIcon = @"TOOL_ICON"; + static NSString * const PCPackageName = @"PACKAGE_NAME"; static NSString * const PCLibraryVar = @"LIBRARY_VAR"; +// Will be removed +static NSString * const PCProjectBuilderClass = @"PROJECT_BUILDER"; + #endif // _PCDEFINES_H_ diff --git a/Library/PCMakefileFactory.h b/Library/PCMakefileFactory.h index aaa9241..b242b83 100644 --- a/Library/PCMakefileFactory.h +++ b/Library/PCMakefileFactory.h @@ -1,12 +1,26 @@ -/* - * PCMakefileFactory.h created by probert on 2002-02-28 22:16:26 +0000 - * - * Project ProjectCenter - * - * Created with ProjectCenter - http://www.gnustep.org - * - * $Id$ - */ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2002 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ #ifndef _PCMAKEFILEFACTORY_H_ #define _PCMAKEFILEFACTORY_H_ @@ -17,8 +31,8 @@ @interface PCMakefileFactory : NSObject { - NSMutableString *mfile; - NSString *pnme; + NSMutableString *mfile; + NSString *pnme; } + (PCMakefileFactory *)sharedFactory; @@ -41,16 +55,6 @@ - (NSData *)encodedMakefile; -- (void)appendTailForTool; - -@end - -@interface PCMakefileFactory (ToolProject) - -- (void)appendTool; -- (void)appendToolIcon:(NSString*)icn; -- (void)appendToolLibraries:(NSArray*)array; - @end #endif // _PCMAKEFILEFACTORY_H_ diff --git a/Library/PCMakefileFactory.m b/Library/PCMakefileFactory.m index f43496d..2f4965d 100644 --- a/Library/PCMakefileFactory.m +++ b/Library/PCMakefileFactory.m @@ -1,10 +1,26 @@ -/* - * PCMakefileFactory.m created by probert on 2002-02-28 22:16:25 +0000 - * - * Project ProjectCenter - * - * Created with ProjectCenter - http://www.gnustep.org - */ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2002 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ #include "PCDefines.h" #include "PCProject.h" @@ -309,56 +325,5 @@ static PCMakefileFactory *_factory = nil; return [mfile dataUsingEncoding:[NSString defaultCStringEncoding]]; } -// Should be removed -- (void)appendTailForTool -{ - [self appendString:@"\n\n"]; - - [self appendString:@"-include GNUmakefile.preamble\n"]; - [self appendString:@"-include GNUmakefile.local\n"]; - [self appendString:@"include $(GNUSTEP_MAKEFILES)/aggregate.make\n"]; - [self appendString:@"include $(GNUSTEP_MAKEFILES)/tool.make\n"]; - [self appendString:@"-include GNUmakefile.postamble\n"]; -} - -@end - -@implementation PCMakefileFactory (ToolProject) - -- (void)appendTool -{ - [self appendString:COMMENT_TOOL]; - - [self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]]; - [self appendString:[NSString stringWithFormat:@"TOOL_NAME=%@\n",pnme]]; -} - -- (void)appendToolIcon:(NSString*)icn -{ - [self appendString: - [NSString stringWithFormat:@"%@_TOOL_ICON=%@\n",pnme, icn]]; -} - -- (void)appendToolLibraries:(NSArray*)array -{ - [self appendString:COMMENT_LIBRARIES]; - - [self appendString:[NSString stringWithFormat:@"%@_TOOL_LIBS += ",pnme]]; - - 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]]; - } - } - } -} - @end diff --git a/Library/PCProject.h b/Library/PCProject.h index b704a51..b87997f 100644 --- a/Library/PCProject.h +++ b/Library/PCProject.h @@ -59,16 +59,12 @@ extern NSString *PCProjectDictDidSaveNotification; NSView *builderContentView; NSView *debuggerContentView; - // For compatibility. Should be changed later - NSView *projectProjectInspectorView; - // - NSMutableDictionary *projectDict; NSString *projectName; NSString *projectPath; - NSArray *rootKeys; // CLASS_FILES - NSArray *rootCategories; // Classes + NSArray *rootKeys; // e.g. CLASS_FILES + NSArray *rootCategories; // e.g. Classes NSDictionary *rootEntries; // Initialised by subclasses NSMutableDictionary *buildOptions; @@ -85,7 +81,8 @@ extern NSString *PCProjectDictDidSaveNotification; - (void)setProjectManager:(PCProjectManager *)aManager; - (BOOL)close:(id)sender; - (void)dealloc; -- (BOOL)saveProjectWindowsAndPanels; + +- (BOOL)saveProjectWindowsAndPanels; // Not finished // ============================================================================ // ==== Accessory methods @@ -113,32 +110,29 @@ extern NSString *PCProjectDictDidSaveNotification; // ==== To be overriden! // =========================================================================== -- (BOOL)isEditableCategory:(NSString *)category; - -// TEMP! For compatibility with old PC*Project subclasses -- (void)updateValuesFromProjectDict; - +// Project Attributes Inspector - (NSView *)projectAttributesView; - (Class)builderClass; - -// Subclasses need to call this before their customised implementation! -- (BOOL)writeMakefile; +- (NSString *)projectDescription; // Project type +- (BOOL)isExecutable; +- (NSString *)execToolName; - (NSArray *)fileTypesForCategoryKey:(NSString *)key; - (NSString *)dirForCategoryKey:(NSString *)key; +- (NSArray *)buildTargets; - (NSArray *)sourceFileKeys; - (NSArray *)resourceFileKeys; - (NSArray *)otherKeys; -- (NSArray *)buildTargets; +- (NSArray *)allowableSubprojectTypes; +- (NSArray *)defaultLocalizableKeys; +- (NSArray *)localizableKeys; -// Returns a string describing the project type -- (NSString *)projectDescription; +- (BOOL)isEditableCategory:(NSString *)category; -// Returns NO by default. -- (BOOL)isExecutable; -- (NSString *)execToolName; +// Subclasses need to call this before their customised implementation! +- (BOOL)writeMakefile; // ============================================================================ // ==== File Handling diff --git a/Library/PCProject.m b/Library/PCProject.m index 19864c2..efebc84 100644 --- a/Library/PCProject.m +++ b/Library/PCProject.m @@ -356,29 +356,6 @@ NSString // ==== 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]) - { - return YES; - } - - return NO; -} - -// TEMP! For compatibility with old PC*Project subclasses -- (void)updateValuesFromProjectDict -{ -} - - (NSView *)projectAttributesView { return nil; @@ -449,6 +426,24 @@ NSString return nil; } +- (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]) + { + return YES; + } + + return NO; +} + // Saves backup file - (BOOL)writeMakefile { diff --git a/Library/Resources/cfile.template b/Library/Resources/cfile.template index bee9e56..8592f97 100644 --- a/Library/Resources/cfile.template +++ b/Library/Resources/cfile.template @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Library/Resources/cheader.template b/Library/Resources/cheader.template index 86bc62c..9fe0abf 100644 --- a/Library/Resources/cheader.template +++ b/Library/Resources/cheader.template @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Library/Resources/class.template b/Library/Resources/class.template index 47e4932..5a4a5ff 100644 --- a/Library/Resources/class.template +++ b/Library/Resources/class.template @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Library/Resources/header.template b/Library/Resources/header.template index 5ee7d25..a9ff2b4 100644 --- a/Library/Resources/header.template +++ b/Library/Resources/header.template @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Library/Resources/protocol.template b/Library/Resources/protocol.template index e8e68e2..24bd5f2 100644 --- a/Library/Resources/protocol.template +++ b/Library/Resources/protocol.template @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Modules/ApplicationProject/Resources/AppController.h b/Modules/ApplicationProject/Resources/AppController.h index 811e0f7..c067629 100644 --- a/Modules/ApplicationProject/Resources/AppController.h +++ b/Modules/ApplicationProject/Resources/AppController.h @@ -1,11 +1,13 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ Created: $DATE$ by $USERNAME$ + + Application Controller This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff --git a/Modules/ApplicationProject/Resources/AppController.m b/Modules/ApplicationProject/Resources/AppController.m index a12e5a0..41626a4 100644 --- a/Modules/ApplicationProject/Resources/AppController.m +++ b/Modules/ApplicationProject/Resources/AppController.m @@ -1,11 +1,13 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ Created: $DATE$ by $USERNAME$ + + Application Controller This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff --git a/Modules/ApplicationProject/Resources/main.m b/Modules/ApplicationProject/Resources/main.m index 190ca1b..5c78cd3 100644 --- a/Modules/ApplicationProject/Resources/main.m +++ b/Modules/ApplicationProject/Resources/main.m @@ -1,7 +1,7 @@ /* Project: $PROJECTNAME$ - Copyright (C) 200_ Free Software Foundation + Copyright (C) $YEAR$ Free Software Foundation Author: $FULLUSERNAME$ diff --git a/Modules/BundleProject/Resources/PC.project b/Modules/BundleProject/Resources/PC.project index 523308c..b07cae1 100644 --- a/Modules/BundleProject/Resources/PC.project +++ b/Modules/BundleProject/Resources/PC.project @@ -1,6 +1,5 @@ { APPKIT = "GNUSTEP-GUI"; - APPLICATIONICON = ""; BUILDTOOL = "/usr/bin/make"; BUNDLE_EXTENSION = ".bundle"; CLASS_FILES = (); diff --git a/Modules/GNUmakefile b/Modules/GNUmakefile index a8081f1..f8d2e7e 100644 --- a/Modules/GNUmakefile +++ b/Modules/GNUmakefile @@ -12,9 +12,9 @@ GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) SUBPROJECTS = \ ApplicationProject \ BundleProject \ - ToolProject \ LibraryProject \ - RenaissanceProject + RenaissanceProject \ + ToolProject include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/Modules/LibraryProject/PCLibProj.m b/Modules/LibraryProject/PCLibProj.m index 76a2dae..db49ee2 100644 --- a/Modules/LibraryProject/PCLibProj.m +++ b/Modules/LibraryProject/PCLibProj.m @@ -85,7 +85,6 @@ static PCLibProj *_creator = nil; projectDict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; // Customise the project - [project setProjectName:[path lastPathComponent]]; [projectDict setObject:[path lastPathComponent] forKey:PCProjectName]; [projectDict setObject:[self projectTypeName] forKey:PCProjectType]; // The path cannot be in the PC.project file! diff --git a/Modules/LibraryProject/PCLibProject.m b/Modules/LibraryProject/PCLibProject.m index 0f877d9..5f1d73c 100644 --- a/Modules/LibraryProject/PCLibProject.m +++ b/Modules/LibraryProject/PCLibProject.m @@ -22,24 +22,10 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "PCLibProject.h" -#include "PCLibProj.h" - #include -@interface PCLibProject (CreateUI) - -- (void)_initUI; - -@end - -@implementation PCLibProject (CreateUI) - -- (void)_initUI -{ -} - -@end +#include "PCLibProject.h" +#include "PCLibProj.h" @implementation PCLibProject diff --git a/Modules/LibraryProject/Resources/PC.project b/Modules/LibraryProject/Resources/PC.project index dec09c0..c52950c 100644 --- a/Modules/LibraryProject/Resources/PC.project +++ b/Modules/LibraryProject/Resources/PC.project @@ -1,6 +1,5 @@ { APPKIT = "GNUSTEP-GUI"; - APPLICATIONICON = ""; BUILDTOOL = "/usr/bin/make"; CLASS_FILES = (); COMPILEROPTIONS = ""; diff --git a/Modules/RenaissanceProject/Resources/AppController.h b/Modules/RenaissanceProject/Resources/AppController.h index 01513d1..d2c46c5 100644 --- a/Modules/RenaissanceProject/Resources/AppController.h +++ b/Modules/RenaissanceProject/Resources/AppController.h @@ -1,5 +1,11 @@ /* - AppController.h + Project: $PROJECTNAME$ + + Copyright (C) $YEAR$ Free Software Foundation + + Author: $FULLUSERNAME$ + + Created: $DATE$ by $USERNAME$ GNUstep Renaissance Application Controller diff --git a/Modules/RenaissanceProject/Resources/AppController.m b/Modules/RenaissanceProject/Resources/AppController.m index 77d3a56..b4411c7 100644 --- a/Modules/RenaissanceProject/Resources/AppController.m +++ b/Modules/RenaissanceProject/Resources/AppController.m @@ -1,5 +1,11 @@ /* - AppController.h + Project: $PROJECTNAME$ + + Copyright (C) $YEAR$ Free Software Foundation + + Author: $FULLUSERNAME$ + + Created: $DATE$ by $USERNAME$ GNUstep Renaissance Application Controller diff --git a/Modules/RenaissanceProject/Resources/main.m b/Modules/RenaissanceProject/Resources/main.m index 274b905..e3ed068 100644 --- a/Modules/RenaissanceProject/Resources/main.m +++ b/Modules/RenaissanceProject/Resources/main.m @@ -1,4 +1,12 @@ /* + Project: $PROJECTNAME$ + + Copyright (C) $YEAR$ Free Software Foundation + + Author: $FULLUSERNAME$ + + Created: $DATE$ by $USERNAME$ + This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either