.res文件是否需要在源代码管理中? [英] Does the .res file need to be in source control?

查看:125
本文介绍了.res文件是否需要在源代码管理中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++ Builder XE5中.

In C++Builder XE5.

我的理解 二进制文件MyProject.res(由编译器在与.cbproj文件相同的目录中创建的)包含程序图标的编译版本和项目版本详细信息(尽管我的似乎也包含XML清单).

My understanding is that the binary file MyProject.res (which is created by the compiler in the same directory as the .cbproj file) contains compiled versions of the program icon and the project version details (although mine also seems to contain an XML manifest).

但是此信息也包含在.cbproj文件和.ico files中;如果我删除.res文件,那么似乎是在下次打开项目时完全重新创建了.

But this info is also contained in the .cbproj file and the .ico files; and if I delete the .res file then it seems to get recreated exactly was it was next time I open the project.

那么将*.res标记为不在源代码管理中是否安全? (我使用git).和/或是否有可能在与目标文件相同的目录中生成它,因此它不与源文件混在一起?

So is it safe to mark *.res as not being in source control? (I use git). And/Or is it possible to have it generated in the same directory as the object files instead, so it's not mixed in with the source?

(这在C ++ Builder 5中肯定是不安全的-如果删除了.res文件,则它抱怨找不到该文件,并且丢失了图标).

(This certainly wasn't safe in C++Builder 5 - if you deleted the .res file then it complained it couldn't find it, and you lost your icons).

更新:这是否也适用于.tlb文件?这似乎是基于.ridl文件进行编译的,如果我删除它,则会自动重新生成.

Update: Does this also apply to the .tlb file? This seems to be compiled based on the .ridl file, and if I delete it then it is automatically regenerated.

推荐答案

C ++ Builder 6.0和更高版本将在删除后重新创建RES文件.我将它们视为其他临时/生成文件(如OBJ文件),并且不将它们放在版本控制软件中.我确实有每晚备份,但其中包括所有这些文件,我认为这仍然是一种很好的做法.

C++ Builder 6.0 and later will recreate RES files if deleted. I treat them as other temporary/build files (like OBJ files) and do not put them in version control software. I do have nightly backups that include all of these files though, which I think is still good practice.

我不确定TLB文件.我会暂时删除(又名),然后查看它是否重新创建为相同状态.如果是这样,应与RES文件相同.

I am not sure about TLB files. I would temporarily delete (aka-rename) one and see if it gets recreated to the same state. If so, should be same as RES files.

但是,如果您拥有的全部是已编译的资源,则这对于第三方库而言并不适用.在那种情况下,由于我不会修改它们,所以我仍然没有放在版本控制中.我只有备份.

This does not hold true for 3rd party libraries though, if all you have is compiled resources. In that case, I still do not place in my version control though, since I am not going to be modifying them. I just have my backups.

这篇关于.res文件是否需要在源代码管理中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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