views:

1018

answers:

3

How to find and remove unused Delphi runtime packages from a project that uses packages?

I have a Delphi project that is made up of several packages, in the requires part of the packages there are several Borland/3rd party packages listed (rtl.dcp, vcl.dcp ect) I know I need most of them, but there are ones I know I don't need that have crept in there over time, maybe a component used them once but then that component was removed, or maybe it was from me testing code.

How do I find out which are needed and which are not? and if they are not needed will they still need to be distributed with the final application or have any impact on the size/ memory requirement of the app?

I am trying to make it all as streamline as possible.

+4  A: 

If you specify a package to be used as runime package, all the packages that package requires need to be deployed as runtime package as well. Delphi's compiler automatically checks if this is the case. So you don't need to explicitly require rtl.dcp, as long as you require one of your other packages that does. This means you could only specify the runtime packages you are sure of you need and the rest will be added by the compiler. Then you only need to check what packages you need to deploy in the end.

Lars Truijens
+1  A: 

ICARUS - I thought that it was for .pas files only, but just checked... good for packages too! Free. http://peganza.com/#ICARUS

Pascal Analyzer - Many more tests available than what ICARUS offers, not free. http://peganza.com/#PAL

A: 

I was getting a compile error for a package that I didn't have implicitly called and couldn't figure out how to get rid of. I asked my guru and got the following solution which worked well.

"You can delete the .dproj and open the app (via RAD) using the .dpr file. Do a build and save. Then you should have a .dproj with references to what packages YOU have loaded in Delphi." (instead of what it remembers from previous builds)