库版本与应用程序版本
如果您有一个项目,它发布了一个库和一个应用程序,您如何处理两者之间的版本号。
示例:您的项目提供了一个库,可以将不同的文件格式相互转换。 该库已发布以包含在其他应用程序中。 但是您还发布了一个命令行应用程序,它使用该库并实现了功能的接口。
库的新版本会导致应用程序的新版本(以利用所有新功能),但应用程序的新版本可能不会触发库的新版本。 现在如何处理版本号:完全独立还是库和应用程序版本应该以某种方式依赖?
If you have a project, that releases a library and an application, how you handle version-numbers between the two.
Example: Your project delivers a library, that convert different file-formats into each other. The library is released for inclusion into other applications. But you also release a command-line-application, that uses this library and implements an interface to the functionality.
New releases of the library lead to new releases of the application (to make use of all new features), but new releases of the application may not trigger new releases of the library. Now how are the versions numbers handled: Completely independent or should library- and application-version be dependent in some way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
完全独立的版本号,但命令行(或任何其他依赖)应用程序应该在帮助部分或横幅中说明它是针对哪个版本的库进行编译的。
这样,您将能够知道应用程序将具有哪些功能并减少潜在的混乱,特别是考虑到有人可以出于任何原因针对旧库编译新的应用程序版本。 此外,您还可以将它们解耦,并可以在库中添加功能,而无需依赖于新应用程序版本的发布等。
如果您确定始终希望所有应用程序和库步调一致,那么您可以使用相同的数字,但这会增加一个约束,但理由并不充分。
Completely independent version numbers, but the command line (or any other dependent) app should say which version of the library it was compiled against in the help section or a banner.
That way you will be able to tell which functionality will the apps have and reduce potential confusion, especially given that somebody could compile a newer app version against an old library for any reason. Also, you decouple them and can add features on the library without depending on release of a new app version and so on.
If you are sure you will always want all the apps and library to go in lockstep then you could use same numbers, but that's adding a constraint for not a strong reason.
我想说使用单独的版本号,当然还要记录应用程序的每个版本所需的最低库版本。 如果它们始终具有相同的版本号,并且您仅针对相同编号的库版本测试应用程序,那么它们并不是真正独立的组件,因此不要说它们是。 将整批产品作为一团释放。
如果您将它们分开,您仍然可以在适当的时候为它们提供相同的版本号 - 例如,在重大兼容性中断之后,您可能会同时发布两者的 2.0 版。
以下示例说明: xsltproc(命令行应用程序)作为 libxslt(库)的一部分发布,因此没有自己的版本号。 但 libxslt 依赖于另外两个库,并且它们的版本号是独立的。
I'd say use separate version numbers, and of course document what minimum library version is required for each release of the app. If they always have the same version number, and you only ever test the app against the equal-numbered library version, then they aren't really separate components, so don't say they are. Release the whole lot as one lump.
If you make them separate, you can still give them the same version number when it's appropriate - for example after a major compatibility break you might release Version 2.0 of both simultaneously.
The following example illustrates: xsltproc (a command-line app) is released as part of libxslt (a library), so doesn't have its own version number. But libxslt depends on two other libraries, and the version numbers of those are independent.
我们构建了一个使用框架的应用程序。 我们为两者保留单独的版本号。
这很有效,特别是现在框架和应用程序已经足够大,可以由不同的团队开发。
所以我的意见...将版本号分开。
We built an application that uses a framework. We keep separate version numbers for both.
This works well, especially that now the framework and application have grown large enough to be developed by different teams.
So my opinion... keep the version numbers separate.