创建自定义项目类型 [英] Creating custom project types

查看:84
本文介绍了创建自定义项目类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图弄清楚如何在自定义项目中最好地支持自定义编译器。我想添加对着色器编译项目的支持(GLSL到SPIR-V编译)。我想制作一个其他人可以使用的可移植解决方案。


现在,我有一个自定义构建任务来编译这些着色器。事情正在发挥作用,但我手动编辑项目文件以增加支持;类似于:

< Project DefaultTargets =" Build" ToolsVersion = QUOT; 15.0"的xmlns = QUOT; HTTP://schemas.microsoft.com/developer/msbuild/2003"> 
< UsingTask
TaskName =" SpirvCompiler.GlslHandler"
AssemblyFile =" C:\Projects \Scratch \ SpirvCompiler \ SpirvCompiler \bin \Debug \ SpirvCompiler.dll"
/>

< ItemDefinitionGroup>
< GlslItem>
< / GlslItem>
< / ItemDefinitionGroup>

< ItemGroup>
< GlslItem Include =" Test.frag" />
< GlslItem Include =" Test.vert" />
< / ItemGroup>

< Target Name =" Build">
< GlslHandler Source =" @(GlslItem)" />
< / Target>

< / Project>

显然,我不希望其他人手动编辑他们的项目文件以使其正常工作。这里推荐的路径是什么?我想做一些事情。


  1. 将其打包以便其他人可以使用它。是VSIX的方式吗?此时是否优先选择nuget?
  2. 在添加项目时自动根据文件类型分配构建操作(例如,"MyShader.frag"会自动成为项目文件中的GlslItem)。
  3. SpirvCompiler.dll的参考任务。如果我在包中包含这个DLL,有没有办法从项目文件中引用它?

我很感激帮助。关于推荐的方法,我有点迷失。

解决方案

你好dornif,


所以你想控制dll文件的访问权限 ,我是对的吗?


至于我知道,我们可以使用Nuget Package,例如,您可以将其上传到Nuget服务器或其他人,然后设置身份验证,因此如果可能的成员访问并从nuget服务器下载您的包,他们必须提供
访问 权限。


当然,创建扩展工具也是一个路径,例如,您可以将其上传到市场特定权限或其他。


https://marketplace.visualstudio.com/


如果我误解了这个问题,请随时告诉我。


最好的问候,


杰克


I'm trying to figure out how best to support a custom compiler inside a custom project. I'd like to add support for a shader compilation project (GLSL to SPIR-V compilation). I'd like to make a portable solution that others can use.

Right now, I have a custom build task to compile these shaders. Things are working, but I have manually edit project files to add support; something like:

<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<UsingTask
		TaskName="SpirvCompiler.GlslHandler"   
        AssemblyFile="C:\Projects\Scratch\SpirvCompiler\SpirvCompiler\bin\Debug\SpirvCompiler.dll"
    />

    <ItemDefinitionGroup>
    	<GlslItem>
    	</GlslItem>
    </ItemDefinitionGroup>
    
    <ItemGroup>
    	<GlslItem Include="Test.frag"/>
    	<GlslItem Include="Test.vert"/>
    </ItemGroup>
  
    <Target Name="Build">  
        <GlslHandler Source="@(GlslItem)"/>  
    </Target> 

</Project>

Obviously I don't want other people to manually edit their project files to get this working. What's the recommended path forward here? I'd like to do a few things.

  1. Package this up so others can use it. Is a VSIX the way to go? Is nuget preferred at this point?
  2. Automatically assign build actions based on file types when items are added (e.g. "MyShader.frag" becomes a GlslItem in the project file automatically).
  3. Reference tasks from SpirvCompiler.dll. If I include this DLL in the package, is there a way to refer to it from a project file?

I appreciate the help. I'm a bit lost as to what the recommended way to do this is.

解决方案

Hi dornif,

So you want to control the dll files' access permission, am I right?

As far as I know, we could use the Nuget Package, for example, you could upload it to the Nuget server or others, and then set the Authentication, so if possible members visit and download your packages from the nuget server, they have to provide the access permissions.

Of course, create an extension tool would be also a path, for example, you could upload it to the marketplace with specific permissions or others.

https://marketplace.visualstudio.com/

If I have misunderstood this issue, feel free to let me know.

Best Regards,

Jack


这篇关于创建自定义项目类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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