4

We have Delphi 2010 setup as described here and jobs are running fine.

Now we need to add Delphi XE5 to that node as well. Problem are variables BDS and BDSCOMMONDIR.

They are set as global variables pointing to e.g. BDS points to C:\Program Files (x86)\Embarcadero\RAD Studio\7.0.

For XE5, BDS should be have the value of C:\Program Files (x86)\Embarcadero\RAD Studio\12.0.

So how to setup multiple delphi versions?

James Hunt
  • 2,448
  • 11
  • 23
rakekniven
  • 43
  • 4
  • I guess you need project specific environment variables: http://jenkins-ci.361315.n4.nabble.com/Project-specific-environment-variables-td1458949.html – David Heffernan Jul 23 '14 at 08:05

1 Answers1

5

I am using batch scripts for each build job.

Each script is able to set different environment variables. Basically I set the content of Delphi's rsvars.bat in my specific build scripts (Delphi paths, path to MSBuild depending on Delphi version etc.).

So the build script for a distinct build job contains the call to MSBuild (thus I have not set up MSBuild through Jenkins).

Could look something like this for you:

set BDS=C:\PathToDelphiLib
set FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
set FrameworkVersion=v3.5
set PATH=%FrameworkDir%;%BDS%\bin;%PATH%
set LANGDIR=EN
// set other variables

echo @@@ building the project
MSBuild.exe %WORKSPACE%\YourApp\YourApp.dproj "/p:Win32LibraryPath=$(BDS)\lib" /target:Build /p:config=%AConfigVariable% /p:Platform=Win32 /p:DCC_ExeOutput=%OutputDirVariable% /verbosity:quiet

In Jenkins then I can set up the Build using Windows Batch

call %WORKSPACE%\YourApp\ContinuousIntegration\DelphiXE2_Build_Release.bat

An advantage is that you can cascade batch scripts and keep all that logic away from Jenkins. I have also put my build scripts under version control. Everything is inside the repository and under control.

Erik Virtel
  • 810
  • 2
  • 9
  • 27
  • I set variables per job and configured different MSBuild environments on master and it works. I am having jenkins config file under version control. Batch files are node specific so I don't want to have them in my project, maybe in another repo. – rakekniven Jul 23 '14 at 14:23