April 23, 2004

Xcode and moving your project: An oddity

I came across some strange xcode behavior. I have a certain webobjects app that I always check out of cvs into the same directory. Every thing is fine. One day, I decide to check it out into a different directory. When I went to build the app, I got a mess of errors ("Missing File or Directory: ") about a whole bunch of java files not being found. (not all of them, mind you, just some) It was looking for them in the place I used to check the files out. I cleaned the project. I rm -r the whole build directory and the xcode/WO files in /tmp. I grepped throught the whole project looking from some reference to the old file path. Nothing. I knew xcode had to be remembering something independent of my project, because I could checkout the project on another computer, and it would build just fine.

Eventually I changed the location of the build results to a new directory. BAM, it worked just fine. Somehow whatever it was remembering was tied to the build location. Selecting the option to put the build results in the same directory as your project would probably fix this, since if you checkout to a new location, it will be building in a new location.

For now, since I really don't like putting the build results in my project folder, I just change the location of the build folder from ~/tmp to ~/tmp2, and build. If I ever checkout to a new location again, I change the build folder back to ~/tmp. (Once you change the folder, changing it back doesn't seem to create a problem.)

Perhaps there is a very obvious reason for this behavior. But if there is, I do not know it.

Posted by brad at April 23, 2004 01:04 PM