Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advantages of NOT versioning .dproj

I read in a blog about Version Insight (http://www.delphifeeds.com/go/s/77066) that (among others) JCL doesn't have its .dproj files under version control and i was wondering what the advantages of that would be.

Especially since me and my collegue developer often "bug" each other with checking in project files with our own favorite debug settings (he likes optimization on, I want it off). And because of the regular hick ups of Delphi 2007 that screw up the dproj file with all kinds of faulty dependencies. Does not versioning help in anyway with these things?

We are using Starteam as our VCS at the moment.

like image 969
Bascy Avatar asked Feb 20 '11 20:02

Bascy


2 Answers

If you're using Delphi 2009 or later Option Sets are a perfect solution for this problem.

Option sets are basically collections of settings that would normally reside in the DPROJ (which you do version) but instead stored in a .OPTSET file (which you don't version).

Make your DPROJ contain the settings that are common to all developers, that nobody is allowed to change unless it's an agreed across the board change.

Next in the project manager (D2009 and above) on first the DEBUG configuration node and then the RELEASE configuration node, right click and select "New Option Set". Call this option set something like "Local Developer Debug Settings.optset" and "Local Developer Release Settings.optset".

Now commit only your DPROJ to version control as it now refers to these .OPTSET files. You must name your option sets exactly the same on each machine for this reason.

When you want to make a local change to your project configuration rather than editing the project configuration, right click on the Option Set in the project manager and select "Edit Option Set".

The IDE will apply the changed settings from the option sets without modifying the original DPROJ. Settings are applied hierarchicly with option sets being the last to be applied.

like image 173
LachlanG Avatar answered Nov 06 '22 15:11

LachlanG


I store, in my .dproj files, settings that are used by msbuild for my build process. For example, conditional defines, compiler settings, etc. If you do the same then you need to version them.

If you are using a version of Delphi where the IDE breaks the .dproj file on a regular basis, then surely revision control will help you fight back.

I can't see any advantage in not versioning them.

like image 34
David Heffernan Avatar answered Nov 06 '22 16:11

David Heffernan