How can I use a Delphi XE2 project without single aliases?
I would like to compile my XE2 project without unit aliases but cannot get it to work.
I tried the following:
-
<DCC_UnitAlias />
in * .dproj -
<DCC_UnitAlias>$(DCC_UnitAlias)</DCC_UnitAlias>
-
<DCC_UnitAlias>;$(DCC_UnitAlias)</DCC_UnitAlias>
- Not
DCC_UnitAlias
in * .dproj
This either results in a compiler error [DCC Fataler Fehler] F1030 Ungültige Compileranweisung: '-A;Generics.Collections=System.Generics.Collections;...
(which means something like [DCC Fatal error] F1030 Invalid compiler directive: '-A;Generics.Collections=System.Generics.Collections;...
)
or enabling some default aliases: -AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE
I know this is not a big problem, but it annoys me somehow. :-)
FWIW: <DCC_UnitAlias />
works in D2007.
source to share
In Delphi 10.1, it looks like default aliases are added non-standard to the $ (BDS) \ Bin \ CodeGear.Common.Targets file . I am assuming it is similar to XE2 but not installed for testing.
<UnitAliases>Generics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE</UnitAliases>
<UnitAliases Condition="'$(DCC_UnitAlias)'!=''">$(DCC_UnitAlias)$(UnitAliases)</UnitAliases>
Removing the first UnitAliases tag will allow you to more accurately define your defaults for each project. Beware of the DO NOT CHANGE warning at the top of this file.
source to share