Skip to content

Commit e0d645e

Browse files
committed
Merge branch 'master' of github.com:gnustep/libs-xcode
2 parents c272195 + ff946dc commit e0d645e

File tree

6 files changed

+135
-13
lines changed

6 files changed

+135
-13
lines changed

Documentation/XCode.gsdoc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.3//EN" "http://www.gnustep.org/gsdoc-1_0_3.xml">
3+
<gsdoc base="Gui">
4+
<head>
5+
<title>Gui</title>
6+
<copy>1996-2023 Free Software Foundation, Inc.</copy>
7+
</head>
8+
<body>
9+
<chapter>
10+
<heading>Gui</heading>
11+
<p>
12+
The GNUstep GUI library is a free software package implementing the
13+
API of the OpenStep Application Kit (tm), or "AppKit", including
14+
later additions. This documentation package describes the core of
15+
the Base library; for documentation on additional classes, see the
16+
<uref url="../Additions/index.html">GuiAdditions</uref>
17+
documentation package.
18+
</p>
19+
<p>
20+
Read the
21+
<uref url="../ReleaseNotes/ReleaseNotes.html">Release Notes</uref>
22+
for the current release.
23+
</p>
24+
<section>
25+
<heading>Compatibility</heading>
26+
<p>
27+
GNUstep is generally compatible with the OpenStep specification and
28+
with recent developments of the Mac OS X (Cocoa) API. Where MacOS
29+
deviates from the OpenStep API, GNUstep generally attempts to
30+
support both versions. In some cases the newer MacOS APIs are
31+
incompatible with OpenStep, and GNUstep usually supports the richer
32+
version. See the <uref
33+
url="../General/OpenStepCompliance.html">OpenStep Compliance</uref>
34+
section for more information on OpenStep Compliance.
35+
</p>
36+
</section>
37+
<section>
38+
<heading>Information and Setup</heading>
39+
<p>
40+
Nicola Pero has begun work on writing an
41+
<uref url="../ProgrammingManual/manual_toc.html">introduction</uref>
42+
to the basic concepts and use of the GNUstep GUI library.
43+
</p>
44+
<p>
45+
Useful documentation for setting up GNUstep:
46+
</p>
47+
<list>
48+
<item><uref url="../../../User/Gui/DefaultsSummary.html">Available User Defaults</uref></item>
49+
<item><uref url="../../../User/Gui/LanguageSetup.html">Language Setup</uref></item>
50+
</list>
51+
</section>
52+
53+
</chapter>
54+
55+
<back>
56+
<chapter>
57+
<heading>API Documentation</heading>
58+
<list>
59+
<item><uref url="Functions.html">Functions</uref></item>
60+
<item><uref url="TypesAndConstants.html">Types and Constants</uref></item>
61+
</list>
62+
</chapter>
63+
<index scope="project" type="class" />
64+
<index scope="project" type="protocol" />
65+
</back>
66+
</body>
67+
</gsdoc>

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ information in the Documentation directory of this project.
6565
are permitted in any medium without royalty provided the copyright
6666
notice and this notice are preserved.
6767

68+
## Star History
69+
70+
<a href="https://www.star-history.com/#gnustep/libs-xcode&Date">
71+
<picture>
72+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=gnustep/libs-xcode&type=Date&theme=dark" />
73+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=gnustep/libs-xcode&type=Date" />
74+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=gnustep/libs-xcode&type=Date" />
75+
</picture>
76+
</a>
77+

XCode/PBXResourcesBuildPhase.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@
2929
#import "PBXBuildPhase.h"
3030

3131
@interface PBXResourcesBuildPhase : PBXBuildPhase
32+
33+
- (NSMutableDictionary *) configToInfoPlist: (XCBuildConfiguration *)config;
34+
3235
@end

XCode/PBXResourcesBuildPhase.m

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,30 @@ - (BOOL) copyResourceFrom: (NSString *)srcPath to: (NSString *)dstPath
207207
return result;
208208
}
209209

210+
- (NSMutableDictionary *) configToInfoPlist: (XCBuildConfiguration *)config
211+
{
212+
NSMutableDictionary *ipd = [NSMutableDictionary dictionary];
213+
NSDictionary *buildSettings = [config buildSettings];
214+
// NSString *appIcon = [buildSettings objectForKey: @"ASSETCATALOG_COMPILER_APPICON_NAME"];
215+
NSString *version = [buildSettings objectForKey: @"CURRENT_PROJECT_VERSION"];
216+
NSString *copyright = [buildSettings objectForKey: @"INFOPLIST_KEY_NSHumanReadableCopyright"];
217+
NSString *mainNib = [buildSettings objectForKey: @"INFOPLIST_KEY_NSMainNibFile"];
218+
NSString *principalClass = [buildSettings objectForKey: @"INFOPLIST_KEY_NSPrincipalClass"];
219+
NSString *bundleIdentifier = [buildSettings objectForKey: @"PRODUCT_BUNDLE_IDENTIFIER"];
220+
NSString *iconFile = [self processAssets];
221+
222+
[ipd setObject: version forKey: @"CFBundleVersion"];
223+
[ipd setObject: mainNib forKey: @"NSMainNibFile"];
224+
[ipd setObject: copyright forKey: @"NSHumanReadableCopyright"];
225+
[ipd setObject: principalClass forKey: @"NSPrincipalClass"];
226+
[ipd setObject: iconFile forKey: @"NSIcon"];
227+
[ipd setObject: @"$(DEVELOPMENT_LANGUAGE)" forKey: @"CFBundleDevelopmentRegion"];
228+
[ipd setObject: @"$(EXECUTABLE_NAME)" forKey: @"CFBundlExecutable"];
229+
[ipd setObject: bundleIdentifier forKey: @"CFBundleIdentifier"];
230+
231+
return ipd;
232+
}
233+
210234
- (BOOL) build
211235
{
212236
xcputs("=== Executing Resources Build Phase");
@@ -332,16 +356,29 @@ - (BOOL) build
332356
XCBuildConfiguration *xbc = [xcl defaultConfiguration];
333357
NSDictionary *bs = [xbc buildSettings];
334358
NSString *infoPlist = [bs objectForKey: @"INFOPLIST_FILE"];
359+
NSString *outputPlist = [resourcesDir
360+
stringByAppendingPathComponent: @"Info-gnustep.plist"];
335361

336-
if ([mgr fileExistsAtPath: infoPlist] == NO)
362+
if (infoPlist != nil)
337363
{
338-
infoPlist = [infoPlist lastPathComponent];
339-
}
364+
if ([mgr fileExistsAtPath: infoPlist] == NO)
365+
{
366+
infoPlist = [infoPlist lastPathComponent];
367+
}
340368

341-
NSString *outputPlist = [resourcesDir
342-
stringByAppendingPathComponent: @"Info-gnustep.plist"];
343-
[self processInfoPlistInput: infoPlist
344-
output: outputPlist];
369+
[self processInfoPlistInput: infoPlist
370+
output: outputPlist];
371+
}
372+
else
373+
{
374+
xcputs([[NSString stringWithFormat: @"\t* Generating info plist --> %s%@%s", GREEN, outputPlist, RESET] cString]);
375+
XCBuildConfiguration *config = [xcl configurationWithName: @"Debug"];
376+
NSMutableDictionary *ipl = [self configToInfoPlist: config];
377+
NSString *plString = [ipl description];
378+
379+
NSDebugLog(@"ipl = %@", ipl);
380+
[plString writeToFile: outputPlist atomically: YES];
381+
}
345382

346383
xcputs("=== Resources Build Phase Completed");
347384
fflush(stdout);

XCode/XCConfigurationList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
* Returns the default configuration.
7777
*/
7878
- (XCBuildConfiguration *) defaultConfiguration;
79+
- (XCBuildConfiguration *) configurationWithName: (NSString *)name;
7980

8081
/**
8182
* Applies the default configuration.

XCode/XCConfigurationList.m

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,31 @@ - (void) setDefaultConfigurationName: (NSString *)object; // setter
7676
ASSIGN(defaultConfigurationName,object);
7777
}
7878

79-
- (XCBuildConfiguration *) defaultConfiguration
79+
- (XCBuildConfiguration *) configurationWithName: (NSString *)name
8080
{
8181
NSEnumerator *en = [buildConfigurations objectEnumerator];
82-
NSString *defaultConfig = (defaultConfigurationName == nil)?
83-
@"Release":defaultConfigurationName;
8482
XCBuildConfiguration *config = nil;
8583

8684
NSDebugLog(@"Number of build configurations = %ld\n%@",
8785
[buildConfigurations count], buildConfigurations);
8886

8987
while((config = [en nextObject]) != nil)
9088
{
91-
if([[config name]
92-
isEqualToString:
93-
defaultConfig])
89+
if([[config name] isEqualToString: name])
9490
{
9591
break;
9692
}
9793
}
9894

9995
return config;
96+
97+
}
98+
99+
- (XCBuildConfiguration *) defaultConfiguration
100+
{
101+
NSString *defaultConfig = (defaultConfigurationName == nil)?
102+
@"Release":defaultConfigurationName;
103+
return [self configurationWithName: defaultConfig];
100104
}
101105

102106
- (void) applyDefaultConfiguration

0 commit comments

Comments
 (0)