如何为我的DSL扩展创建Nuget包 [英] How to Create a Nuget Package for my DSL extension

查看:65
本文介绍了如何为我的DSL扩展创建Nuget包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将我的DSL部署为VSIX扩展了几年,并希望将Nuget更改为分发机制。 我意识到这不是NuGet打包问题的地方,但我需要了解我的Nuget包中包含的内容为
,确保这将在目标开发人员实例上运行,所以我希望有人已经这样做了可以为我提供一些线索。

I have been deploying my DSL as VSIX extensions for a few years and want to change to Nuget as a distribution mechanism.  I realize that this not a place for NuGet packaging questions, but I need to understand what to include in my Nuget package to ensure that this will run on a target developer instance, so I am hoping someone has done this already and can provide me with some clues.

我已经安装了NuGet Package Manager,这使得创建和发布Nuget包非常容易。 我能够创建一个简单的Nuget包部署,但现在我需要部署我的DSL扩展。

I have installed NuGet Package Manager which makes creating and publishing a Nuget package very easy.  I am able to create a deploy a simple Nuget package but now I need to deploy my DSL extension.

我的问题是我在包内容中部署了什么?

My question is what do I deploy in my package contents?

在我目前的VSIX中,我有许多程序集,例如 

In my current VSIX I have a number of assemblies such as 


  • MyProduct.DsL.dll,
  • MyProduct.DslPackge.dll
  • Microsoft.Practices.ServiceLocation.dll(不确定是否需要)
  • Microsoft.VisualStudio.TextTemplating.Interfaces.12.0.dll(不是确定是否需要)

我还有一些我自己的自定义程序集,它们是MyProduct.Dsl.dll和MyProduct.DslPackage的依赖项.dll。  

As well I have a few of my own custom assemblies that are dependencies of the MyProduct.Dsl.dll and MyProduct.DslPackage.dll.  

我的VSIX中还有一个文件夹,其中包含T4Templates,它们在运行时用于代码生成目标项目中的一些类。

I also have a folder within my VSIX that contains T4Templates which are used at runtime to code generate some classes within the target project.

然后 ItemTemplates\CSharp \ 1033 \ MyProduct.zip中的文件以及
ItemTemplat es\VisualBasic \ 1033 \ MyProduct.zip

And then there files in the ItemTemplates\CSharp\1033\MyProduct.zip as well as ItemTemplates\VisualBasic\1033\MyProduct.zip

我还有一个名为  Additional.pkg.def 的文件 具有以下内容...

I also have a file named Additional.pkg.def file with the following content...

[$ RootKey $ \TextTemplating\IncludeFolders]

[$ RootKey $ \TextTemplating\IncludeFolders\.tt]

" IncludeMyDsl" =" $ PackageFolder $ \CustomCode \ T4Templates"

MyProduct.DslPackage.pkgdef中有大量配置,我不确定大多数这意味着什么,我怀疑VSIX安装程序使用它来安装我的扩展程序。 

There is a ton of configuration within MyProduct.DslPackage.pkgdef and I am not certain what most of this means, I suspect it is used by the VSIX installer to install my extension. 

那么有没有人知道我如何设置Nuget包以及成功部署的所有必要元素?

So does anyone have a clue as to how I go about laying out the Nuget package with all the necessary elements for a successful deployment?

干杯

约翰

Johnny Larue,http://www.softlandingcanada.com

Johnny Larue, http://www.softlandingcanada.com

推荐答案

I还没有尝试使用Nuget部署DSL。但是,您需要以这种或那种方式部署VSIX中包含的所有内容,因此检查VSIX的内容是一个很好的起点。

I haven't tried deploying a DSL using Nuget. However, you'll need to deploy everything that is contained in the VSIX one way or another, so examining the contents of the VSIX is a good place to start.

FYI pkgdef文件包含使设计器与VS一起正常工作所必需的注册表项它告诉VS您的包存在以及在哪里找到它,为您的新模型文件创建文件关联,注册您的编辑器,
工具窗口,菜单命令等等。你需要确保这些信息也以某种方式进入注册表。

FYI the pkgdef file contains the registry entries that are necessary to make your designer work correctly with VS e.g. it tells VS that your package exists and where to find it, creates the file association for your new model file, registers your editor, tool window, menu commands etc. You will need to make sure this information gets into the registry somehow too.

问候,

Duncan


这篇关于如何为我的DSL扩展创建Nuget包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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