10
votes

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?

2

2 Answers

17
votes

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.

1
votes

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