Reorganizing a project in the CodeWarrior IDE

This is still somewhat in progress. The XML representation of a CodeWarrior project is big and hairy, and you've got multiple entries in there for every file. I'd like to add more information about tricks you can play with an XML editor, but I haven't had the time to figure them out, let alone document them all.

A common problem I have as a Mac contractor is coming into a project which has grown by accretion over a period of many years. One of the first items that I usually spot that needs to be done is some cleanup of the CodeWarrior project file. This is typically very difficult, as it's not an easy task to hunt down one file out of a thousand or so within a project that's poorly organized.

You could try to drag files around within the project window in CodeWarrior, but that approach has the following problems:

I've found (I'm probably not the first, by any means) what I think is a better strategy. Here's the strategy I've developed for reorganizing the files within groups in order to bring sense to the project file after the fact.

  1. Export the project file as XML
  2. Search for the <GROUP> entries
  3. Move files from one group to another as needed, by editing the XML (I use BBEdit, but a dedicated XML editor can make things even easier).
  4. Re-import the project and bask in the glory of being able to actually find the files you need to work on.

Note also that saving the project file as XML means you can version control it and do text-compares of the project. The big problem is that changes made in the IDE directly can shuffle parts of the file around, making for huge differences. Editing by hand means that you've got the possibility of forgetting to add one of the entries, causing the compiler to gack on the file.

I'm still searching for a better solution to the problem, but I think with a little pre-processing, it should be possible to use an editor with a lot better UI than the CodeWarrior IDE.

Copyright 2009, Dave Polaschek. Last updated on Mon, 15 Feb 2010 14:09:27.