如何同步SVN修订版本和EXE / DLL文件的版本资源? [英] How to synchronize SVN revision and version ressources of EXE/DLL files?

查看:163
本文介绍了如何同步SVN修订版本和EXE / DLL文件的版本资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有一个C ++项目,它建立一个exe或dll文件。将项目签入SVN存储库。我想自动同步来自SVN的版本与嵌入在我的exe / dll文件中的版本资源,即版本应该是像 $ major。$ minor。$ svn_revision

有关如何实现这一点的任何想法?有没有可用的解决方案?

Say I have some C++ project which builds an exe or dll file. The project is checked into a SVN repository. I want to automatically synchronize the revision from SVN with the version resource embedded in my exe/dll file, i.e. the version should be something like $major.$minor.$svn_revision.
Any ideas on how to achieve this? Are there any out-of-the-box solutions available?

推荐答案

如果您安装了TortoiseSVN,

If you have TortoiseSVN installed, then there is a program installed with it, SubWCRev.

如果在您的文件中有此值:

If, in your file, you have this value:

$WCREV$

然后,如果您执行类似这样的操作,它将替换为最高承诺的修订版本号:

Then it'll be replaced with the highest committed revision number if you execute something like this:

SubWCRev .\ yourfile.txt.template yourfile.txt

这将从中复制yourfile.txt.template ,执行替换,并写入 yourfile.txt

This will copy from yourfile.txt.template, do the substitutions, and write to yourfile.txt.

请注意,很多其他宏也可以使用,如果你执行 SubWCRev 没有任何参数,它会列出他们在控制台上。

Note that there's a lot of other macros you can use as well, if you execute SubWCRev without any arguments, it'll list them all on the console.

这篇关于如何同步SVN修订版本和EXE / DLL文件的版本资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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