Remaining XCode Frustration - Framework Versioning

· by Steve · Read in about 3 min · (623 Words)

Ok, so I’m much more comfortable with XCode than I was to start with. It’s still pretty weird and I personally prefer the way other tools like MSVC organise themselves in terms of project structure and settings, but I can live with it - just. There is, however, one issue which is breaking my balls and I can’t seem to solve it - that is, managing multiple major versions of a framework effectively.

Ogre always has (at least) 2 major versions on the go at any one time, the development version and the stable version. Both will be being updated, but one will have interface breaking changes and the other just bugfixes. Very simple. Now, OS X Frameworks have the ability to store multiple major versions within them, which at first glance seems perfect for my needs.

However, when it comes to referencing frameworks in XCode, you don’t have the option to pick what version of a framework you reference. You can only pick the top-level framework, and it seems that it insists on following the ‘Current’ link to the version which is presently set as the current version when linking. Software built against previous versions presumably still runtime links against the older versions, but at build time you have no choice. So they assume that you only ever want to build against the very latest version of a framework, which totally sucks because I definitely do not. I have 2 versions on the go at all times, at least. Add to that that you can only have one of debug or release builds installed at any one time, and this becomes an organisational nightmare.

I figure I can do something like this: when I switch between versions, and when I switch between debug and release builds, I can flip over the ‘Current’ version link using a ‘ln -s’ to the version I’m currently wanting to build with. Similarly, if I want to flip between debug and release builds I’ll have to copy the appropriate build output from the folder into the /Library/Frameworks. But, this is particularly clunky and error prone. I’ve been hunting around in XCode looking for a ‘reference version X of framework’ option in the external framework link but I can’t see it. The documentation doesn’t even offer any kind of advice on managing multiple versions of a framework, it only pays lip service to the fact there can be multiple major versions, not how to actually organise them. Come on, doesn’t everyone do this? Or does everyone making Mac software only maintain 1 version of everything??

Debug / release builds are poorly managed too - I’m used to being able to link against debug and release whenever I want, but with XCode all I can do is link against whatever is currently built & installed in /Library/Frameworks. In multi-project, multi-library situations that really sucks. I don’t want to have to script the replacement of all frameworks my app references with debug or release versions depending on what I want to run at a particular time. Justin mentioned there might be a way to reference the XCode project instead of the framework to get XCode to do this better, but I couldn’t locate any information on this and my experiments with it failed. The core frameworks use what they call an ‘Umbrella framework’ to allow both debug and release versions to be installed at once, but the docs then strongly advise you not to try to do that for user created frameworks because of more gotchas. Grr.

So now I’m used to the XCode environment, I’m getting really, really annoyed with the logistical set up of the library system. Am I just missing something or is it really this retarded?