在生成后事件更新本地的NuGet包 [英] Updating local nuget package on post-build event

查看:112
本文介绍了在生成后事件更新本地的NuGet包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分别都有我的本地的NuGet库库对我个人和工作releted类库。

I have my local nuget library repository separately both for my personal and work releted class libraries.

我已经创造了一些的NuGet包对于那些不再开发库。我这样做,只有适合自己的,因为我不知道怎么就会自动更新它们作为我的生成项目。

I have created some of the nuget packages for the libraries which are no longer in development. I did this only for them because I do not know how to update them automatically as soon as my project builds.

我想通了所有的工作正在通过与Visual Studio命令提示符的NuGet命令行完成。所以,我可以很容易做到我所需要的工作(当然我会知道的命令完美,我不要!)

I have figured that all the work is being done by nuget command line with Visual Studio Command Prompt. So I can easily do the work I needed (of course I would know commands perfectly and I do not !)

基本上我想下面的任务在我的项目的生成后事件中执行。

Basically I want the following tasks to execute on the post-build event of my project.

在项目构建:


  1. 复制项目的dll到一个特定的文件夹(包的NuGet的lib文件夹中)

  2. 更新新文件版本nuspec文件(我的项目增加了人们对每次构建的文件版本)

  3. 创建新的文件版本新nupkg文件

菲尔哈克显示了这个功能,但它仍然是一个原型,据我可以告诉。

Phil Haack shows some of this feature but it is still a prototype as far as I can tell.

所以,我的要求是上面。有没有其他人做到了这一点?

So my requirement is the above. Has anyone else accomplished this?

推荐答案

杰里米·斯金纳写<一​​个href=\"http://www.jeremyskinner.co.uk/2011/01/12/automating-nuget-package-creation-with-msbuild-and-powershell/\">a关于他如何执行自动的博客帖子建立包并上传到的NuGet画廊。我认为你的要求相匹配。

Jeremy Skinner has written a blog post on how he performs automated builds of packages and uploads them to the NuGet Gallery. I think that it matches your requirements.

基本上,他使用的MSBuild应用的版本(与的MSBuild社区扩展如updateXML任务)的nuspec文件并调用的NuGet。 exe文件打包起来。

Basically he uses MsBuild to apply the version (with the MsBuild Community Extensions UpdateXml task) to the nuspec file and invoke the nuget.exe to package it up.

这篇关于在生成后事件更新本地的NuGet包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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