Re: resources
Re: resources
- Subject: Re: resources
- From: Chris Espinosa <email@hidden>
- Date: Thu, 4 Nov 2004 10:33:03 -0800
On Nov 4, 2004, at 10:13 AM, Steve Mills wrote:
I'm moving a project from CodeWarrior to Xcode. The project is also
moving from a Carbon CFM app to a Carbon Mach-O app, so for the first
time this project will be an app bundle. It's based on our internal
Mac framework. This framework includes framework.rsrc and
frameworklocalizable.rsrc. The project contains proj.rsrc and a
projlocalizable.rsrc. The 2 non-localizable files need to be merged,
with the project's file overriding resources in the framework file.
The 2 localizable files get merged with our own tool, and the STR#
resources are stripped out and converted into Localizable.strings that
gets written into English.lproj.
The thing I'm confused about in Xcode are the Bundle Resources and
ResourceManager Resources build phases of the target. I didn't really
understand what I found in Xcode's docs, because what I found didn't
really explain them all that well. Maybe I missed a better page. Can
anybody explain what happens to .r and .rsrc files that are in each of
those build phases?
When I build the project, it ends up with empty copies of the 2
non-localizable files in the Resources dir of the app, as well as an
empty .rsrc file of the app's name.
Steve,
Bundle Resources are nibs, strings files, tiffs, and other file-based
non-code entities that go into the *.app/Contents/Resources/ directory
of your app (or *.framework/Resources/ of a framework). Any files in
this build phase are copied straight across into the Resources
directory.
ResourceManager Resources are Resource Manager resources (.rsrc) or
resource sources (.r) that are processed by ResMerger or Rez. Files in
this build phase are merged into the <BundleName>.rsrc file in the
Resources directory.
First the .r files are processed with Rez to create intermediates, then
those intermediates are merged together, with any other .rsrc files,
into one big .rsrc file. The result is a data-fork resource file; the
resource data is in the data fork of that .rsrc file. CFBundle and the
Resource Manager on Mac OS X expect this.
ResMerger does not deal with mixed-fork input. The output of Rez (when
driven from Xcode) is all in data-fork resource files, which ResMerger
merges together. Therefore, any .rsrc files you want merged in must
also be data-fork resource files, or they'll be skipped (silently).
It's easy to move the resource data in a resource fork to its data fork:
$cp foo.rsrc/..namedfork/rsrc foo.rsrc
$rm foo.rsrc/..namedfork/rsrc
If you just want your resource-fork files to be available individually
in your app or framework, and don't want to merge them into the main
resource file, and don't want to move them to the data fork, just move
them from the ResourceManager Resources build phase to the Bundle
Resources build phase. They'll be copied across intact, resource fork
and all. (Xcode 1.5 and later).
Chris
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >resources (From: Steve Mills <email@hidden>) |