tags:

views:

284

answers:

2

If I launch the RAD Studio command prompt and run

msbuild /t:Rebuild

in a project directory, msbuild will show the full command line to invoke dcc32, including all path settings.

Which kind of magic does MSBuild use to find the search paths, based on the IDE settings (stored in the registry) and the project file (which contains placeholders like $(DCC_UnitSearchPath)?

The RAD Studio command prompt only sets the .Net environment for MSBuild. So there is something else working behind the scenes?

A: 

Have you walked up the inclusions of the project? You should be able to divine where it's being calculated (i.e., which Task) and the use Reflector to reverse engineer it. Remember, an MSBuild is just [very wacky] text.

Or you could turn on detailed logging and discover which Task computes it that way.

Or you could use procmon to monitor which regkeys are being probed etc.

Or you could wait for Barry to come along and give a definitive answer :P

Ruben Bartelink
+7  A: 

If you examine the project file, you'll notice that it includes CodeGear.Delphi.Targets which includes CodeGear.Common.Targets which in turn includes EnvOptions.proj. EnvOptions.proj is updated by the IDE to contain the paths from the registry.

Jon Benedicto
Sorry I can not find EnvOptions.proj (or the directory), it is referenced as $(APPDATA)\CodeGear\$(BDSAppDataBaseDir)\6.0\EnvOptions.proj
mjustin
Look in C:\Documents and Settings\<User Name>\Application Data\CodeGear\BDS\6.0 if you're on XP, or C:\Users\<User Name>\AppData\Roaming\CodeGear\BDS\6.0 if you're on Vista or Windows 7.
Jon Benedicto
Thank you! My first search did not include hidden folders :P
mjustin