问题描述
Delphi 2009使用构建配置。当您创建一个新项目时,您有两个默认构建配置Debug和Release。
Delphi 2009 uses build configurations. When you create a new project you have two default build configurations "Debug" and "Release".
现在我问自己如何使用MSBuild自动化构建Delphi自2007年以来)。
Now I asked myself how to automate builds using MSBuild (which is supported by Delphi since version 2007).
您可以在一些Delphi项目目录中的RAD Studio命令提示符中启动msbuild命令,它将构建默认构建配置(Delphi IDE中最后激活的构建配置)。
You can start the "msbuild" command in the "RAD Studio Command Prompt" in some Delphi project directory and it will build the default build configuration (the last activated build configuration inside the Delphi IDE).
现在,我要指定一个(非默认)构建配置一个命令行参数。
Now, I want to specify a certain (non-default) build configuration by a command line parameter.
Delphi帮助声明参数是[/ p:configuration = <配置名称
>>,这是错误(Delphi 2009,帮助更新1)!
The Delphi help asserts that the parameter is [/p:configuration=<configuration name
>], which is wrong (Delphi 2009, Help Update 1)!
什么是正确的方式?
推荐答案
现在,如果要更改构建配置,您必须添加参数
/ p:config = < BUILD_CONFIG_NAME
>
Now, if you want to change the build configuration you have to add the parameter
/p:config=<BUILD_CONFIG_NAME
>
例如:
C:\Projects\TestDelphiApp001>msbuild /target:Build /p:config=Release
或
C:\Projects\TestDelphiApp001>msbuild /target:Build /p:config=Debug
这篇关于Delphi MSBuild从命令行构建配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!