问题
How can I specify project-specific package settings in the Delphi 2010 IDE? Changing the packages in the project options does change the packages for all projects in the project group.
This is annoying because I build my application with a package that needs to be disabled in order to compile the BPLs in the project group.
回答1:
As said in my comment to vcldeveloper's answer (which has somehow vanished now) I can confirm that behaviour. Although I don't know about the intrinsics, I can try to give some hints for an explanation.
When you disable a package in the project options, this will unload this package (and perhaps some more) from the IDE. If it were the case that these settings are unique to each project in the same projectgroup, a simple switching of the project would have to load/unload designtime packages in the IDE. Besides the performance drop, this might be possible to implement.
Let's assume we have two projects in a projectgroup each containing a form with some components. Form1 in Project1 uses a component from Package1 and Form2 in Project2 a component from Package2. For some reason both packages are mutually exclusive. Given the (non-existent) behaviour as explained before, switching between both projects will load/unload the corresponding packages.
But nobody hinders you to open Form2 from Project2 requiring Package2 while still Project1 is selected (which means Package2 is unloaded). Thus the component used on Form2 is unkown and the form cannot be loaded.
Moreover, assume Project1 is selected and Form1 from Project1 is open while you switch to Project2. This would unload Package1 - making the component on Form1 vanish?
There is a reason to keep the packages needed or excluded by all projects in a projectgroup in synch.
A solution to your problem might be to use separate projectgroups.
来源:https://stackoverflow.com/questions/2296439/how-to-specify-project-specific-package-settings