保持 .Resx 和 Designer.cs 文件顺序一致的最佳工具/方法
我和大约 20 名其他开发人员在一家开发商店工作。当 50% 的更改仅涉及两次更新中相同代码的顺序更改时,必须合并对 Designer.cs 文件或 .Resx 文件的更改确实是一件苦差事。
其他开发团队如何保持这些文件的顺序,以便当两个人进行更改时,更改可以轻松合并到文件中,而不必协调刚刚在文件中移动的属性?
有一个 CodeProject 项目在比较数据之前对数据进行排序...这将使合并更改变得更容易。但这是我希望更好地实现自动化的额外步骤。
有没有人想出一种方法将排序/差异/合并到当前结构过程合并到自动化解决方案中?
我没有使用过 TFS,所以也许他们已经解决了这个问题。但我只是想看看是否有人有什么技巧?
I work in a development shop with about 20 other developers. It's really a chore to have to merge changes to a Designer.cs file or a .Resx file, when 50% of the changes just involved a change in ordering of the same code in two updates.
What do other development teams do to keep these files in order, such that when two people make changes, the changes can easily merge into the file without having to also reconcile properties that just got moved around in them?
There is CodeProject project out there that does a sort on the data before comparing them... and that would make it easier to merge the changes. But that's an additional step I'd like to automate better.
Has anyone come up with a way to incorporate the sort/diff/merge-into-current-structure process into an automated solution?
I haven't used TFS, so maybe they have figured this out. But I just thought I'd see if anyone has any tricks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您提到的 codeproject 应用程序可以作为预构建步骤执行,因此您无需手动执行任何操作,只需一次性设置即可。
如果将 resx 文件拆分为较小的文件(即避免使用大量全局字符串表),则可以最大程度地减少争用。只要程序员尝试在短时间内保留他们的锁,您就可以使用独占锁来保证一次只有一个用户可以对任何文件进行编辑,并且可以消除整个合并问题 - 通常这可以在不需要太多的情况下实现只要您的工作实践有效,就不会有任何不便。将文件的更改限制为一组有限的特定用户会有所帮助(并且也可以提高用户界面的一致性)
最后一个选择是投资更好的合并工具,以最大程度地减少合并的难度。
无论您选择哪种方法,总是需要做出一些妥协。
The codeproject app you mention can be executed as a prebuild step so you don't have to do anything manually, just a once-off setup.
If you split resx files up into smaller files (i.e avoid using a massive global string table), then you can minimise contention. As long as programmers try to keep their locks for short periods you can then use exclusive locks to guarantee only one user can make edits to any file at a time, and the whole merge issue can be eliminated - often this can be achieved without too much inconvenience as long as your working practices are efficient. Limiting changes to a file to a limited set of specific users can help (and can also improve the consistency of ui too)
The last option is to invest in a better merge tool, to minimise the difficulty of merging.
Whichever approach you choose, there is always a bit of compromise needed.
我的团队使用一组数据库表和几个网页来维护值,并允许完成翻译。
然后,我们有一个导出应用程序,它使用
ResXResourceWriter
类生成 resx 文件,并通过调用 resgen.exe 工具生成 Designer.cs 文件。我们都将导出应用程序的本地副本指向一个公共数据库,并且我们让自动构建服务器在控制台模式下运行应用程序,以便任何构建始终拥有最新的资源。
如果您查看我最近的一些问题,您会发现我最近刚刚解决了该过程中的一些问题。
希望这能给您一些想法。花时间来解决这个问题绝对值得。特别是从您的情况来看,花几天时间编写一些支持工具是值得的。
My team uses a set of database tables and a couple of web pages to maintain the values, and to allow translations to be done.
We then have an export application, which generates the resx files using the
ResXResourceWriter
class and also generates the designer.cs files by calling the resgen.exe tool.We all point our local copies of the export application to a common database, and we have our automated build server run the application in console mode to any builds always have the latest resources.
If you look at some of my recent questions, you'll see I've just recently resolved a few issues with that process.
Hopefully, that'll give you a few ideas. It's definitely worth spending the time to get this right. Especially from the sounds of your situation, a few days writing some support tools would be time well spent.