Delphi构建自动化和持续集成可以使用MS Build? [英] Delphi Build Automation and Continuous Integration feasible using MS Build only?

查看:331
本文介绍了Delphi构建自动化和持续集成可以使用MS Build?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻求一个连续的单元测试运行系统,我听说过一个叫做smoketest或tinderbox(一个构建服务器,它可以执行干净的版本控制检查和给定的全部系统构建)源代码库或项目),以及Delphi等小团队的持续集成。



我不愿意提交商业构建服务器产品希望通过MS-Build支持,我可以做很多这样的工作,这个内置在delphi中。



我正在寻找资源,想法和一个开始的地方。我不知道如何使用MS Build来实现这个目的。 史蒂夫·特列维恩(Steve Trevethen)有一篇博客文章,导致对旧的dcc32命令行的一些讨论构建和一些注释提到了自delphi 2007以来一直在这里的ms-build。我使用的是Delphi 2010.我正在寻找指导和洞察力,并且经验告诉我,这是否是合理的路径,如果不,我该怎么办?



我发现你可以用/ p:DCU_DcuOutput =从msbuild命令行重写Unit(DCU)和EXE Output Directory。请注意,我查看了我的DPROJ文件中的XML,以了解如何重写东西。



但是,它只做一个make而不是一个build,和/ t:重建不起作用(编辑:是的,它在DPROJ文件上工作正常,但不在GroupProjects上。)



我希望有更多的MSBuild-with-Delphi文档在哪里? Rad Studio 2010产品文档中的MS-Build帮助显示了一个或两个关于MS-Build的内容,但实际上是粗略的和不完整的。



相关问题:



MSBuild命令行

解决方案

Delphi 2010使用MSBuild作为主要构建引擎。这意味着IDE和命令行都完全一样。这也意味着您可以使用命令行轻松构建现有项目。事实上,我们在德尔福团队一直做这个确切的事情。您不必担心编译器本身的开关 - 由IDE创建的DProj文件将



在开始菜单中是使用MSBuild与现有Delphi的命令行项目。它正确设置环境,以便您可以简单地调用:



msbuild myproject.dproj



您还可以从命令行调用特定的构建配置,使用IDE轻松地使用MSBuild的命令行参数创建所述配置。



如果要自己创建环境,可以运行rsvars.bat批处理文件来设置。该文件可以在您的\bin目录中找到,并且应该从默认的命令行可用。



该文件包含以下内容:

  @SET BDS =<您的BDS目录> 
@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

因此,如果要创建自己的持续集成构建,可以使用MSBuild轻松管理您的Delphi构建。


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 control check-outs and full system builds of everything in a given source repository or project), and something like "continuous integration" for small teams, with Delphi.

I am loathe to commit to a commercial "build server" product and am hoping I can do a lot of this just with MS-Build support that is built into delphi.

I am looking for resources, ideas, and a place to get started. I do not know how to use MS Build for this purpose. Steve Trevethen has a blog post that leads to a little discussion on the old dcc32 command line build, and some comments mention ms-build which has been here since delphi 2007. I am using Delphi 2010. I am looking for guidance and insight, and experiences, that will tell me, is this a reasonable path to go down, and if not, what way should I go instead?

I found you can override the Unit (DCU) and EXE Output Directory from the msbuild command line with /p:DCU_DcuOutput=. Note that I looked at the XML inside my DPROJ files to figure out how to override stuff.

However, it only does a make, not a build, and /t:rebuild does not work (edit: yes it does. it works fine on DPROJ files, but not on GroupProjects.)

I wish there was more MSBuild-with-Delphi documentation out there anywhere? The MS-Build help in "Rad Studio 2010" product documentation shows one or two things about MS-Build but is really sketchy and incomplete.

Related questions:

MSBuild command lines

解决方案

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.

这篇关于Delphi构建自动化和持续集成可以使用MS Build?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆