WOLips XcodeIndex task

Prompted by my upgrade to Tiger, I dug in and got the XcodeIndex task from WOProject to work:

  • Add this target to your project’s build.xml file.
  • Make sure that the woproject.jar and cayenne.jar are in your class path. Either download WOProject and put the jars into /Developer/Java/Ant/lib/ or add the following to your CLASSPATH: /ECLIPSE_FOLDER/plugins/org.objectstyle.wolips.woproject_1.1.0.102/lib /ECLIPSE_FOLDER/plugins/org.objectstyle.wolips.cayenne_1.1.0.102/lib
  • From the command line, cd to your project’s folder and run: ant xcode.index
    It should create an Xcode.xcode bundle in your project.
  • Open the project in Xcode (ie: by clicking on Xcode.xcode/project.pbxproj). The Sources, Resources, and Frameworks groups should accurately represent your project.
  • Open a Component from the Resources group. WOBuilder should find all of the Classes and Attributes. Rejoice! You only need to do this for the first component after opening a project. Xcode needs to be running but once you’ve established the communication between Xcode and WOBuilder you can hide or minimize it and continue to work in Eclispe/WOLips as usual.
  • Re-run XcodeIndex whenever you add Components, Classes, or Frameworks to your project.

With XcodeIndex working, you will no longer need to apply the scary PrivateFrameworks hack for WOBuilder and EOModeler to operate correctly with Eclipse.

13 thoughts on “WOLips XcodeIndex task

  1. This does work, but there are a couple of caveats:
    1) The generated project file is no good for XCode development. The project is really just a bootstrap to get WOBuilder working. Not an issue if you, and your co-workers, develop in eclipse.

    2) XCode needs to have the project open. (at least for XCode 2.0, that’s all I’ve tested this on).

  2. You are absolutely correct:
    1) The target I provide as a sample only includes enough in the way of resources and classes to satisfy the requirements of WOBuilder and EOModeler. You may be able to extend it to end up with a fully functioning Xcode project (assuming you are using ant to build it) but I’m going to leave it as an exercise for the reader. 😉

    2) Yes, Xcode needs to be running (1.5 or 2.0). I should have been more clear about that. My style of working is to open the first component through Xcode, hit cmd+H and leave it running in the background as I continue to work in Eclipse/WOLIps.

  3. I don’t seem to be getting the proper groups (Sources, Resources, Components, etc)… instead all of the files are in the root group. Did you ever run into this?

  4. You can also create an Ant build task in Eclipse so you don’t need to worry about the command line or class paths to run the task. I’m sure it could be modified to run automatically after a normal build, so you wouldn’t even have to worry about it.

  5. Brendan,

    My only reservation with adding the XcodeIndex task to default Ant build is the additional time it takes (3 seconds on my machine).

    In Eclipse, if you are using Ant and not Incremental to build, the default task will be invoked after every save. So, it is a trade-off between ease of use and performance at this point.

  6. Another option is to make it run only after a clean build. Then it will only generate the Xcode project when you specifically want it to. We have EOGenerator set to only be run when doing a clean build.

  7. Speaking of this whole nasty business… Do you see ALL your variables and paths to your objects’ accessors when using this technique? I only see the variables immediately defined in my components. I don’t see application and I don’t see session. And if there’s an object defined in my component, I don’t see the attributes off that object.

    What a mess…

    Thanks,

    Brendan

  8. Brendan,

    Clean Build: Yes, that would be an option. I have EOGenerator configured that way as well.

    NB (Nasty Business): No, the XcodeIndex task works perfectly for me. I see the application and session along with any local objects in the Component along with their attributes. WOBuilder also “auto completes” Component names when I’m adding using “Add Custom WebObject” from my frameworks, which it didn’t always reliably do before.

    Though, I purchased a new PowerBook and I am feeling the impact of Eclipse+Xcode with the 512MB it shipped with. I hope the 1GB stick I ordered gets here soon. 🙂

  9. I see application and session only when editing a component in my framework. I do not see anything other than locally defined variables in my components in my application. And for those variables that are model objects, I do not see their attributes.

    Any ideas? Maybe I have to re-run the ant task.

  10. Currently I’m not using Subprojects, so I don’t have an answer for you. You might be able to extend the xcode.index task to handle their file structure though.

  11. Well, I finally solved the problem I had not seeing any of my attributes or methods from my model framework and entities. It turns out, my Xcode project had references to my model framework in /Library/Frameworks instead of in my development build directory. Once I changed to that, I was able to see all my attributes and methods from my model objects in WebObjects Builder (even with WO 5.3!). Thanks to David LeBer for all his help.

Comments are closed.