针对具有不同构建参数的多个项目运行构建 [英] Running a build against multiple projects with different build arguments

查看:66
本文介绍了针对具有不同构建参数的多个项目运行构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一系列项目需要编译和发布,并部署到具有单独MSBuild参数的单独目录中.就目前而言,我每个人都有单独的版本.例如,项目1:

I have a series of projects that need to be compiled and published, deployed to separate directories with separate MSBuild arguments. As it stands, I have separate builds for each. For example, project 1:

MSBuild Arguments: /target:myTarget /property:PublishDir=\\1.1.1.1\PublishDir1

和项目2:

MSBuild Arguments: /target:myTarget /property:PublishDir=\\1.1.1.2\PublishDir2

但是我想将它们合并到一个单独的版本中.我的问题是,尽管TFS将允许我在构建中指定多个项目,但MSBuild参数适用于所有项目.是否有一种快速方法可以强制每个项目使用一组不同的构建参数,还是需要创建一个新的构建模板来做到这一点?

However I'd like to merge them into a single build. The problem I have is that although TFS will allow me to specify multiple projects in the build, the MSBuild arguments apply to all projects. Is there a quick way I can force a distinct set of build arguments per project, or do I need to create a new build template to do this?

推荐答案

恐怕您需要新的构建模板才能将其他参数传递给模板.

I am afraid, you need new build template to pass additional arguments to the template.

但是,如果您尝试将构建输出发布到基于不同项目的不同目录中,则可以通过为每个项目设置相同的发布配置文件来实现.为每个具有相同名称的项目添加发布配置文件.您可以使用文件系统发布方法将输出发布到每个项目的不同目录.只需在MsBuild参数中调用发布配置文件即可.

But if you are trying to Publish the build output to different directory based on different Project, you can achieve it by setting up same publish profile for each project. Add publish profile for each Project with same name. you can use File system Publish Method to Publish the output to different directories for each project. Just call the Publish profile in the MsBuild Argument.

/p:DeployOnBuild=true;PublishProfile=Dev

这篇关于针对具有不同构建参数的多个项目运行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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