什么是适当的库命名约定?
有两种流行的命名约定:
- vc90/win64/debug/foo.dll
- foo-vc90-win64-debug.dll
请讨论与这两种方法相关的问题/优点。
我还想知道是否可以以易于使用、跨平台的方式在方法 #1 中公开元数据(即编译器、平台、构建类型)。
There are two popular naming conventions:
- vc90/win64/debug/foo.dll
- foo-vc90-win64-debug.dll
Please discuss the problems/benefits associated with either approach.
I am also wondering if it is possible to expose meta-data (i.e. compiler, platform, build-type) in approach #1 in an easy to use, cross-platform manner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 .NET 程序集,您可以将此信息存储在程序集本身中:
http://www .codinghorror.com/blog/archives/000142.html
我对其他程序集类型不太熟悉,不知道它们提供了什么。
For .NET assemblies, you can store this information in the assembly itself:
http://www.codinghorror.com/blog/archives/000142.html
I'm not familiar enough with other assembly types to know what they provide.
#2 有利于分发,其中多个变体将一起打包在同一文件夹/zip 文件中。 但是,您可能不希望文件名本身包含所有这些信息,因为这使得通过 makefile/csproj/nant 脚本等的参数来更改这些信息变得很困难。在其中包含多个名为“foo”的文件会更容易不同的文件夹(您可以在其中决定文件夹结构)
#2 is good for distribution, where several variation will be packaged in the same folder/zip file together. However, you probably don't want all that information in the file name itself, as it make it difficult to vary those via parameters to your makefile/csproj/nant script etc. It would be easier to have several files called "foo" in different folders (where you can decide the folder structure)