if I change the compiler action property between DELPHI XE2 to DELPHI XE4 , it seems that the name space prefixes are resetted and I can’t compile my projects any longer.
I need to copy the string
“System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging; Vcl.Touch;Vcl.Samples;Vcl.Shell;Winapi;System.Win; Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win”
again in the name space edit box in order to compile my applications again.
using FB 7.0.0.2232
Delphi XE2 and XE 4
Win 7 x 64 prof .
Hi Bernhard,
Looking at the action when I change from EX2 to EX4 the namespaces are reset with the ones used by default for EX4. If you set the framework to VCL the values are;
“System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;”
Currently I don’t have EX4 on my machine, however this is vary close the list you have copied out. The only ones I see as different are “Datasnap.Win and Xml.Win” are these the issue your seeing?
I just tested this here with XE2 and XE4. What happens when you switch compiler versions is the namespaces are reset back to the default values for the compiler version/framework. If you then load the settings from the project the correct values will be loaded (assuming your dproj file doesn’t have issues from being upgraded, but that’s another story).
If you need to switch compiler versions then use a variable for the prefixes and set the value in the BeforeAction script event, e.g :
[code] Action.NamspacePrefixes = FBVariables.NAMESPACEPREFIXES [/code]
can’t understand the prposed solution, can I get a bit more tutorial information on that proposed solution ?
Hi Bernhard,
All actions have scripts which can be run, details of how to attach scripts to actions are detailed in the help. In these scripts the actions properties can be updated with values from variables set by the user.
The solution Vincent has proposed suggests using these scripts to update the NamspacePrefixes property on the Delphi Build action to the values you require for each build type.
Another way to do this, if scripting isn’t your style, is to create an if test to decide which build type is going to be performed. From there have all the settings required for the XE2 build in one build action, and all the configuration options for XE4 in another build action.
The last option we would suggest is to have all the properties for the build in the Delphi project itself. Then use the option in Delphi Build action to load these from the project file. This means all the namespaces will come from the Delphi project file.