Delphi Build Automation and Continuous Integration feasible using MS Build only?

前端 未结 3 1417
眼角桃花
眼角桃花 2020-12-23 10:37

I am looking to implement a continuous unit test running system, something I have heard called a \"smoketest\" or \"tinderbox\", (a build server that does clean version cont

相关标签:
3条回答
  • 2020-12-23 11:04

    Delphi 2010 uses MSBuild as it's main build engine. That means that the IDE and the command line both do exactly the same thing. It also means that you can easily build existing projects with the command line. In fact, we on the Delphi team do this exact thing all the time. You need not worry about switches for the compiler itself -- the DProj file created by the IDE will

    On the Start Menu is a command line for using MSBuild with an existing Delphi project. It sets up the environment correctly so that you can simply call:

    msbuild myproject.dproj

    You can also call specific build configurations from the command line, using the IDE to easily create said configurations using command line parameters for MSBuild.

    If you want to create the environment yourself, you can run the rsvars.bat batch file to set things up. That file can be found in your \bin directory, and should be available from a default command line.

    The file contains the following:

    @SET BDS=<your BDS directory>
    @SET BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\7.0
    @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v2.0.50727
    @SET FrameworkVersion=v2.0.50727
    @SET FrameworkSDKDir=
    @SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
    @SET LANGDIR=EN
    

    Thus, if you want to create your own continuous integration build, you can easily manage your Delphi build using MSBuild.

    0 讨论(0)
  • 2020-12-23 11:06

    I'm not sure if this is what you need, but I have CruiseControl.NET setup for doing continuous integration - and DUnit tests - for Delphi 2009. CCNET has a specific set of tasks for MSBuild, and other than a few setup issues, it works perfectly for me.

    I can let you know what I had to do get ths working if you need.

    Mark

    0 讨论(0)
  • 2020-12-23 11:17

    The dproj and groupproj are msbuild files and you can have a look inside them. The other parts of the information are to be find in the msbuild installation path (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727). There you will find several Borland.*.targets files.

    Inside the msbuild scripts you can see the different targets named with . For example the groupfile contains Make, Clean and Build targets which you can specify with the /t parameter. The same goes for the dproj files. dproj files also have a ReBuild target. It does a Clean and then a Build. If you want to have the same effect for groupfile you could specify two targets: /t:Clean;Build

    You will also find lots of parameters in you can set with /p. Like for example Configuration to specify the configuration or DCC_Quiet to instruct dcc32 to stop outputting useless whitespaces.

    So the doing a build with Release configuration from the command line is this command:

    msbuild mygroup.groupproj /p:Configuration=Release /t:Build
    

    disclaimer: I have looked at Delphi 2007's msbuild files. Later Delphi versions might have changed the name of the targets or parameters. Just have a look inside the msbuild scripts to find out which is which.

    0 讨论(0)
提交回复
热议问题