views:

338

answers:

5

We're trying to untangle a hairball of 100's of units, removing some.

It would be helpful if there was tool that would show us what units were explicitly using unit X.

Penganza doesn't seem to have a report that does that. (Although it has lots of other useful reports.)

Can anyone suggest a tool or strategy for doing this, other than just hiding unit x and then hitting F9 ... repeatedly?

+3  A: 

GExperts can show Project Dependencies.

TOndrej
and it's free! :-)
Warren P
A: 

From a similar question here

You might want to take a look at at CnPack.
CnPack includes a Uses cleaner wizard wich hasn't failed me yet.

Lieven
And it's free too. Like GExperts. Lots of people use CNPack.
Warren P
+3  A: 

Peganza Pascal Analyzer can do the work. I haven't worked with it much, but a former dev here wrote a system that uses PAL to do the analysis, then dumped the results into a database, and then there's a browser app that lets you enter a unit name and it returns the list of units affected, whether they would need to be rebuilt if the unit changed, or if the interface changed. We use lots of BPLs so you can sometimes change a unit and you don't have to re-build other binaries that use your unit, unless the interface changed. This saves us lots of work (hundreds of BPLs and EXEs).

Chris

Chris Thornton
PAL is commercial but SO WORTH IT. We love PAL here! They just release version 5.0 I am not sure why the personal stuff had to be included. Could you remove that please?
Warren P
@Warren P and @Chris Thornton. Agreed. Personal stuff edited out.
François
Agreed on the personal stuff, but the point I was making is that we really don't know how it works, and don't really have code to share, if requested.
Chris Thornton
+4  A: 

MMX (Model Maker Code Explorer) has a nice unit dependency analyzer (it is especially good at detecting cycles).

For more details, see this answer.

--jeroen

Jeroen Pluimers
MMX is a fab tool that does LOTS of cool things! Every delphi user should try it.
Warren P
If you should go the Model Maker route, you should check out Lattix. Modelmaker can create files usable in Lattix to view a Dependency Structure Matrix.
Lieven
A: 

I was going to mention Icarus, but when I googled them I got this stack overflow answer, which you might want to check out.

Then again, sometimes I just like to delete my whole Unit Output Directory, then count my new DCU's, and that works too.

The reason you may like Icarus and not GExperts is that it doesn't rely on you to have properly maintained the uses statements in your project file.

Peter Turner