如何强制Visual Studio生成顺序首先生成最大的项目(不使用依赖项,以最大化生成并行性) [英] How to force Visual Studio build order to build the biggest projects first (without using dependencies, to maximize build parallelism)

查看:68
本文介绍了如何强制Visual Studio生成顺序首先生成最大的项目(不使用依赖项,以最大化生成并行性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Visual Studio(2008)解决方案,其中包含大量项目,并且为了获得体面的构建时间,我们使用并行构建(当然,已经在每个项目之间设置了所需的依赖关系,以确保正确性). br/>
但是,我注意到有一个需要花费很长时间才能构建的项目,尽管没有其他项目依赖于此,但我想强制(或鼓励)VS首先构建该项目(或至少在附近 开始),以最大限度地提高构建的并行度.该项目没有依赖项,也不依赖于任何其他项目,但是目前它位于构建顺序列表的最底部,这意味着该项目将最大程度地受益于 实际上,直到其他所有事情都完成之后,与其他人并发执行才真正开始,这确实会浪费总的构建时间.

我真的很想找到一种方法来鼓励VS更快地构建项目,但是我认为我不能通过添加人为的依赖项来做到这一点,因为这会破坏构建的并行性(即,其他项目要等到这之后才能开始)一大堆已经完成, 这与我想发生的事情相反. 

有什么办法吗?我尝试手动编辑.sln以便将我的大项目放到各个列表中的较早位置,但这似乎没有任何效果.

配置的项目依赖项仅会约束构建顺序的某些方面-有人知道Visual Studio使用什么算法来决定其余部分吗,即它如何确定性地对可以按任何顺序有效构建的项目进行排序?


We have a visual studio (2008) solution containing a large number of projects, and to get decent build times we use parallel builds (and of course have already set the required dependencies between each project to ensure correctness). 

However I've noticed there's one project that takes a very long time to build, and although there are no other projects that depend on it, I'd like to force (or encourage) VS to build this project first (or at least, near the beginning) in order to maximize the parallelism of the build. This project has no dependencies and does not depend on any other project, but at the moment it's at the very bottom of the build order list, which means the project that would most benefit from executing concurrently with others is actually not beginning until everything else has finished, which really hurts the total build time. 

I'd really like to find a way to encourage VS to build the project sooner, but I don't think I can do this by adding artificial dependencies because that would kill the build's parallelism (i.e. the other projects wouldn't start until this huge one had completed, which is the opposite of what I want to happen). 

Is there any way to do this? I tried manually editing the .sln to put my big project earlier in the various lists but it didn't seem to have any effect. 

The configured project dependencies only constrain some aspects of the build order - does anyone know what algorithm Visual Studio uses to decide the rest of it, i.e. how it deterministically orders the projects that could validly build in any order? 


推荐答案

您可以使用构建脚本并通过msbuild执行它.这里是有关此的更多信息:

http://msdn.microsoft.com/en-us/library/z7f65y0d.aspx


这篇关于如何强制Visual Studio生成顺序首先生成最大的项目(不使用依赖项,以最大化生成并行性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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