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

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

问题描述

我正在寻求实现一个连续的单元测试运行系统,我听说过这种系统称为smoketest"或tinderbox",(一种构建服务器,它可以对给定的所有内容进行干净的版本控制检查和完整的系统构建源存储库或项目),以及为小型团队使用 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.

我不愿意致力于商业构建服务器"产品,并希望我可以通过 delphi 中内置的 MS-Build 支持来做很多事情.

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.

我正在寻找资源、想法和开始的地方.我不知道如何为此目的使用 MS Build.Steve Trevethen 有一篇博文引发了对旧 dcc32 命令行的一些讨论构建,并且一些评论提到自 delphi 2007 以来一直存在的 ms-build.我正在使用 Delphi 2010.我正在寻找指导和见解以及经验,这将告诉我,这是一条合理的路径,如果不是,我应该走哪条路?

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?

我发现您可以使用/p:DCU_DcuOutput= 从 msbuild 命令行覆盖单元 (DCU) 和 EXE 输出目录.请注意,我查看了 DPROJ 文件中的 XML 以了解如何覆盖内容.

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.

但是,它只进行制作,而不是构建,并且/t:rebuild 不起作用(是的.它在 DPROJ 文件上工作正常,但在 GroupProjects 上却不行.)

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.)

我希望任何地方都有更多 MSBuild-with-Delphi 文档?Rad Studio 2010"产品文档中的 MS-Build 帮助显示了有关 MS-Build 的一两件事,但实际上很粗略且不完整.

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.

相关问题:

MSBuild 命令行

推荐答案

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

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

开始菜单上有一个命令行,用于将 MSBuild 与现有的 Delphi 项目一起使用.它正确设置了环境,因此您可以简单地调用:

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

msbuild myproject.dproj

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

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.

如果您想自己创建环境,可以运行 rsvars.bat 批处理文件进行设置.该文件可以在您的 in 目录中找到,并且应该可以从默认命令行获得.

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 in directory, and should be available from a default command line.

该文件包含以下内容:

@SET BDS=<your BDS directory>
@SET BDSCOMMONDIR=C:UsersPublicDocumentsRAD Studio7.0
@SET FrameworkDir=C:WindowsMicrosoft.NETFrameworkv2.0.50727
@SET FrameworkVersion=v2.0.50727
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
@SET LANGDIR=EN

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

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天全站免登陆