Re: Any way to "flatten" a resource file target on output? (SOLVED)
Re: Any way to "flatten" a resource file target on output? (SOLVED)
- Subject: Re: Any way to "flatten" a resource file target on output? (SOLVED)
- From: Stephen Kay <email@hidden>
- Date: Tue, 02 Oct 2012 18:16:47 -0400
- Thread-topic: Any way to "flatten" a resource file target on output? (SOLVED)
on 9/30/12 7:16 PM, Stephen Kay at email@hidden wrote:
> What I'm referring to here, is that back in the CodeWarrior days, there was
> an option in the Target Settings to "Output Resources to separate flattened
> file", and you specified a location, and it would move the resource fork to
> the data fork, such that you could then use this file on a Windows version
> of the app (for example).
>
> So I'm hoping to accomplish the same thing with Xcode now (using 2.5 because
> I'm working on this ancient CodeWarrior port):
> - build a resources target, from a bunch of resource files
> - have them merged into one file
> - "flatten that file" so that the resources are all moved into the data
> fork, and I can then use it in my Windows version ( which can read this kind
> of .rsr file).
>
> In Xcode, I've made a Carbon > Resources target, it just has a single build
> phase for "Build ResourceManager Resources"; I've dragged a bunch of
> resource files in there, and it indeed builds into a single merged .rsrc
> product.
>
> But it's not "flat"; all of the resources are in the resource fork (makes
> sense).
>
> But is there a Shell Sript command (or some setting) I could use to move the
> resource fork to the data fork (or whatever accomplishes that?)
I thought I'd answer my own question since it took me so long to find the
actual answer.
First, I was confused. The "Build ResourceManager Resources" phase creates
an .rsrc file, but all of the data is in the data fork already. I didn't
realize that because I could still view it in old res-edit style tools like
Resourcerer, so I though the data was in the resource fork. The .rsrc
extension allows it to be viewed in Resourcer as separate resources - but
viewing the file info shows that it is all in the Data Fork.
So actually, it's already built the way I was requesting; I just hadn't
realized it because I was viewing it with Resourcerer.
Incidentally, you can move resources from the data fork back to the resource
fork or vice versa using the command line ResMerger tool, Reference:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPa
ges/man1/ResMerger.1.html
Here's an example that simply copies a single file having the resources in
the resource fork, and moves them to the data fork:
/Developer/Tools/ResMerger -srcIs RSRC -dstIs DF \
"${SRCROOT}/Resources/File1.rsrc" \
-o "${SRCROOT}/Destination/NewResourceFile.rsrc"
- Stephen
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Stephen Kay
Karma-Lab :: developers of KARMA
http://www.karma-lab.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
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