1

I'm using Delphi XE2. I have a large project that has an application (EXE) that uses runtime packages, a Core.bpl custom package (used by the EXE) and several other custom Plugin.bpl packages that also use the Core.bpl package (as a runtime package).

I have noticed that I can make minor changes to the Core.bpl without recompiling the EXE or custom Plugin.bpl packages. But more significant changes (adding a lot of code or removing a lot of code from an existing method, or adding new methods) causes problems. Sometimes there are inconsistent access violations, sometimes there are errors about missing entry points in the Core.bpl package, etc.

I want to minimize the number of files that are compiled so that our users have fewer files to update with each release. However, I don't want them to see errors like I sometimes see.

Should I recompile all the modules and the EXE that uses Core.bpl each time it changes, or are there some general rules to follow so that everything only gets compiled for certain types of changes to the Core.bpl?

James L.
  • 9,384
  • 5
  • 38
  • 77
  • 3
    If you change the interface then you must recompile all dependend parts – Sir Rufo Jul 27 '13 at 06:50
  • @SirRufo make it an answer .. – bummi Jul 27 '13 at 06:52
  • @SirRufo - Is that to say, if you add, change or remove methods or properties, then you must recompile everything, but if you simply change the code of an existing method without changing its parameters, then nothing needs to be recompiled? – James L. Jul 27 '13 at 07:12
  • Yes, thats the point :o) – Sir Rufo Jul 27 '13 at 07:22
  • @SirRufo - Thanks, if you make it an answer, I'll mark it correct... – James L. Jul 27 '13 at 07:25
  • Some additional informations [bpl_vs_dll](http://delphi.about.com/od/objectpascalide/a/bpl_vs_dll.htm) – bummi Jul 27 '13 at 07:38
  • 1
    Thanks @bummi for the additional info. – James L. Jul 27 '13 at 07:54
  • 1
    Modifying private members also changes the interface. Basically any changes made above the `implementation` line require a rebuild of all dependent code. – afrazier Jul 27 '13 at 14:27
  • @afrazier - I like they way you worded your comment. That's an easier way of looking at it -- especially since the word `interface` has multiple meanings. You should type it as an answer so that people can upvote it. – James L. Jul 27 '13 at 18:01

1 Answers1

3

Every time you change the interface section of a unit in a BPL you have to recompile the depended parts (EXE or other BPL).

afrazier
  • 4,784
  • 2
  • 27
  • 30
Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
  • That is to say, anything above the `implementation` line. – James L. Jul 27 '13 at 18:03
  • @JamesL. The **interface section** starts at the word **interface** and ends just before the word **implementation** – Sir Rufo Jul 27 '13 at 20:00
  • Yes - I realize that. When I first read the word `interface` in your comment above, I thought you were talking about interfaces in the programming sense of the word. But then realized you meant as it pertains to a Delphi unit. – James L. Jul 28 '13 at 06:10