Skip to content

Commit

Permalink
Add new class and attributes to hold new data
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Nov 19, 2024
1 parent 37ad8d2 commit 0ac28dc
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Tools/pcpg/PLCPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2011 Free Software Foundation
Author: Gregory John Casamento,,,
Author: Gregory John Casamento
Created: 2011-08-16 14:15:42 -0400 by heron
Expand Down
31 changes: 26 additions & 5 deletions Tools/pcpg/PLCPG.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2011 Free Software Foundation
Author: Gregory John Casamento,,,
Author: Gregory John Casamento
Created: 2011-08-16 14:15:42 -0400 by heron
Expand Down Expand Up @@ -134,7 +134,13 @@ - (void) collectClassDetails

- (void) createHeaderForClassNamed: (NSString *)className
{
NSString *classFileFormat = @"#import <Foundation/Foundation.h>\n\n// Local includes\n#import \"PBXCoder.h\"\n%@\n\n@interface %@ : NSObject\n{\n%@}\n\n// Methods....\n%@\n@end";
NSString *classFileFormat =
@"#import <Foundation/Foundation.h>\n\n"
@"// Local includes\n"
@"#import \"PBXCoder.h\"\n"
@"%@\n\n@interface %@ : NSObject\n"
@"{\n%@}\n\n// Methods....\n%@\n"
@"@end";
NSDictionary *classInfo = [classes objectForKey: className];
NSEnumerator *en = [classInfo keyEnumerator];
NSString *ivarString = @"";
Expand All @@ -145,7 +151,14 @@ - (void) createHeaderForClassNamed: (NSString *)className
while((ivarName = [en nextObject]) != nil)
{
NSString *type = [classInfo objectForKey: ivarName];
ivarString = [ivarString stringByAppendingString: [NSString stringWithFormat: @" %@ *%@;\n",type, ivarName]];

// Map certain types...
if ([type isEqualToString: @"GSCInlineString"])
{
type = @"NSString";
}

ivarString = [ivarString stringByAppendingString: [NSString stringWithFormat: @"\t%@ *_%@;\n",type, ivarName]];
if(![type isEqualToString: @"NSString"] &&
![type isEqualToString: @"NSMutableArray"] &&
![type isEqualToString: @"NSArray"] &&
Expand Down Expand Up @@ -180,17 +193,25 @@ - (void) createSourceForClassNamed: (NSString *)className
while((ivarName = [en nextObject]) != nil)
{
NSString *type = [classInfo objectForKey: ivarName];
methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (%@ *) %@ // getter\n{\n return %@;\n}\n\n",

// Map certain types...
if ([type isEqualToString: @"GSCInlineString"])
{
type = @"NSString";
}

methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (%@ *) %@ // getter\n{\n\treturn _%@;\n}\n\n",
type,ivarName,ivarName]];
NSString *name = [ivarName stringByUpperCasingFirstCharacter];
methodString = [methodString stringByAppendingString: [NSString stringWithFormat:
@"- (void) set%@: (%@ *)object; // setter\n{\n ASSIGN(%@,object);\n}\n\n",
@"- (void) set%@: (%@ *)object; // setter\n{\n\tASSIGN(_%@, object);\n}\n\n",
name,type,ivarName]];
}

NSString *classFileName = [className stringByAppendingString: @".m"];
NSString *classFile = [NSString stringWithFormat: classFileFormat, className, className, methodString];
NSError *error = nil;

[classFile writeToFile: classFileName atomically: NO encoding: NSASCIIStringEncoding error: &error];
}

Expand Down
2 changes: 2 additions & 0 deletions XCode/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PBXCopyFilesBuildPhase.h \
PBXFileReference.h \
PBXFrameworksBuildPhase.h \
PBXFrameworkTarget.h \
PBXFileSystemSynchronizedRootGroup.h \
PBXGroup.h \
PBXHeadersBuildPhase.h \
PBXNativeTarget.h \
Expand Down Expand Up @@ -94,6 +95,7 @@ PBXContainerItemProxy.m \
PBXContainer.m \
PBXCopyFilesBuildPhase.m \
PBXFileReference.m \
PBXFileSystemSynchronizedRootGroup.m \
PBXFrameworksBuildPhase.m \
PBXFrameworkTarget.m \
PBXGroup.m \
Expand Down
8 changes: 8 additions & 0 deletions XCode/PBXProject.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,17 @@

NSString *_filename;
NSMutableArray *_arrangedTargets;
BOOL _minimizedProjectReferenceProxies;
NSString *_preferredProjectObjectVersion;
}

// Methods....
- (BOOL) minimizedProjectReferenceProxies; // getter
- (void) setMinimizedProjectReferenceProxies: (BOOL)flag; // setter

- (NSString *) preferredProjectObjectVersion; // getter
- (void) setPreferredProjectObjectVersion: (NSString *)object; // setter

- (NSString *) developmentRegion; // getter
- (void) setDevelopmentRegion: (NSString *)object; // setter

Expand Down
44 changes: 32 additions & 12 deletions XCode/PBXProject.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,33 @@ - (instancetype) init
return self;
}

// Methods....
// Methods...
- (BOOL) minimizedProjectReferenceProxies // getter
{
return _minimizedProjectReferenceProxies;
}

- (void) setMinimizedProjectReferenceProxies: (BOOL)flag // setter
{
_minimizedProjectReferenceProxies = flag;
}

- (NSString *) preferredProjectObjectVersion // getter
{
return _preferredProjectObjectVersion;
}

- (void) setPreferredProjectObjectVersion: (NSString *)object // setter
{
ASSIGN(_preferredProjectObjectVersion, object);
}

- (NSString *) developmentRegion // getter
{
return _developmentRegion;
}

- (void) setDevelopmentRegion: (NSString *)object; // setter
- (void) setDevelopmentRegion: (NSString *)object // setter
{
ASSIGN(_developmentRegion,object);
}
Expand All @@ -182,7 +202,7 @@ - (NSMutableArray *) knownRegions // getter
return _knownRegions;
}

- (void) setKnownRegions: (NSMutableArray *)object; // setter
- (void) setKnownRegions: (NSMutableArray *)object // setter
{
ASSIGN(_knownRegions,object);
}
Expand All @@ -192,7 +212,7 @@ - (NSString *) compatibilityVersion // getter
return _compatibilityVersion;
}

- (void) setCompatibilityVersion: (NSString *)object; // setter
- (void) setCompatibilityVersion: (NSString *)object // setter
{
ASSIGN(_compatibilityVersion,object);
}
Expand All @@ -202,7 +222,7 @@ - (NSMutableArray *) projectReferences // getter
return _projectReferences;
}

- (void) setProjectReferences: (NSMutableArray *)object; // setter
- (void) setProjectReferences: (NSMutableArray *)object // setter
{
ASSIGN(_projectReferences,object);
}
Expand All @@ -212,7 +232,7 @@ - (NSMutableArray *) targets // getter
return _targets;
}

- (void) setTargets: (NSMutableArray *)object; // setter
- (void) setTargets: (NSMutableArray *)object // setter
{
ASSIGN(_targets,object);
}
Expand All @@ -222,7 +242,7 @@ - (NSString *) projectDirPath // getter
return _projectDirPath;
}

- (void) setProjectDirPath: (NSString *)object; // setter
- (void) setProjectDirPath: (NSString *)object // setter
{
ASSIGN(_projectDirPath,object);
}
Expand All @@ -232,7 +252,7 @@ - (NSString *) projectRoot // getter
return _projectRoot;
}

- (void) setProjectRoot: (NSString *)object; // setter
- (void) setProjectRoot: (NSString *)object // setter
{
ASSIGN(_projectRoot,object);
}
Expand All @@ -242,7 +262,7 @@ - (XCConfigurationList *) buildConfigurationList // getter
return _buildConfigurationList;
}

- (void) setBuildConfigurationList: (XCConfigurationList *)object; // setter
- (void) setBuildConfigurationList: (XCConfigurationList *)object // setter
{
ASSIGN(_buildConfigurationList,object);
}
Expand All @@ -252,7 +272,7 @@ - (PBXGroup *) mainGroup // getter
return _mainGroup;
}

- (void) setMainGroup: (PBXGroup *)object; // setter
- (void) setMainGroup: (PBXGroup *)object // setter
{
ASSIGN(_mainGroup,object);
}
Expand All @@ -262,7 +282,7 @@ - (NSString *) hasScannedForEncodings // getter
return _hasScannedForEncodings;
}

- (void) setHasScannedForEncodings: (NSString *)object; // setter
- (void) setHasScannedForEncodings: (NSString *)object // setter
{
ASSIGN(_hasScannedForEncodings,object);
}
Expand All @@ -272,7 +292,7 @@ - (PBXGroup *) productRefGroup // getter
return _productRefGroup;
}

- (void) setProductRefGroup: (PBXGroup *)object; // setter
- (void) setProductRefGroup: (PBXGroup *)object // setter
{
ASSIGN(_productRefGroup,object);
}
Expand Down
10 changes: 9 additions & 1 deletion XCode/PBXTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@
NSMutableArray *_buildPhases;
NSString *_name;
NSString *_productType;

NSMutableArray *_fileSystemSynchronizedGroups;
NSMutableArray *_packageProductDepedencies;

PBXProject *_project;
GSXCBuildDatabase *_database;
}

// Methods....
- (NSMutableArray *) fileSystemSynchronizedGroups;
- (void) setFileSystemSynchronizedGroups: (NSMutableArray *)object;

- (NSMutableArray *) packageProductDepedencies;
- (void) setPackageProductDepedencies: (NSMutableArray *)object;

- (NSMutableArray *) dependencies; // getter
- (void) setDependencies: (NSMutableArray *)object; // setter

Expand Down
22 changes: 22 additions & 0 deletions XCode/PBXTarget.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,33 @@ - (void) dealloc
RELEASE(_name);
RELEASE(_project);
RELEASE(_productType);
RELEASE(_fileSystemSynchronizedGroups);
RELEASE(_packageProductDepedencies);

[super dealloc];
}

// Methods....
- (NSMutableArray *) fileSystemSynchronizedGroups
{
return _fileSystemSynchronizedGroups;
}

- (void) setFileSystemSynchronizedGroups: (NSMutableArray *)object
{
ASSIGN(_fileSystemSynchronizedGroups, object);
}

- (NSMutableArray *) packageProductDepedencies
{
return _packageProductDepedencies;
}

- (void) setPackageProductDepedencies: (NSMutableArray *)object
{
ASSIGN(_packageProductDepedencies, object);
}

- (PBXProject *) project
{
return _project;
Expand Down
18 changes: 9 additions & 9 deletions XCode/XCBuildConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
Written by: Gregory John Casamento <greg.casamento@gmail.com>
Date: 2022
This file is part of the GNUstep XCode Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Expand All @@ -40,10 +40,10 @@ - (instancetype) initWithName: (NSString *)theName
self = [super init];
if (self != nil)
{
[self setBuildSettings: settings];
[self setBuildSettings: settings];
[self setName: theName];
}
return self;
return self;
}

- (instancetype) initWithName: (NSString *)theName
Expand Down Expand Up @@ -101,7 +101,7 @@ - (void) apply
{
id value = [buildSettings objectForKey: key];
if ([value isKindOfClass: [NSString class]])
{
{
setenv([key cString],[value cString],1);
}
else if([value isKindOfClass: [NSArray class]])
Expand All @@ -112,17 +112,17 @@ - (void) apply
}
else
{
NSDebugLog(@"\tWARNING: Can't interpret value %@, for environment variable %@", value, key);
NSDebugLog(@"\tWARNING: Can't interpret value %@, for environment variable %@", value, key);
}
}

if ([buildSettings objectForKey: @"TARGET_BUILD_DIR"] == nil)
{
NSDebugLog(@"\tEnvironment: TARGET_BUILD_DIR = build (built-in)");
setenv("TARGET_BUILD_DIR","build",1);
[context setObject: @"build" forKey: @"TARGET_BUILD_DIR"];
}

if ([buildSettings objectForKey: @"BUILT_PRODUCTS_DIR"] == nil)
{
NSDebugLog(@"\tEnvironment: BUILT_PRODUCTS_DIR = build (built-in)");
Expand Down

0 comments on commit 0ac28dc

Please sign in to comment.