* Framework/PCProjectManager.m: Remove code handling rootBuildPath var.

Remove rootBuildPath var.
* Headers/ProjectCenter/PCProjectManager.h: Ditto.
* Framework/PCFileManager.m: Add removeDirsIfEmpty:(BOOL) parameter to
  remove* methods.
* Headers/ProjectCenter/PCFileManager.h: Ditto.
* Framework/PCProject.m: Pass removeDirsIfEmpty:(BOOL) parameter to
  PCFileManager remove* methods calls.
* PCAppController.m: Ditto.
* Modules/Projects/Application/PCAppProject.m: Ditto.
* Modules/Projects/Tool/PCToolProject.m: Ditto.
* Framework/PCProjectBuilder.m: Rename ivar currentProject into project.
  Use it.
  (prebuildCheck:): Create root build directory if not exist.
* Headers/ProjectCenter/PCProjectBuilder.h: Rename ivar currentProject
  into project.
* Documentation/TODO: Update.
* Documentation/ANNOUNCE: Ditto.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@24369 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2007-01-16 16:27:33 +00:00
parent 3793013f03
commit 7fb3796a38
15 changed files with 105 additions and 75 deletions

View file

@ -1,6 +1,6 @@
ANNOUNCE
************
********
This is version 0.5.0 of ProjectCenter.
@ -19,26 +19,28 @@ What is ProjectCenter?
Noteworthy changes in version `0.5.0'.
======================================
* Added new project types "Framework" and "Resource Set"
* Added new project types "Framework" and "Resource Set".
* Implemented on demand loading of bundles (project types, editor)
* Implemented on demand loading of bundles (project types, editor).
* Impemented localization support for projects
* Impemented localization support for projects.
* Some user interface ehnancements were made (save restore geometry of
subviews in project window splitview, drag and drop for icons)
subviews in project window splitview, drag and drop for icons).
* Clicking on .m and .h file in project browser expands to file structure
(classes, methods)
(classes, methods).
* Incorporated ProjectManager's editor with some modifications. Symtax color
highlighting works.
* Rewritte bundle loading mechanizm. All bundle now loaded on demand.
* All windows and panels are now GORM files
* All windows and panels are now GORM files.
* Fixes for MingW environment (thanks to Adam Fedor).
* Support for separate build directory added.
How can I get support for this software?
========================================

View file

@ -1,6 +1,6 @@
Authors:
Philippe C.D. Robert <probert@siggraph.org>
Serg Stoyan <stoyan255@ukr.net>
Sergii Stoian <stoyan255gmail.com>
Contributors:
David Ayers <d.ayers@inode.at>

View file

@ -1,3 +1,24 @@
2007-01-15 Sergii Stoian <stoyan255@gmail.com>
* Framework/PCProjectManager.m: Remove code handling rootBuildPath var.
Remove rootBuildPath var.
* Headers/ProjectCenter/PCProjectManager.h: Ditto.
* Framework/PCFileManager.m: Add removeDirsIfEmpty:(BOOL) parameter to
remove* methods.
* Headers/ProjectCenter/PCFileManager.h: Ditto.
* Framework/PCProject.m: Pass removeDirsIfEmpty:(BOOL) parameter to
PCFileManager remove* methods calls.
* PCAppController.m: Ditto.
* Modules/Projects/Application/PCAppProject.m: Ditto.
* Modules/Projects/Tool/PCToolProject.m: Ditto.
* Framework/PCProjectBuilder.m: Rename ivar currentProject into project.
Use it.
(prebuildCheck:): Create root build directory if not exist.
* Headers/ProjectCenter/PCProjectBuilder.h: Rename ivar currentProject
into project.
* Documentation/TODO: Update.
* Documentation/ANNOUNCE: Ditto.
2007-01-15 Sergii Stoian <stoyan255@gmail.com>
* Framework/PCProjectManager.m: Fix problem with closing project.

View file

@ -34,10 +34,11 @@ ProjectCenter 0.5
- Click on Browser item should move cursor to line in file [done!]
- Imlement pending adding/removal of files (history?) stoyan
--- Project Builder:
- Implement root build directory handling stoyan
- Create panel and builder GORM files [done!]
- Implement root build directory handling [done!]
- Finish options handling stoyan
- Parse gcc output [90% done!]
- Display warnings,errors,options etc. as clickable list [90% done!]
- Parse gcc output [95% done!]
- Display warnings,errors,options etc. as clickable list [done!]
- Finish FileNameIcon (draggable, files can be dragged to it) stoyan
- Review all dialogs and situations when dialogs must be
popped up stoyan
@ -51,7 +52,7 @@ ProjectCenter 0.6
- Create custom Info panel stoyan
- More options for file creation stoyan
- Implement Editor indentation stoyan
- Better integration with other tools (Gorm) stoyan
- Better integration with other tools (Gorm) stoyan
ProjectCenter 0.7
-----------------

View file

@ -300,7 +300,9 @@ static PCFileManager *_mgr = nil;
return YES;
}
- (BOOL)removeFile:(NSString *)file fromDirectory:(NSString *)directory
- (BOOL)removeFile:(NSString *)file
fromDirectory:(NSString *)directory
removeDirsIfEmpty:(BOOL)removeDirs
{
NSString *path = nil;
NSFileManager *fm = [NSFileManager defaultManager];
@ -317,32 +319,24 @@ static PCFileManager *_mgr = nil;
return NO;
}
[self removeDirectoriesIfEmptyAtPath:directory];
if (removeDirs)
{
[self removeDirectoriesIfEmptyAtPath:directory];
}
return YES;
}
- (BOOL)removeFileAtPath:(NSString *)file
- (BOOL)removeFileAtPath:(NSString *)file removeDirsIfEmpty:(BOOL)removeDirs
{
NSFileManager *fm = [NSFileManager defaultManager];
if (!file)
{
return NO;
}
if (![fm removeFileAtPath:file handler:nil])
{
return NO;
}
[self
removeDirectoriesIfEmptyAtPath:[file stringByDeletingLastPathComponent]];
return YES;
return [self removeFile:[file lastPathComponent]
fromDirectory:[file stringByDeletingLastPathComponent]
removeDirsIfEmpty:removeDirs];
}
- (BOOL)removeFiles:(NSArray *)files fromDirectory:(NSString *)directory
- (BOOL)removeFiles:(NSArray *)files
fromDirectory:(NSString *)directory
removeDirsIfEmpty:(BOOL)removeDirs
{
NSEnumerator *filesEnum = nil;
NSString *file = nil;
@ -355,7 +349,9 @@ static PCFileManager *_mgr = nil;
filesEnum = [files objectEnumerator];
while ((file = [filesEnum nextObject]))
{
if ([self removeFile:file fromDirectory:directory] == NO)
if ([self removeFile:file
fromDirectory:directory
removeDirsIfEmpty:removeDirs] == NO)
{
return NO;
}
@ -368,7 +364,7 @@ static PCFileManager *_mgr = nil;
{
if ([self copyFile:file intoDirectory:directory] == YES)
{
[self removeFileAtPath:file];
[self removeFileAtPath:file removeDirsIfEmpty:YES];
}
else
{

View file

@ -817,13 +817,15 @@ NSString
fromDirectory:langPath
intoDirectory:resPath];
}
[fileManager removeFile:file fromDirectory:langPath];
[fileManager removeFile:file
fromDirectory:langPath
removeDirsIfEmpty:YES];
}
}
if (yn == YES)
{
[fileManager removeFileAtPath:resFilePath];
[fileManager removeFileAtPath:resFilePath removeDirsIfEmpty:YES];
[localizedResources addObject:file];
[self setProjectDictObject:localizedResources
forKey:PCLocalizedResources

View file

@ -29,11 +29,14 @@
#include <ProjectCenter/PCSplitView.h>
#include <ProjectCenter/PCButton.h>
#include <ProjectCenter/PCFileManager.h>
#include <ProjectCenter/PCProjectManager.h>
#include <ProjectCenter/PCProject.h>
#include <ProjectCenter/PCProjectBuilder.h>
#include <ProjectCenter/PCLogController.h>
#include <ProjectCenter/PCPrefController.h>
#ifndef IMAGE
#define IMAGE(X) [NSImage imageNamed: X]
@ -269,7 +272,7 @@
if ((self = [super init]))
{
currentProject = aProject;
project = aProject;
buildTarget = [[NSMutableString alloc] initWithString:@"Default"];
buildArgs = [[NSMutableArray array] retain];
postProcess = NULL;
@ -398,7 +401,7 @@
lastIndentString = @"";
currentBuildPath = [[NSMutableArray alloc] initWithCapacity:1];
[currentBuildPath addObject:[currentProject projectPath]];
[currentBuildPath addObject:[project projectPath]];
currentBuildFile = [[NSMutableString alloc] initWithString:@""];
statusString = [NSString stringWithString:@"Building..."];
@ -421,7 +424,7 @@
{
if (NSRunAlertPanel(@"Clean Project?",
@"Do you really want to clean project '%@'?",
@"Yes", @"No", nil, [currentProject projectName])
@"Yes", @"No", nil, [project projectName])
== NSAlertAlternateReturn)
{
[cleanButton setState:NSOffState];
@ -480,7 +483,7 @@
if (_isBuilding || _isCleaning)
{
[buildStatusField setStringValue:[NSString stringWithFormat:
@"%@ - %@ terminated", [currentProject projectName], buildTarget]];
@"%@ - %@ terminated", [project projectName], buildTarget]];
}
// Restore buttons state
@ -529,20 +532,26 @@
- (BOOL)prebuildCheck
{
PCPrefController *prefs = [PCPrefController sharedPCPreferences];
PCFileManager *pcfm = [PCFileManager defaultManager];
NSFileManager *fm = [NSFileManager defaultManager];
NSString *buildDir = [prefs objectForKey:RootBuildDirectory];
NSString *projectBuildDir;
// Checking prerequisites
if ([currentProject isProjectChanged])
if ([project isProjectChanged])
{
if (NSRunAlertPanel(@"Project Changed!",
@"Should it be saved first?",
@"Yes", @"No", nil) == NSAlertDefaultReturn)
{
[currentProject save];
[project save];
}
}
else
{
// Synchronize PC.project and generated files just for case
[currentProject save];
[project save];
}
// Get make tool path
@ -557,6 +566,14 @@
}
// Create root build directory if not exist
projectBuildDir = [NSString stringWithFormat:@"%@.build",
[project projectName]];
projectBuildDir = [buildDir stringByAppendingPathComponent:projectBuildDir];
if (![fm fileExistsAtPath:buildDir] ||
![fm fileExistsAtPath:projectBuildDir])
{
[pcfm createDirectoriesIfNeededAtPath:projectBuildDir];
}
return YES;
}
@ -567,7 +584,7 @@
NSPipe *errorPipe;
// TODO: Support build options!!!
// NSDictionary *optionDict = [currentProject buildOptions];
// NSDictionary *optionDict = [project buildOptions];
// Checking build conditions
if ([self prebuildCheck] == NO)
@ -614,7 +631,7 @@
makeTask = [[NSTask alloc] init];
[makeTask setArguments:buildArgs];
[makeTask setCurrentDirectoryPath:[currentProject projectPath]];
[makeTask setCurrentDirectoryPath:[project projectPath]];
[makeTask setLaunchPath:makePath];
[makeTask setStandardOutput:logPipe];
[makeTask setStandardError:errorPipe];
@ -683,7 +700,7 @@
error:NO
newLine:YES];
[buildStatusField setStringValue:[NSString stringWithFormat:
@"%@ - %@ succeeded", [currentProject projectName], buildTarget]];
@"%@ - %@ succeeded", [project projectName], buildTarget]];
}
else
{
@ -695,13 +712,13 @@
{
[buildStatusField setStringValue:[NSString stringWithFormat:
@"%@ - %@ failed (%i errors)",
[currentProject projectName], buildTarget, errorsCount]];
[project projectName], buildTarget, errorsCount]];
}
else
{
[buildStatusField setStringValue:[NSString stringWithFormat:
@"%@ - %@ failed",
[currentProject projectName], buildTarget]];
[project projectName], buildTarget]];
}
}

View file

@ -55,8 +55,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
{
if ((self = [super init]))
{
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
buildPanel = nil;
launchPanel = nil;
loadedFilesPanel = nil;
@ -70,12 +68,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
nonProjectEditors = [[NSMutableDictionary alloc] init];
rootBuildPath = [[defs stringForKey:RootBuildDirectory] copy];
if (!rootBuildPath || [rootBuildPath isEqualToString:@""])
{
rootBuildPath = [NSTemporaryDirectory() copy];
}
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(resetSaveTimer:)
@ -115,7 +107,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
RELEASE(projectTypes);
RELEASE(projectTypeAccessaryView);
RELEASE(fileTypeAccessaryView);
RELEASE(rootBuildPath);
if (projectInspector) RELEASE(projectInspector);
if (loadedFilesPanel) RELEASE(loadedFilesPanel);
@ -335,11 +326,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
return findPanel;
}
- (NSString *)rootBuildPath
{
return rootBuildPath;
}
- (NSString *)projectPath
{
return [activeProject projectPath];
@ -890,7 +876,8 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
files = subprojs;
}
ret = [fileManager removeFiles:files
fromDirectory:directory];
fromDirectory:directory
removeDirsIfEmpty:YES];
}
if (!ret)

View file

@ -100,13 +100,17 @@
- (BOOL)removeDirectoriesIfEmptyAtPath:(NSString *)path;
// Remove 'file' located in 'directory'
- (BOOL)removeFile:(NSString *)file fromDirectory:(NSString *)directory;
- (BOOL)removeFile:(NSString *)file
fromDirectory:(NSString *)directory
removeDirsIfEmpty:(BOOL)removeDirs;
// Remove file with full path 'file'. Calls removeDirectoriesIfEmptyAtPath:.
- (BOOL)removeFileAtPath:(NSString *)file;
// Remove file with full path 'file'
- (BOOL)removeFileAtPath:(NSString *)file removeDirsIfEmpty:(BOOL)removeDirs;
// Remove array of files from directory
- (BOOL)removeFiles:(NSArray *)files fromDirectory:(NSString *)directory;
- (BOOL)removeFiles:(NSArray *)files
fromDirectory:(NSString *)directory
removeDirsIfEmpty:(BOOL)removeDirs;
- (BOOL)moveFile:(NSString *)file intoDirectory:(NSString *)directory;

View file

@ -78,7 +78,7 @@ typedef enum _ErrorLevel {
NSTextField *buildTargetArgsField;
// Variables
PCProject *currentProject;
PCProject *project;
NSDictionary *currentOptions;
NSString *makePath;

View file

@ -60,7 +60,6 @@ extern NSString *PCActiveProjectDidChangeNotification;
NSMutableDictionary *loadedProjects;
PCProject *activeProject;
NSString *rootBuildPath;
NSTimer *saveTimer;
NSMutableDictionary *nonProjectEditors;
@ -117,7 +116,6 @@ extern NSString *PCActiveProjectDidChangeNotification;
- (NSPanel *)buildPanel;
- (NSPanel *)launchPanel;
- (NSPanel *)projectFinderPanel;
- (NSString *)rootBuildPath;
- (NSString *)projectPath;
- (NSString *)selectedFileName;

View file

@ -99,7 +99,7 @@
oldFilePath = [oldFilePath stringByAppendingPathComponent:oldFile];
[pcfm copyFile:oldFilePath toFile:infoFilePath];
[pcfm removeFileAtPath:oldFilePath];
[pcfm removeFileAtPath:oldFilePath removeDirsIfEmpty:YES];
[otherRes removeObject:oldFile];
[otherRes addObject:infoFile];

View file

@ -95,12 +95,12 @@
- (PCProject *)createProjectAt:(NSString *)path
{
PCFileManager *pcfm = [PCFileManager defaultManager];
// PCFileManager *pcfm = [PCFileManager defaultManager];
PCFileCreator *pcfc = [PCFileCreator sharedCreator];
NSBundle *projectBundle = nil;
NSString *_file = nil;
NSString *_2file = nil;
NSString *_resourcePath;
// NSString *_resourcePath;
NSAssert(path,@"No valid project path provided!");

View file

@ -99,7 +99,7 @@
oldFilePath = [oldFilePath stringByAppendingPathComponent:oldFile];
[pcfm copyFile:oldFilePath toFile:infoFilePath];
[pcfm removeFileAtPath:oldFilePath];
[pcfm removeFileAtPath:oldFilePath removeDirsIfEmpty:YES];
[otherRes removeObject:oldFile];
[otherRes addObject:infoFile];

View file

@ -201,7 +201,9 @@
rootBuildDirList = [fm directoryContentsAtPath:rootBuildDir];
NSLog(@"The following files will be removed from directory \"%@\": %@",
rootBuildDir, rootBuildDirList);
[pcfm removeFiles:rootBuildDirList fromDirectory:rootBuildDir];
[pcfm removeFiles:rootBuildDirList
fromDirectory:rootBuildDir
removeDirsIfEmpty:NO];
}
[ud synchronize];