More than two years ago I coded smallish tool for controlling Xcode from command line. It was ruby script talking to Xcode application via AppleScript. I developed it for Xcode3 so when everybody switched to Xcode4 some functionality stopped working because AppleScript support in Xcode was never official and nobody guaranteed compatibility between versions or even availability of AppleScript API.
I performed several half-hearted attempts to fix it, first by figuring out what’s left of AppleScript support in new Xcode, then trying to parse pbxproj file using ruby, and then writing parser in obj-c. Which was waste of time because it’s simple NSDictionary representation that can be parsed by NSDictionary’s dictionaryWithContentsOfFile call. I figured it out while working on my Xcode localization tool project that requires read-only access to the project file. But once started there was no reason not to try modifying the pbxproj file. As a result xcs-objc project was reborn as a xcs2 and started to get some meat around its bones. So far there is only “list” and “rm” subcommands. “rmdir” seems to be obvious for the next step and then I’ll start toying with adding new items to project.