I have a client application and a test application. If someone adds/removes units to the client application, I would like the same changes to happen to the test application.
I can think of 3 ways to do it, but all have drawbacks
1. Manually update the Test project uses list in the dpr.
The problem here is obvious, requires manual intervention per project.
2. Use a shared .inc file that contains the list of used units (list of frmXXX in ‘\forms\frmXXX.pas’…)
IDE doesn’t like .inc files in the project file and would again require manual work to maintain
3. Same as #2, but use a shared unit instead of .inc file. So instead of updating the .inc you update the shared .pas
IDE would not really consider the files used by a shared unit as files in the project and they wouldn’t get listed in View Unit dialog
Are there any other ways to keep uses lists of multiple projects in sync that I’m missing ?
Currently using D2007 but hopefully that doesn’t matter.
You could use a build tool like Apache Ant, maintain the unit names in the script file (or a configuration file), and let Ant replace a placeholder in all *.dpr files using the replace task.
This would regenerate the dpr file automatically and keep them in sync.