如何使用MSBuild和Delphi XE2构建 [英] How to build using MSBuild and Delphi XE2

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

问题描述

我已经使用Delphi XE和MSBuild构建项目,使用以下简单的例子,它在批处理文件中工作正常。 Project1是使用File创建的一个空项目新| VCL在IDE中形成应用程序:

I've been building projects using Delphi XE and MSBuild using the following simple example which works fine in a batch file. Project1 is an empty project created using 'File | New | VCL forms application in the IDE:

call "c:\Program Files (x86)\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
msbuild.exe /target:Build /p:config=Release  "c:\scratch\test\project1.dproj" 
pause

如果我在Delphi XE2中创建了一个新的空项目,将其另存为project1.dproj(dproj是非常不同的从XE)并运行以下:

If I created a new empty project in Delphi XE2, save it as project1.dproj (the dproj is VERY different from XE) and run the following:

call "c:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\rsvars.bat"
msbuild.exe /target:Build /p:config=Release  "c:\scratch\test\project1.dproj" 
pause

它给出:

Build FAILED.

"c:\scratch\test\project7.dproj" (Build target) (1) ->
  c:\scratch\test\project7.dproj : error MSB4057: The target "Build" does not e
xist in the project.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.00

我尝试过各种目标名称,包括我在Codegear.Delphi.Targets中找到的东西,但我不知道MSBuild。任何人都可以帮助我应该把它放在哪里?

I've tried various target names including things I find in Codegear.Delphi.Targets but I dont know wnough about MSBuild. Can anyone help with what I should put please?

LATER RESOLUTION:这是在另一台使用XE2的电脑上尝试过的,它的工作原理如下面的David所示。实际上问题是没有正确指定BDS路径的RSVARS.BAT文件的内容。

LATER RESOLUTION: This was tried on another PC with XE2 and it works ok as suggested by David below. In fact the problem was the content of the RSVARS.BAT file which did not specify the BDS path correctly.

推荐答案

OP,该问题是RSVARS.bat文件中不正确的BDS路径。

As reported by the OP, the issue was an incorrect BDS path in the RSVARS.bat file.

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

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