3

My question is if the following scenario is possible.

  1. I have a system (maybe a Docker image) where MSBuild is installed.
  2. I have a repository which contains my sourcecode (Delphi) and the delphi compiler (directory bin and lib).
  3. Now I checkout my repository on that system and want to use msbuild to build my application and msbuild should use the compiler from my repository.

The idea behind this is, to have all data in one place which is needed to build my application (sourcecode, resources, compiler, build scripts ...). And I wanted to use MSBuild because there I can build the .dproj file than the .dpr file (with dcc) which contains less information (e.g.: search path).

sepp2k
  • 363,768
  • 54
  • 674
  • 675
Rynardald
  • 329
  • 2
  • 10

1 Answers1

7

In the BIN folder there is a file called RSVARS.bat that sets up the required environment variables. When you clone your repository containing the BIN/LIB folders to your build machine, you should take into account the required paths and either create a new rsvars.bat or update this file as required.

You can then just run something like this to build your project:

msbuild projectname.dproj /t:build /p:Configuration=Release /p:platform=Win32

I've recently gone into some detail on this covering Jenkins and Delphi builds in a blog post. You can skim the Jenkins parts and just refer to the command line build info, mainly the "Configure A Delphi Build Agent" and "Notes on Using MSBuild on Delphi Projects" sections: https://www.ideasawakened.com/post/getting-started-with-ci-cd-using-delphi-and-jenkins-on-windows

Darian Miller
  • 7,808
  • 3
  • 43
  • 62
  • Thanks, it worked well. Only one note I have. After a clean installation of the .Net Framework it must be checked that the **Borland.*.Target** files are available in the directory of the .Net Framework (e.g. 'C:\Windows\Microsoft.NET\Framework\v2.0.50727') – Rynardald Feb 04 '21 at 11:58
  • On my build machine, the .target files are not in that directory and everything works as expected. What version of Delphi are you using? – Darian Miller Feb 04 '21 at 21:52
  • I am using Delphi 2007. – Rynardald Apr 29 '21 at 13:51