Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi .dpr and .dproj - consequences of a mismatch

What are the implications of having a mismatch in the 'uses' list in a Delphi projects .dpr and .dproj files (XE if it's important)?

From first glance it appears that the .dproj gets updated to match the .dpr but is this always the case?

The reason we have this issue is that we need to apply a parameter to the project after checking out of version control, this parameter varies per developer so was always giving us conflicts in version control. We decided to sort this issue using a template file and generating the .dproj file from this. We now have the potential problem of developers forgetting to modify the template when adding/removing .pas files from the project. As I said, it seems to work, but does anyone know any dangers that we may encounter?

Alternatively, does anyone have a better idea for a solution? DProjMaker seems interesting - anyone used it? http://delphi-divining.blogspot.co.uk/2012/10/dprojmaker-tool-to-create-delphi.html

2nd option - could we just remove all .pas links from the templates and rely on Delphi regenerating them when needed? I think this will only affect MSBuild? (can someone confirm)

Additional info in response to comment: The parameter is an encoded string that contains database connection information (and possibly some other stuff, I've not looked too deeply).

In normal (user) operation we have a login program where the user selects which database they want to connect and launches the other apps passing this information as a parameter. As developers we need to launch the programs directly, so we generate the relevant code for the database we're connecting to and have it set as the parameter to be passed to the application in Delphi.

like image 764
Matt Allwood Avatar asked Mar 13 '14 10:03

Matt Allwood


1 Answers

As per Brian Frost suggestion:

The solution is to delete the .dproj files.
Delphi will recreate the file when opening the .dpr file.

like image 69
Johan Avatar answered Oct 07 '22 04:10

Johan