rentzsch.com: tales from the red shed

Making Xcode/Java useable

Java
While I think Xcode is the best development environment yet for ObjC code, I dislike it for Java code. Topping my hate list was its behavior towards new projects. I'd create a new Java project (usually WebObjects) and it would proceed to attempt to index the Java world. For three minutes it would peg processor and reduce the responsiveness of my machine. And for what? Certainly not autocompletion -- CodeSense/Java doesn't seem to work at all (thought CodeSense/ObjC is genuinely useful).

Fortunately, this indexing behavior can be "fixed". I used to do it on a per-project basis. Create a new project and race to the project's property inspector to disable indexing. But, acting on a tip from Jerry Haynes on the webobjects-dev mailing list, I've stopped this behavior for all new projects. The trick is to build the index once, and set have Xcode reuse it across projects.

Here are the magic commands to pull it off:

$ cd /Developer/Extras/Xcode\ Index\ Templates/
$ ./install_templates

That last command took about 17 minutes to complete, and left a 25MB folder in ~/Library/Application\ Support/Apple/Developer\ Tools/Index\ Templates (which you should be able to relocate to /Library/Application\ Support/Apple/Developer\ Tools/Index\ Templates if you'd like to not back it up with the rest of your home folder).

Finally, new Java Xcode projects no longer eat my machine.

It's not enough to get me to actually switch to Xcode for Java stuff (I'm an ant+woproject guy myself), but it helps when I need to use Xcode to get EOModeler and WOBuilder working right.

For those of you who don't know, in order for prototypes (a way of abstracting database-specific type information from your data model) to work right with EOModeler and for WOBuilder to correctly look into your component's .java code, you need an Xcode project housing the necessary resources. I specifically wrote PBXIndex and now XcodeIndex to dynamically generate .pbproj and .xcode files (from your ant project's build.xml file) so I could continue to work in ant+project, while keeping the high-level tools humming along.

Tuesday, June 22, 2004
02:58 PM