Reputation: 3056
I am migrating from Delphi 2009 to Delphi 10.4 Sydney and I am updating the convention that I will use for the organization of my Delphi custom packages.
To see how the things should work in Delphi 10.4 Sydney, I installed 'LockBox2-2021.05-Sydney' with standard GetIt package manager that comes with Delphi, that is recent addition to Delphi and that appartently defines the best practices/conventions how the packages should be used and installed.
These are my observations:
This works and this seems to be the standard way of doing things for Delphi 10.4 Sydney. But it is a bit strang, I should acknowledge - each Delphi project recompiles the dcu for any package it uses. Is it good practice? Should I accept this practice? Why not accept? Maybe such recompilation overhad is not necessary, is there reason for such recompilation each time?
My understanding is that the definition of "library path" was a bit different for the Delphi 2009 ("Tools - Options - Environment Options - Delphi Optios - Library-Win32 - Library path": we usually organzed our packages in a way that put compiled *.dcu units (from the source code of packages) in one common directory, e.g. D:/Library/Delphi2009 and then we put this D:/Library/Delphi2009 into "Library path" and any custom Delphi project was able to see that the *.dcu units from the pacakges was available and visible from the library path and any Delphi project could access these dcu units from D:/Library/Delphi2009, so, there was no need for Delphi 2009 to recompile the packages *.pas files into packages *.dcu units each time when any Delphi 2009 project use that package/component.
So - this is really strange redefinition of the meaning of the "Library Path" - it was the directory for .dcu units in the Delphi 2009 times and now (Delphi 10.4 Sydney times) it is the directory for the packages/components source files (.pas) that are commonly visible to each project and that each project uses for compiling its own *.dcu units for the packages/components.
Does really such redefinition of the meaning of "Library path" happened and should I really put my component/pacakge source in the directories that I should include in the "Library path" and should I really ask Delphi compiler to recompiler dcu units (of packages/components) for each of my custom Delphi project?
Of course, formally my question contains multiple questions, but these are just details to the general question about the best practice/standard how to organize packages in the the Delphi 10.4 Sydney and beyond.
Upvotes: 0
Views: 221
Reputation: 47704
Your look at what has to go into Library Path is correct. Most libraries follow this approach and put the path to the platform dcu into Library Path and the debug dcu path appropriately. It seems that at least some of the TurboPack libraries break this convention and put the source path into Library Path. This may be convenient as you don't have to copy the dfm files to these folders, but it is definitely the wrong approach. I suggest filing a report for that.
Upvotes: 2