一次更改多个解决方案文件的项目路径 [英] Change project path for several solution files at once

查看:117
本文介绍了一次更改多个解决方案文件的项目路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一组针对各种产品的解决方案文件,这些文件依赖于一些常见的依赖性:

We have a group of solution files for various products which rely on a few common dependencies:

$/ProductA
$/ProductB
$/ProductC

我们也有不同版本的依赖项,这些版本根据其版本号进行组织:

We also have different versions of our dependencies, which are organised according to their version number:

$/DependencyA/v1.0
$/DependencyA/v1.1
$/DependencyB/v1.0
$/DependencyB/v2.0

问题是我们如何轻松地将产品升级"到新的依赖版本?我们将依赖性项目文件包含在每个产品的解决方案文件中.

The question is how do we easily 'upgrade' the products to a new dependency version? We include the dependency project files in each product's solution file.

属性表可用于定义新的宏,以引用不同的依赖项版本号及其所在的目录,但这无助于更改依赖项的项目文件.当然,手动方式可行:删除旧版本的 解决方案中的项目文件,然后重新添加新版本的项目文件.但是,这很慢,而且很容易出错,因为没有简单的方法可以查看项目文件的路径.

Property sheets are good for defining new macros to refer to different dependency version numbers and the directories they are in, but this doesn't help in changing the dependencies' project files. Of course the manual way works: delete the old version's project file from the solution and re-add the project file of the new version. However, this is slow and it is easy to make mistakes since there is no easy way of seeing the path of a project file.

如果有一种方法(如属性表),我可以创建产品所需的常见依赖项列表,每个解决方案文件都将引用该列表以了解要包含的内容.

If there were a way -- something like property sheets - that I could create a list of common dependencies that the products will need and each solution file refers to that list to know what to include.

 

因此,我想知道是否有人对如何使用Visual C ++进行版本控制和依赖项解析有个好主意.

So I'd like to know if anyone has some good ideas of how to do this versioning and dependency resolution using Visual C++.

谢谢!

推荐答案

解决方案中是否必须包含从属项目?

Is there a reason the dependent projects have to be included in the solution? 

我将分别构建和发布依赖项项目,然后修改产品包括目录和库路径(通过您认为最方便的方式)以使用适当的依赖项版本来构建产品.如果需要调试 依赖项目,您可以将其临时包含在产品的解决方案中,也可以将其附加到其他解决方案中.

I would just build and release the dependency projects separately, then modify the product include dirs and library paths (via whatever means you find most convenient) to build the product with the appropriate dependency versions.  If you need to debug a dependency project, you can temporarily include it in a product's solution or attach from a different solution.


这篇关于一次更改多个解决方案文件的项目路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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