使用MSBuild自动化Delphi 2010项目构建 [英] Automate Delphi 2010 project build with MSBuild

查看:241
本文介绍了使用MSBuild自动化Delphi 2010项目构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用MSBuild编译我的Delphi 2010项目,但是有些不对劲,我只是无法使MSBuild来编译我的项目.

I'm looking to compile my Delphi 2010 project using MSBuild, but something isn't right, I just couldn't make MSBuild to compile my project.

我尝试了以下命令行:

"C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ msbuild.exe""C:\ MyProject \ Myapp.dproj"/t:发布

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\MyProject\Myapp.dproj" /t:Release

和这个:

"C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ msbuild.exe""C:\ MyProject \ Myapp.dproj"/p:Configuration =发布/t:发布

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\MyProject\Myapp.dproj" /p:Configuration=Release /t:Release

但是MSBuild无法识别我的构建配置!

But MSBuild won't recognize my build configuration!

我也更改了[ rsvars.bat ],但是没有用!

I also changed [ rsvars.bat ] but it didn't work!

@SET BDS=C:\Program Files (x86)\Embarcadero\RAD Studio\7.0
@SET BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\7.0
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
@SET FrameworkVersion=v4.0.30319
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
@SET LANGDIR=EN

MSBuild错误为:

The MSBuild error is:

C:\MyProject\Myapp.dproj : error MSB4057: The target "Release" does
not exist in the project.

任何帮助我使用MSBuild构建我的应用程序的人,将不胜感激.

Any help to get me build my app with MSBuild would be greatly appreciated.

(是的,我完全了解FinalBuilder之类的工具,我只想学习如何使用MSBuild做到这一点)

(Yes, I'm fully aware of tools like FinalBuilder, I just want to learn how to do this with MSBuild)

谢谢!

推荐答案

您需要切换参数.目标参数(/t)告诉MSBuild创建哪个目标. 可以是"Make","Clean"或"Build"(或这些的组合-在这种情况下,请用;"分隔).

You need to switch the parameters. The target parameter (/t) tells MSBuild which target to create. This can be either 'Make', 'Clean' or 'Build' (or a combination of those - seperate them with ';' in this case).

属性参数(/p)将属性转发到实际的编译器.例如,您可以使用/p:config=

The property parameter (/p) forwards properties to the actual compiler. You can specify for example the configuration using /p:config=

因此,如果要清理然后使用发行版配置构建项目,请指定如下参数:

So if you want to clean and then build a project using the release configuration, specify the paramters like this:

msbuild.exe "/t:Clean;Build" "/p:config=Release" Myapp.dproj

这篇关于使用MSBuild自动化Delphi 2010项目构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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