PDA

View Full Version : Using Subversion 1.5 with Xcode 3 to manage libraries over multiple projects


Sea Manky
2008.06.29, 01:17 PM
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

Fenris
2008.06.29, 01:55 PM
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. ;)

Malarkey
2008.06.29, 02:37 PM
What about SVN externals?

Skorche
2008.06.29, 03:00 PM
Yeah. What you are looking for is an SVN external.

Sea Manky
2008.06.29, 03:40 PM
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. :)

OneSadCookie
2008.06.29, 04:55 PM
Externals are what you want. I find Xcode's subversion integration to be next to useless. Try the command-line or http://versionsapp.com/