构建工具与包管理器

发布于 2025-01-19 15:48:41 字数 128 浏览 2 评论 0原文

这两个术语构建工具和软件包管理器,我非常困惑。根据我当前的知识,包装管理人员是使用构建工具在构建工具时将代码执行所需的依赖关系用于将代码和依赖项包装到单个文件中IE构建代码时所需的依赖项。构建我们的应用程序将使IT生产准备好。 我是对吗???

I am very much confused between these two terms Build tools and Package Manager. According to my current knowledge, Package managers are the ones use to install dependencies required for the code to execute while Build tools are used to Package the code plus dependencies into single file i.e. building the code. Building our application will enable to make it production ready.
Am I right???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮年 2025-01-26 15:48:41

简短回答

  • 构建系统/工具管理您的编译要求。
  • 包管理器/工具管理器您的库需求。
  • 构建工具可能具有集成的包管理。

例如,在 C++ 和 Java 中,您可以直接调用编译器并手动提供所有包含、源代码和库路径,或者您可以使用构建系统(对于 C++,maven/gradle/ant...对于java)。

当您将外部库链接到构建系统时,它将尽力在其搜索路径中找到它们,并将链接到满足其要求的第一个版本或告诉您它找不到它。手动添加库相当容易,但有时您添加的每个库都需要另一个库。

包管理器将确保您的库已下载,版本正确,并且它们依赖的所有库均已下载。一些例子是 maven 和 gradle,它们集成了 java 的包管理,而 conan 是与 cmake 结合使用的相当流行的选项。

因此,理想情况下您会同时使用两者,但设置它们可能比不手动执行操作要花费更多的工作。如果您需要某个东西的多个版本,这取决于您的编程语言以及您的操作系统。

Short answer

  • Build systems/tools manage your compilation requirements.
  • Package managers/tools manager your library requirements.
  • A build tool may have integrated package management.

For example, in both C++ and Java you can directly call the compiler and provide all the include, source and library paths manually or you can use a build system (make/cmake... for c++, maven/gradle/ant... for java).

When you link external libraries with your build system it will do its best to find them in its search path, and will link with the first version that meets its requirements or tell you that it couldn't find it. Adding libraries manually is fairly easy, but sometimes each library you add will require another library with it.

A package manager would make sure that your libraries are downloaded, are the right version, and all the libraries they depend on are downloaded. some examples are maven and gradle which have integrated package managment for java, and conan is a fairly popular option to combine with cmake.

So ideally you would use both, but it can be more work setting them up than you save not doing things manually. It depends on your programming language, if you need multiple versions of something, and your OS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文