Xcode 3.2 SCM with SVN and Complex Project Directories

I started messing around with SCM in Xcode 3.2 using subversion and I had a minor road bump with getting SCM to see modified files outside the project directory. It turns out there's an easy solution, but it wasn't obvious.

I won't go into details on how to setup SVN or SCM for the project, so you can follow this Apple guide for Xcode3: http://developer.apple.com/mac/articles/server/subversionwithxcode3.html

Problem: I have common source that will be shared across different platforms in the source directory, above my Xcode projects directory. The default settings for SCM will look in your projects directory, but I need to look two directories up. (../../)

[caption id="attachment_523" align="aligncenter" width="432" caption="Complex Cross-platform Project Structure"][/caption]

[ad#Link Banner]

We need to modify the project settings for SCM and configure the roots.

  1. Double-click on the project name in the Groups & Files Pane and you'll get the Project Properties window.
  2. [caption id="attachment_531" align="aligncenter" width="456" caption="Project Properties"][/caption]

  3. Click on Configure Roots & SCM in the Project Properties
  4. Set the Root to point above the project directory. In my example, the source folder is located two directories above the Xcode project. I set Roots to "../../"
  5. [caption id="" align="aligncenter" width="392" caption="Project Roots & SCM Settings"][/caption]

  6. Select the SCM repository from one that was setup during the SCM configuration process. I noticed that setting the root will reset the repository, so make sure it doesn't change on you.
  7. [ad#Large Box]

  8. Double-click SCM and we should be able to see any file under SVN version control in the parent directory two levels up. I can see changes to the directories source, images, Xcode, docs, and tests.

SCM File View with All Subdirectories

More Settings

Another helpful setting is to turn on the SCM on the files view.

  • Turn on the SCM on the Editor files view: Right-click on the view bar in the file view on the right side and enable SCM. Now you can see when files have been changed in the normal view outside the SCM view.
  • [caption id="attachment_534" align="alignnone" width="459" caption="Viewing SVN File Changes"][/caption]

  • View Flat Files: If you double-click on SCM in the Groups & Files pane you will get another window. On the bottom left side there is a button. Set it to "Flat" if you like to see just the files that changed without regard to where in the SVN repository they were.
Viewing SCM with the Flat Files view

[ad#Large Box]