Experiences with Project Builder
by James Duncan Davidson
The centerpiece application on the Developer Tools CD that ships with every copy of Mac OS X is an Integrated Development Environment (IDE) called Project Builder. This is a new effort from Apple that is adept at writing C based kernel modules, Objective C Cocoa applications, C++ based I/O drivers, and general purpose Java work. Unlike most Java capable IDEs, it launches quickly and doesn't completely take over your monitor with tool bars and windows.
When I say that it launches quickly, I mean that it launches extremely fast compared to most of the other IDEs on the market. On my PowerBook G4, Project Builder is ready for action less than 5 seconds after double clicking on the application's icon. Contrast this to other Java capable IDEs that take half a minute, a minute, or more to launch. To be fair, Project Builder doesn't sport some the feature list of other IDEs. Notably it leaves interface building to external applications. And that is fine by me as I have been asking IDE makers to make a simplier tool for a long time. One that I can edit, build, and debug code in. Project Builder delivers just this and does it fairly well.
Project Builder comes with starter projects for writing Java applets, Java AWT based applications, Java Cocoa based applications, and a generic Java project type called "Java Tool". All of these starter projects are set up to easily build reasonable products. In fact, the Java AWT based Application builds MRJ based application bundles of the type that I described in my last weblog entry.
But what if you don't want to start a new project? What if you want to use Project Builder to work on an existing project? I wrestled with this for a while until one of the Apple developers turned me onto the misnamed "Legacy Makefile" target. The trick is to create a new target of this type, and then customize it to do execute whatever command you need to. The target takes essentially three important pieces of information:
- Program to execute.
- Directory to execute in
With this target, you can execute any command you want anywhere on your system. Really, this should have been named the "Custom Build Command" target type. After finding this out and setting it up to use my own build tools, I have found myself doing most of my day to day Java coding in Project Builder.
Not withstanding the good points, Project Builder is a freshman effort, and there are several rough spots that I hope Apple fixes soon. One such rough spot is that break point makers don't maintain their relative position as you edit the code that they point to. This means that when I'm in a debugging session, and editing code, I have to keep adjusting my break points.
There also seems to be an intermittent performance issue when debugging Java code. So far, it only seems to strike me when my laptop is configured with a hostname that can not be resolved (for example, when I unplug from a DHCP network). If I have my hostname set to localhost, debugging works fine. I haven't conclusively proven this yet, and your mileage may vary, but it seems to work for me. Apple's developers are aware of the issue and have said that they have a fix in the works.
Even with the rough spots, Project Builder is a nice tool. If Apple keeps improving it, I may have finally found a lightweight, fast, easy to use IDE that satisfies. Something that no IDE yet has been able to do for me.