A few weeks ago I got me a Macbook (not a Pro, just the lowly Black model) and so I had to go through all the setup steps again. Things have changed a bit since I documented this before, so here's the new info for Posterity:
First, I downloaded p4v, p4d, p4 and p4web from the Perforce website. I won't give URLs as they change when versions change. The last two are Beta versions of the Universal builds of those tools.
To install I mostly followed the directions at http://www.piap.com/faq/p4_setup.html but I made some changes:
- put p4d, p4 and p4web in /usr/local/bin
- create .bash_profile for each user:
export P4ROOT=/Users/perforce/p4root
export P4PORT=1666
export PATH=$PATH:/usr/local/bin - StartupItems have been replaced by launchd in Tiger, so create
/Library/LaunchDaemons/com.perforce.p4d.plist
based on sample file at http://www.stuffonfire.com/2006/01.
I had to reboot before this worked properly, but I'm not sure that's supposed to be necessary.
- Install p4merge and p4v from dmg into /Developer/Applications
Now Perforce is nominally installed, but you've still got some setup to do. I found a few references that were helpful with this:
- Helpful site, though out of date: http://www.math.columbia.edu/~bayer/OSX/Perforce
- Mac specific notes: http://www.perforce.com/perforce/technotes/note071.html
- The relevant part of the Xcode docs starts here: http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/index.html
So, my steps, which roughly follow those at the Columbia link above:
- start p4
- connect to localhost:1666
- select new user
- fill in form to create new user
- select new workspace
- fill in name (mendis in my case)
- set Root (/Users/janine/mendis). This would normally be a directory containing files to check in, but in this case I don't have any yet
- Launch XCode, create project with directory inside your workspace root
- Go to SCM->Configure SCM. Select Perforce, then edit to change settings (p4client is workspace name = mendis). Check box to Enable SCM.
- Mark project directory for add. Since you haven't done anything in it yet, you don't have to worry about reverting the build directory. There may be other files you don't want to put under SCM control but I don't know about them yet.
- Double-click on name of changelist to submit it
What you will now find is that regular files can be checked out and in via XCode just fine. Unfortunately, things fall apart when WOBuilder enters the picture. It always makes files writeable, and doesn't check them out first. So to be on the safe side, when working with WO it's probably smart to do a manual checkout before all edits. This is obviously a drawback to using Perforce; I haven't decided yet if it's worth the hassle or not.
By the way, since I'm sure someone will ask: I'm using XCode instead of Eclipse because that's what Griffin uses, and he wanted us to be using the same tools. And I'm using Perforce instead of Subversion because I wanted to try it out. Subversion doesn't really seem like it's enough better than CVS to be worth the hassle. I might yet go back to it, though, if Perforce turns out to be too much of a nuisance.
The WOBuilder problem goes away when using Eclipse, simply because there is no WOBuilder and .wod files get edited directly instead. I'm not sure I'm quite ready for that one. :)