Can I prevent XE8 from adding System.ImageList?

A form in XE8 automatically adds the use of System.ImageList. As the embarcadero website says:

System.ImageList contains code common to FireMonkey and VCL that implement the most basic device-independent image list functions. System.ImageList contains code that supports the interaction between images in the image list and the use of their components (for example, controls, menu items, etc.).

But my colleagues mostly still use XE7. Now they have to delete, which is used constantly after my commit. My XE8 automatically adds this when I remove it. I could remove the usage before I finish working with another editor. But it would be more productive if I could stop XE8 from adding this piece of code. Or will Firemonkey and VCL stop working correctly?

So my question is: can I prevent XE8 from adding System.ImageList to my uses on the form?

+6
source share
1 answer

Can I prevent XE8 from adding System.ImageList to my form applications?

No. The IDE will do it that it can. Your options include:

  • Wrap the device in a conditional expression so that the XE7 compiler does not see it.
  • Create a dummy empty unit named System.ImageList , which you will list in the .dpr file, again wrapped in conditional code, so that it is visible only to the XE7 compiler.
  • Support separate .dproj files for different versions. In XE7, add a module alias that maps System.ImageList to System .
  • Removing a device before committing using a text editor or script.
  • So that your team standardizes the general version of Delphi.

Personally, I would recommend the latter option. Remember that you can happily install several versions of Delphi side by side and, if necessary, use different versions for different projects. This is important when maintaining the release branches of your program.

If you just can't do this, then a device alias is probably the least invasive option. I think you do not have a .dproj file under version control, because if you did, you would have similar problems with XE7 changing the version of XE8 and vice versa. Therefore, if the .dproj file is out of version control, it should be easy enough to make changes locally only for XE7 users. But such a trick should only be considered a temporary step to keep you afloat until you are in the same version of Delphi.

More generally, Embarcadero currently releases new versions very often. It is worth the time to upgrade. You must install, smooth out any problems with the compilation, test the assembly under the compiler and fix any defects that arise. You do not need to accept all updates. It’s ok to skip some. It may be more effective. At my workplace, we switched from XE3 to XE7 and are not going to accept XE8. If you upgrade, make sure the benefits outweigh the costs.

+8
source

All Articles