delphidelphi-xe2

Automatic dependency compilation in Delphi


I am very new to whole Delphi EcoSystem. I am using Rad Studio XE2.

Let's say I have a very simple case.

Projects A, B and C. C is dependent on B. B is dependent on A.

This is also how I have setup the dependencies using the 'Project Dependencies' IDE GUI.

C is the project that produces the executable. It is set as the 'current project'.

If I modify a file in project B and hit F5 (run) I would expect only projects B and C to compile.

However project A is rebuilt always!! This is the case even if I modify a source file in project C.

Am I doing something wrong? If so, any ideas as to what it could be?

Or is this just the way the IDE works?

A customer has a large legacy codebase and use XE2. At the moment they are manually handling the recompilation of dependent projects by right clicking on the lowest project that needs to be recompiled and selecting 'Build From Here...'.

When I discovered the 'Project Dependencies' feature in XE2 I thought this would be the solution to this problem.

* EDIT *

Ok. I will try to explain this a little bit better, as I see my question/concern is not really coming through.

I have a groupproject which consists of many BPL projects (which as far as I understand output a DLL) and one executable project: C.exe.

C.exe references all the BPL projects, including A.BPL and B.BPL. Now if I modify the code in any of the BPL projects and just execute 'Run' C.exe will launch but the changes I just did will not take effect as the BPL projects were not recompiled. This is actually my pain point. All IDE's I have used so far would also recompile the dependent dll's. Of course, assuming the project is setup properly. And now to my question. I do not know if the project is just not setup properly or if this is a limitation of the IDE. If I right click on the modified BPL project and select 'Compile From Here' and then execute 'Run' my changes will take effect. However it is quite annoying to have to do this, when I am so accustomed to just running the executable without having to worry about recompiling dependencies.

As described above I did try using the 'Dependencies' feature of the IDE. However the behavior is very odd (to me). It will recompile dependencies even when their source code was not modified.


Solution

  • Your expectations are wrong. The documentation says:

    Project > Dependencies

    Creates project dependencies within a project group. From the list, choose the projects to build before building the selected project.

    The behaviour you see is intended.