« Out of hiding and into the fire | Main | Karelia Software previews Sandvox »

June 15, 2005

Surviving (and enjoying) Xcode 2.1

As Dan decried on his blog Monday night, our transition from Xcode 2.0 to Xcode 2.1 wasn't the smoothest it could have been. I just wanted to mention that, with a little help from Jonathan Wight, I did get things building that night and I'm really looking forward to the other improvements and new features in 2.1. For the record, we won't be going back to 2.0. Intel will happen.

So what was all the fuss? It turned out to be, I believe, a complex interaction of target-based build settings that were inconsistent across our frameworks. To make sure that Sandvox is incredibly extensible, I keep pushing more and more code into a public framework that we'll expose to third party developers. There are roughly 35 targets in this framework: the main framework itself, and various categories of plugins. Wrangling all of these into a common build system under 2.1 proved to be quite a chore.

The upgrade process from 2.0 to 2.1 creates a new .xcodeproj project file and, apparently, copies the old project settings to every target. Some interaction among the various target settings and the project configuration settings caused the framework to be effectively undebuggable with gdb. Exactly why, I'm still not completely sure.

Following Jon's advice, I basically removed any and all customized settings at the project configuration level. I then set up several Xcode configuration files, new in 2.1, that hold purely text-based representations of the various settings. I set up essentially six configuration files, one for Application, one for Framework, one for Bundle, with both Debug and Release variants. I then set each target to base its configuration on a particular file, depending on project type and configuration.

This turned out to actually be a very clean approach: each target now builds from a very transparent configuration file, often varying only in Product Name, Wrapper Extension, and location of its Info.plist. Getting to that state, though, was no small amount of work!

I'm still not sure Apple's cracked the nut on this one: it's really nice to base everything off a few common text files, but it also feels like a step backwards. I've effectively abandoned the GUI. I'm back to worrying about things like GCC_GENERATE_DEBUGGING_SYMBOLS rather than just flipping a switch. Is this progress?

Still, though, dependency analysis seems much better with Xcode 2.1: that, plus the addition of conditional breakpoints, breakpoint actions, and watchpoints certainly make the upgrade worthwhile. Don't let it scare you...

Posted by ttalbot at June 15, 2005 3:06 PM