jpluimers / GExperts

Synced every now and then from git svn clone https://svn.code.sf.net/p/gexperts/code/trunk; Syncing steps: first time `git svn clone https://svn.code.sf.net/p/gexperts/code/trunk GExperts.git-svn`, then `git remote add origin https://github.com/jpluimers/GExperts.git` and `git push origin master`, then each additional time from inside the `GExperts.git-svn` directory: `git svn fetch` followed by `git svn rebase` and `git push origin`
https://blog.dummzeuch.de/gexperts
5 stars 1 forks source link

`GX_GenericUtils.pas` fails to build in Delphi 2007 because it uses unit `UITypes` #22

Open jpluimers opened 5 years ago

jpluimers commented 5 years ago

https://github.com/jpluimers/GExperts/blame/master/Source/Utils/GX_GenericUtils.pas via https://sourceforge.net/p/gexperts/code/2200/ added unit UITypes to the interface uses list of GX_GenericUtils which causes the build to fail as it was only added in Delphi XE2, so it is not available in Delphi XE or lower.

This fails in the Delphi 2007 based standalone projects.

A unit alias might solve this, but I need to investigate if this always works.

jpluimers commented 5 years ago

Unit aliases should work, as for the Delphi 1 -> Delphi 2 migrations, these aliases were used where multiple units pointed to the same one:

WinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE

See https://stackoverflow.com/questions/284091/wintypes-dcu-not-found-and-code-completion-stops-working/284290#284290

This means a unit alias should work.

jpluimers commented 5 years ago

Adding this after each <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM> line in the below Delphi 2007 projects should work:

    <DCC_UnitAlias>UITypes=Types</DCC_UnitAlias>

If it fails, then try this one:

    <DCC_UnitAlias>Actions=ActnList;ImageList=ImgList;UITypes=Types</DCC_UnitAlias>

Based on https://github.com/jpluimers/GExperts/commit/790c84b79c1aaeb6420388d3c919dcd42ed6aa83

Affected .dproj files:

Not needed:

jpluimers commented 5 years ago

SVN patch https://gist.github.com/jpluimers/b70a5d48c3eb9302762ad1b6644a8a81

jpluimers commented 5 years ago

https://sourceforge.net/p/gexperts/bugs/99/

jpluimers commented 5 years ago

Partially worked around in https://github.com/jpluimers/GExperts/commit/a909add691c316909cd6f318d1391b24415c2d71 originating from https://sourceforge.net/p/gexperts/code/2478

This will break again when Delphi >= XE2 auto adds the UITypes in a uses-list.