7
votes

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.

1
+1 Pity about the down-vote, seems a perfectly good question to me.MartynA
My suggestion would be to find a way to solve the problem without having developer specific settings. That should be possible and will bypass the need to find an answer here. It also makes your QA much more robust.David Heffernan
What is this parameter you have to apply? What does it control? Perhaps you can use a *.inc file or similar.Uli Gerhardt
Yeah, I think I'd read that param off disk, only on a dev machine. Much better solution.David Heffernan
I'm the author of DprojMaker. It was written to semi-automate the creation of dproj's from dpr's when, like me, you have a couple of dozen apps. It's not a panacea though, and frankly you can never do better than to delete the dproj, open the dpr and let Delphi recreate it. Lots of niggles can then go away such as inability to remote debug, weird xml parameters that cause phantom warnings etc - all acquired by letting Delphi 1..XE5 continually 'upgrade' the dproj by itself! I also know that others on here manually edit the proj but that's not for the faint-hearted...Brian Frost

1 Answers

1
votes

As per Brian Frost suggestion:

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