NuGet 和分布式版本控制 (DVCS)

发布于 2024-09-27 22:48:04 字数 648 浏览 1 评论 0原文

我想知道是否可以使用 nuget 仅存储对版本控制中所需包的引用(仅 package.config 并忽略 packages 文件夹)。

有没有办法告诉 nuget (重新)下载各个 package.config 文件中所有引用的包?或者类似的东西可以放入构建脚本中。

更新:

似乎我不是唯一请求此功能的人:查看此工作项(感谢 PHeiberg 的提示)

更新 2:

NuGet 现在内置了此功能。请参阅使用 NuGet 而不将包提交到源代码管理了解详情。剩下的就是将软件包目录添加到 .gitignore 或 VCS 的某个等效文件中(如果您将它放在存储库的根目录中并且正在使用 git,则 /packages/ 就可以了)。

I wonder if it is possible to use nuget to only store references to the required packages in version control (only the package.config and ignore the packages folder).

Is there a way to tell nuget to (re)download all the referenced packages in the various package.config files? Or something similar which could be put into a build script.

Update:

Seems that I'm not the only one who requested this feature: See this work item (thanks to PHeiberg for the hint)

Update 2:

NuGet now has this feature builtin. See Using NuGet without committing packages to source control for details. All left is to add the packages directory to .gitignore or some equivalent of your VCS (/packages/ will do the trick if you have it in the root of your repository and are using git).

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

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

发布评论

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

评论(3

最近可好 2024-10-04 22:48:04

我不知道你的第一个问题。

至于让 CI 服务器自动更新软件包,理论上是可行的。您可以链接“List-Package -Installed”和“Update-Package”命令,并将每个包更新到最新版本。有关更多详细信息,请参阅命令参考

斯科特·格思里 在主题上这样说

“您可以集成命令行
选择 CI 解决方案并执行
update-package 命令明确为
构建/CI 流程的一部分
下更新。坦白说我不确定
这对于我们的场景来说是有意义的
不过,我们正在谈论的是
通常你需要一些开发人员来决定
在更新核心运行时之前
对新版本的依赖。努帕克的
默认模型将有一个开发人员
使用 NuPack 安装库 - 并且
NuPack 会自动签入
包和依赖源
控制。这样另一个开发者(或者
CI 服务器)不需要使用 NuPack
再次 - 他们可以同步他们的
来源和构建。但正如我提到的
早些时候 - 如果你想明确地
作为 CI 的一部分进行更新
你可以处理。”

在您发表评论后,我看到您想要实现的目标。我发现这个长线程。解决方案显然不会成为 v1 的一部分。您选择的 CI 中的自定义构建任务和配置您的存储库是我看到的唯一解决方案,请报告您的发现。

I don't know about your first question.

As for having a CI server automatically update the packages, it's doable in theory. You could chain the "List-Package -Installed" and the "Update-Package" commands and have each package updated to the latest version. See the command reference for further details.

Scott Guthrie says this on the topic:

"You can integrate the command-line
option with a CI solution and do an
update-package command explicitly as
part of your build/CI process to pull
down updates. Frankly I'm not sure
that makes sense for the scenarios we
are talking about, though, as
typically you want some dev to decide
before updating a core runtime
dependency to a new version. NuPack's
default model would have a developer
use NuPack to install a library - and
NuPack would automatically check in
the package and dependencies to source
control. That way another dev (or the
CI server) wouldn't need to use NuPack
again - they could just sync their
source and build. But as I mentioned
earlier - if you wanted to explicitly
do an update as part of your CI
process you could."

Edit:

After your comment I see what you're trying to achieve. I found this long thread in the NuPack discussions list about the issue. A solution will apparently not be part of v1. A custom build task in the CI of your choice and a config in your repo for it is the only solution I see. Please report back with your findings. You got me interested.

逐鹿 2024-10-04 22:48:04

当前有关于此问题的讨论 Phil Haack 的博客,他在其中寻求有关如何解决此问题的反馈问题。

There is a current discussion about this question at Phil Haack's blog, where he is asking for feedback on how to tackle this question.

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