Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate build server from Delphi XE to Delphi XE2

How can I migrate my build server from Delphi XE to Delphi XE2?

like image 766
jpfollenius Avatar asked Nov 16 '12 09:11

jpfollenius


1 Answers

The first important thing to note, is that the parameter DelphiWin32LibraryPath changed its name to DelphiLibraryPath in Delphi XE2. So you have to change your buildscripts from something like

msbuild /p:DelphiWin32LibraryPath="..." ...

to

msbuild /p:DelphiLibraryPath="..." ...

Second, when migrating projects from XE, Delphi XE2 adds some resource references to the project file that won't compile on the build server (as pointed out by this answer by Uwe Raabe). To fix this, open the dproj file in a text editor and remove the lines that reference an ico file called something like "ProjectName_Icon4.ICO".

The third nasty thing are the namespaces introduced in XE2. This will cause the build server to stop compiling with error messages such as

File "Windows.dcu" not found

This file is now called "Winapi.Windows". In order to avoid having to change all the uses clauses in your project you can tell the compiler to automatically add some namespaces implicitly:

msbuild /p:Namespace="System;System.Win;Winapi;Vcl;Vcl.Imaging;Data;Xml" ...

You might have to add some more namespaces that you use in your project.

like image 157
jpfollenius Avatar answered Oct 15 '22 02:10

jpfollenius