Using Subversion 1.5 with Xcode 3 to manage libraries over multiple projects

Posts: 15
Joined: 2007.02
Post: #1
I'm at the point where I've got some solid code modules that I want to integrate into multiple projects. I'd also like to be able to fix bugs and make improvements to them while working on any given project, and have those changes reflected in the other projects that use the modules.

For instance, I've got an HID interface class that provides an interface to the user for assigning game commands to various HID controls. If I include it in a game project, and make an improvement to it in the course of this project, I'd like the changes to be reflected in the repository tree for the HID class, and therefore be available to all other projects that use it.

Ideally, the working copy for each project would have the main project code versioned under the appropriate project trunk, and my code modules versioned under their own trunks. So if I changed a code module in one project, the next time I opened a working copy of a different project that references the same module, it would get the updates.

After reading the SCM book and doing some searching, I still can't seem to find a simple way to use Subversion to do that. It looks like that I'd have to do a lot of manual branch merges for multiple projects every time I made changes to a module. Or maybe I'm missing something obvious.

So, is there any way to make this happen, is it bad practice, or am I being an idiot? :P
Quote this message in a reply
Posts: 834
Joined: 2002.09
Post: #2
I'm not sure exactly how I managed to go about it, but it was trivial enough that I never noticed any quirks. All I did was check out my game and engine sources into different working copies (as normally done) and then just drag the engine source into the game's XCode project (as normally done), just ensuring that XCode refers the files in place, not copying them. Then, if you change an engine source file in the game project and commit it, it should commit to the engine repository, and likewise be marked as modified in other game project files that are setup similarily.

In short: just do it, it seems to work. Wink
Quote this message in a reply
Posts: 257
Joined: 2004.06
Post: #3
What about SVN externals?

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Posts: 1,488
Joined: 2002.09
Post: #4
Yeah. What you are looking for is an SVN external.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Posts: 15
Joined: 2007.02
Post: #5
Okay, I got the impression from reading the SVN book that an external wasn't intended for committing code changes back to the external repository, since the examples they gave involved third party repositories. Guess I didn't read closely enough.

If I can't figure that out, or if Xcode acts funny with it, I'll go with Fenrir's suggestion. :)
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #6
Externals are what you want. I find Xcode's subversion integration to be next to useless. Try the command-line or
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Broken Subversion problem BeyondCloister 2 3,956 Jun 20, 2009 12:12 PM
Last Post: BeyondCloister
  Multiple Targets in Xcode maximile 2 3,898 Jan 19, 2008 11:14 PM
Last Post: maximile
  Run multiple targets simultaneously in Xcode? kordova 0 3,586 Dec 20, 2007 12:17 PM
Last Post: kordova
  Subversion Client BeyondCloister 8 5,831 Jun 7, 2006 01:04 PM
Last Post: ravuya
  Complex XCode projects icklefrelp 2 4,219 May 31, 2006 02:50 PM
Last Post: icklefrelp