|
From: Jonathan P. <jp...@dc...> - 2006-02-13 19:39:18
|
On 13 Feb 2006, at 18:58, David Webster wrote: > I am intending my ruby application to run under different > platforms, but to behave natively. I therefore have created a > number of groups under class groups such as GTK2, COCOA, etc. > There are some files with the same file name under different group > folders, which shouldn't be a problem. Eg: > > /GTK2/AppController.rb > /COCOA/AppController.rb > > The problem is that when XCode builds the .app package, it copies > all the ruby files flatly into the Resources folder and does not > preserve the folder hierarchy, meaning that some files get > overwritten. Is there a way to make XCode preserve the source > folder hierarchy? A couple of solutions come to mind: (1) Add the root folders (GTK2 etc) as "Create Folder References" rather than "Recursively create groups for any added folders". You'll no longer have control over what files show up in the project (just everything in the directory will - including .svn directories etc), but they will get copied in their entirety and the hierarchy will be preserved. (2) Add the files individually as normal, creating Xcode groups as you wish. Go into the project Targets and "New copy files build phase". Edit properties for the build phase and choose Destination: Resources and Path: "GTK2" etc. You can rename the build phase too. Drag the files from the default "Copy Bundle Resources" build phase into the new copy files phase. Repeat for other folders. You could also rename your files so there's no conflict, and pick the appropriate classes at run time (e.g., selecting between GTKAppController and CocoaAppControler). :) Hope that helps, Jonathan |