A few months ago I decided to embark on some major re-factoring of our code base. I knew that one of the toughest tasks I wanted to perform was going to be the renaming of 1000's of units. Renaming the files was easy. Fixing all the broken unit clauses was going to be tricky.


A few months ago I decided to embark on some major re-factoring of our code base. I knew that one of the toughest tasks I wanted to perform was going to be the renaming of 1000's of units. Renaming the files was easy. Fixing all the broken unit clauses was going to be tricky.

To make the job easier I ended up writing the "Delphi Unit Dependency Scanner". It scans your source code and builds up a tree of the dependencies between your units. Once the source has been scanned, you can run a search and replace on unit names. Not only are the file names changed, but also the uses clauses in all the affected units.

I found that the application gives you a great overview of your source code. It helps in finding units that are not used, locating circular references, actual lines of code etc.

I can't open source the code, but if anybody is interested in getting a copy, let me know and I'll knock together an installer and put it online.

Comments

  1. Do you have any plans on graphical representation?

    ReplyDelete
  2. I think we (programmers) don't need an installer :)
    Just put an executable online and done :)

    ReplyDelete
  3. I'd like to have a copy, as well. I have been tempted myself, to write one.

    ReplyDelete
  4. Krom Stern - Not really... what were you thinking of?

    ReplyDelete
  5. Hello Paul! Sounds great. I'm interested, too.
    Thanks in advance!!
    Klaus

    ReplyDelete
  6. I just joined but already I'm seeing something that could be useful, if you release it that is :)

    ReplyDelete
  7. Wow! Definitely a very handy tool for some of the old projects I have to maintain. More out of curiosity than anything, but is there a reason you can't open-source it? Or just a preference? Anyway great application, I'll definitely give it a go! Thanks!

    ReplyDelete
  8. Colin Johnsun - Thanks :) The reason it can't be open sourced is that it uses several libraries that we use in our commercial products.

    ReplyDelete
  9. Paul Thornton That's understandable. In any case, thanks for making your tool publicly available.

    ReplyDelete

Post a Comment