在源代码管理中存储第三方库 [英] Storing third-party libraries in source control

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

问题描述

应用程序依赖的库是否应该存储在源代码管理中?我的一部分说应该,另一部分说不.添加一个 20mb 的库使整个应用程序相形见绌,这感觉是错误的,因为您依赖它的几个功能(尽管相当严重).您应该只存储 jar/dll 或者甚至是项目的分布式 zip/tar 吗?

Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heavily). Should you just store the jar/dll or maybe even the distributed zip/tar of the project?

其他人在做什么?

推荐答案

除了在您的存储库中包含第三方库之外,还值得以这样一种方式进行,以便在将来对库的更新中轻松跟踪和合并容易(例如,安全修复等).如果您使用适当的 供应商分支 是值得的.

As well as having third party libraries in your repository, it's worth doing it in such a way that makes it easy to track and merge in future updates to the library easily (for example, security fixes etc.). If you are using Subversion using a proper vendor branch is worthwhile.

如果您知道在修改第三方代码之前会很冷,那么(如@Matt Sheppard 所说)外部是有意义的,并为您提供额外的好处,即它变得非常容易如果安全更新或必备的新功能使之成为可取的,请切换到库的最新版本.

If you know that it'd be a cold day in hell before you'll be modifying your third party's code then (as @Matt Sheppard said) an external makes sense and gives you the added benefit that it becomes very easy to switch up to the latest version of the library should security updates or a must-have new feature make that desirable.

此外,如果需要,您可以在更新代码库时跳过外部代码,以节省长时间缓慢的加载过程.

Also, you can skip externals when updating your code base saving on the long slow load process should you need to.

@Stu Thompson 提到在源代码管理中存储文档等.在较大的项目中,我将整个客户"文件夹存储在源代码管理中,包括发票/账单/会议记录/技术规范等.整个拍摄匹配.尽管,咳咳,请记住将这些存储在一个单独的存储库中,与您将要提供给其他开发人员的存储库分开;客户端;您的浏览器源视图"...咳... :)

@Stu Thompson mentions storing documentation etc. in source control. In bigger projects I've stored our entire "clients" folder in source control including invoices / bills/ meeting minutes / technical specifications etc. The whole shooting match. Although, ahem, do remember to store these in a SEPARATE repository from the one you'll be making available to: other developers; the client; your "browser source view"...cough... :)

这篇关于在源代码管理中存储第三方库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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