简体   繁体   中英

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.

As per Brian Frost suggestion:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM