From ad7fae6e23efb37cf2e644287ab6b487adb93b13 Mon Sep 17 00:00:00 2001 From: Nikos Kastellanos Date: Thu, 22 Aug 2024 17:53:28 +0300 Subject: [PATCH] dotnet templates --- ...or dotnet new - .NET - Microsoft Learn.url | 2 + Templates/dotnetTemplates/Install.bat | 1 + Templates/dotnetTemplates/README.md | 4 ++ Templates/dotnetTemplates/Uninstall.bat | 1 + Templates/dotnetTemplates/UpdateVSCache.bat | 1 + .../.template.config/TemplateIcon.png | Bin 0 -> 441 bytes .../.template.config/ide.host.json | 4 ++ .../.template.config/template.json | 14 ++++++ .../ContentImporter1.cs | 34 ++++++++++++++ .../ContentPipelineExtension.csproj | 36 +++++++++++++++ .../ContentProcessor1.cs | 29 ++++++++++++ .../Directory.Build.props | 4 ++ .../.template.config/TemplateIcon.png | Bin 0 -> 453 bytes .../.template.config/ide.host.json | 7 +++ .../.template.config/template.json | 23 ++++++++++ .../GameComponent.CSharp/GameComponent1.cs | 29 ++++++++++++ Templates/dotnetTemplates/installPackage.bat | 1 + .../nkast.Kni.Templates.csproj | 42 ++++++++++++++++++ Templates/dotnetTemplates/pack.bat | 1 + ...nt at main \302\267 dotnet-templating.url" | 2 + .../dotnetTemplates/uninstallPackage.bat | 1 + 21 files changed, 236 insertions(+) create mode 100644 Templates/dotnetTemplates/Create a template package for dotnet new - .NET - Microsoft Learn.url create mode 100644 Templates/dotnetTemplates/Install.bat create mode 100644 Templates/dotnetTemplates/README.md create mode 100644 Templates/dotnetTemplates/Uninstall.bat create mode 100644 Templates/dotnetTemplates/UpdateVSCache.bat create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/.template.config/TemplateIcon.png create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/.template.config/ide.host.json create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/.template.config/template.json create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentImporter1.cs create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentPipelineExtension.csproj create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentProcessor1.cs create mode 100644 Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/Directory.Build.props create mode 100644 Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/TemplateIcon.png create mode 100644 Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/ide.host.json create mode 100644 Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/template.json create mode 100644 Templates/dotnetTemplates/content/GameComponent.CSharp/GameComponent1.cs create mode 100644 Templates/dotnetTemplates/installPackage.bat create mode 100644 Templates/dotnetTemplates/nkast.Kni.Templates.csproj create mode 100644 Templates/dotnetTemplates/pack.bat create mode 100644 "Templates/dotnetTemplates/templating-dotnet-template-samples-content at main \302\267 dotnet-templating.url" create mode 100644 Templates/dotnetTemplates/uninstallPackage.bat diff --git a/Templates/dotnetTemplates/Create a template package for dotnet new - .NET - Microsoft Learn.url b/Templates/dotnetTemplates/Create a template package for dotnet new - .NET - Microsoft Learn.url new file mode 100644 index 00000000000..fd3dbc9de95 --- /dev/null +++ b/Templates/dotnetTemplates/Create a template package for dotnet new - .NET - Microsoft Learn.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://learn.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-template-package?pivots=dotnet-8-0 diff --git a/Templates/dotnetTemplates/Install.bat b/Templates/dotnetTemplates/Install.bat new file mode 100644 index 00000000000..c2f04a3bbb6 --- /dev/null +++ b/Templates/dotnetTemplates/Install.bat @@ -0,0 +1 @@ +dotnet new install .\ diff --git a/Templates/dotnetTemplates/README.md b/Templates/dotnetTemplates/README.md new file mode 100644 index 00000000000..3725c22261a --- /dev/null +++ b/Templates/dotnetTemplates/README.md @@ -0,0 +1,4 @@ + + + diff --git a/Templates/dotnetTemplates/Uninstall.bat b/Templates/dotnetTemplates/Uninstall.bat new file mode 100644 index 00000000000..6393b2d125c --- /dev/null +++ b/Templates/dotnetTemplates/Uninstall.bat @@ -0,0 +1 @@ +dotnet new uninstall .\ diff --git a/Templates/dotnetTemplates/UpdateVSCache.bat b/Templates/dotnetTemplates/UpdateVSCache.bat new file mode 100644 index 00000000000..b8366a46249 --- /dev/null +++ b/Templates/dotnetTemplates/UpdateVSCache.bat @@ -0,0 +1 @@ +"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" /updateconfiguration \ No newline at end of file diff --git a/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/.template.config/TemplateIcon.png b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/.template.config/TemplateIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..b5f3544abbbb8483265a4f2e5b8cd1fab3d2d9d0 GIT binary patch literal 441 zcmV;q0Y?6bP)`TmSF0|KfT7|NsBY5W79fMF0Q+A4x<(RCwC#*V(edAPfM| zuw&~@{{L^KEG3R!1edAKkQcFpQ)H_Jd@7Z3~ROe(2$6tFR&^dQ7(41n4`1Gtz0 zz$jMl@`h88+tFhn-Bg#_61EpW-kt$?UPl1W0IwL+{S$lzK)SuXqwYb}c}2#|y>Fre zptTOeK69rLpk!+XkX8c#Eotrz11JqdCm_{L55f*Rmqq;;Af3m+@=W?mySWD-UycI~ z5V$rVAw=5!rW^v{B0Jp-%;& + /// This class will be instantiated by the XNA Framework Content Pipeline + /// to import a file from disk into the specified type, TImport. + /// + /// This should be part of a Content Pipeline Extension Library project. + /// + /// TODO: change the ContentImporter attribute to specify the correct file + /// extension, display name, and default processor for this importer. + /// + + [ContentImporter(".xyz", DisplayName = "XYZ Importer", DefaultProcessor = "ContentProcessor1")] + public class ContentImporter1 : ContentImporter + { + + public override TInput Import(string filename, ContentImporterContext context) + { + // TODO: process the input object, and return the modified data. + throw new NotImplementedException(); + } + + } + +} diff --git a/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentPipelineExtension.csproj b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentPipelineExtension.csproj new file mode 100644 index 00000000000..0c9a830c13b --- /dev/null +++ b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentPipelineExtension.csproj @@ -0,0 +1,36 @@ + + + + false + netstandard2.0 + {$guid1$} + Library + Properties + KniContentPipelineExtension + KniContentPipelineExtension + bin\$(Platform)\$(Configuration)\ + $(DefineConstants); + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentProcessor1.cs b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentProcessor1.cs new file mode 100644 index 00000000000..2978fb2eb17 --- /dev/null +++ b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/ContentProcessor1.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.Xna.Framework.Content.Pipeline; +// TODO: replace these with the processor input and output types. +using TInput = System.String; +using TOutput = System.String; + +namespace KniContentPipelineExtension +{ + /// + /// This class will be instantiated by the XNA Framework Content Pipeline + /// to apply custom processing to content data, converting an object of + /// type TInput to TOutput. The input and output types may be the same if + /// the processor wishes to alter data without changing its type. + /// + /// This should be part of a Content Pipeline Extension Library project. + /// + /// TODO: change the ContentProcessor attribute to specify the correct + /// display name for this processor. + /// + [ContentProcessor(DisplayName = "KniContentPipelineExtension.ContentProcessor1")] + public class ContentProcessor1 : ContentProcessor + { + public override TOutput Process(TInput input, ContentProcessorContext context) + { + // TODO: process the input object, and return the modified data. + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/Directory.Build.props b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/Directory.Build.props new file mode 100644 index 00000000000..4d9b5eb6808 --- /dev/null +++ b/Templates/dotnetTemplates/content/ContentPipelineExtension.NetStandard.CSharp/Directory.Build.props @@ -0,0 +1,4 @@ + + + + diff --git a/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/TemplateIcon.png b/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/TemplateIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..0b1e9edea4838dc136275fa252e615071e58b443 GIT binary patch literal 453 zcmV;$0XqJPP)`TmSF0|KfT7|NsBY5W79fMF0Q+D@jB_RCwC#*ITl}APfM| z@Wxh?{qOct9wjr@3UbvC$&c8EBSN4GI2iB`01d6A&BdOlqmM7qBs*j3C6N4}jV~1GtzD zz$kX#)Hc&26)Ao=C9x@0MhOK9W_s)&J`Im_pylv zfYv$<`^sHtMW;$2ZgXcK)F=@yq|-{{$ESe&OJ5biUW200000NkvXXu0mjfd92hr literal 0 HcmV?d00001 diff --git a/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/ide.host.json b/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/ide.host.json new file mode 100644 index 00000000000..21f59af3fc8 --- /dev/null +++ b/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/ide.host.json @@ -0,0 +1,7 @@ +{ + "$schema": " https://json.schemastore.org/ide.host", + "icon": "TemplateIcon.png", + + "defaultItemExtension": "cs", + "itemHierarchyPaths": [ "Code" ] +} \ No newline at end of file diff --git a/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/template.json b/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/template.json new file mode 100644 index 00000000000..1b8a040153f --- /dev/null +++ b/Templates/dotnetTemplates/content/GameComponent.CSharp/.template.config/template.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "KNI Engine", + "classifications": [ "Common", "Code" ], + "identity": "nkast.Kni.GameComponent.CSharp", + "name": "KNI GameComponent Item", + "shortName": "KniGameComponent", + "tags": { + "language": "C#", + "type": "item" + }, + "symbols": { + "ClassName":{ + "type": "parameter", + "description": "The name of the code file and class.", + "datatype": "text", + "replaces": "GameComponent1", + "fileRename": "GameComponent1", + "defaultValue": "GameComponent1" + } + }, + "icon": "TemplateIcon.png" +} diff --git a/Templates/dotnetTemplates/content/GameComponent.CSharp/GameComponent1.cs b/Templates/dotnetTemplates/content/GameComponent.CSharp/GameComponent1.cs new file mode 100644 index 00000000000..783248db54a --- /dev/null +++ b/Templates/dotnetTemplates/content/GameComponent.CSharp/GameComponent1.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace KniGameComponent +{ + internal class GameComponent1 : GameComponent + { + public GameComponent1(Game game) : base(game) + { + } + + /// Initializes the component. Used to load non-graphical resources. + public override void Initialize() + { + base.Initialize(); + } + + /// Update the component. + /// GameTime of the Game. + public override void Update(GameTime gameTime) + { + } + + } +} diff --git a/Templates/dotnetTemplates/installPackage.bat b/Templates/dotnetTemplates/installPackage.bat new file mode 100644 index 00000000000..c6f088f4f4f --- /dev/null +++ b/Templates/dotnetTemplates/installPackage.bat @@ -0,0 +1 @@ +dotnet new install .\bin\Release\nkast.Kni.Templates.3.13.9001.nupkg diff --git a/Templates/dotnetTemplates/nkast.Kni.Templates.csproj b/Templates/dotnetTemplates/nkast.Kni.Templates.csproj new file mode 100644 index 00000000000..3ba98eb51e7 --- /dev/null +++ b/Templates/dotnetTemplates/nkast.Kni.Templates.csproj @@ -0,0 +1,42 @@ + + + + + + nkast.Kni.Templates + 3.13.9001 + TODO: fill the package name here + KNI Engine + TODO: fill the package description here + TODO: fill the tags here + https://github.com/kniEngine/kni/ + + + Template + net8.0 + true + false + content + $(NoWarn);NU5128 + true + README.md + + + + false + + + + + + + + + + + + + + + + diff --git a/Templates/dotnetTemplates/pack.bat b/Templates/dotnetTemplates/pack.bat new file mode 100644 index 00000000000..6b5f6965db1 --- /dev/null +++ b/Templates/dotnetTemplates/pack.bat @@ -0,0 +1 @@ +dotnet pack diff --git "a/Templates/dotnetTemplates/templating-dotnet-template-samples-content at main \302\267 dotnet-templating.url" "b/Templates/dotnetTemplates/templating-dotnet-template-samples-content at main \302\267 dotnet-templating.url" new file mode 100644 index 00000000000..7875e7b6a44 --- /dev/null +++ "b/Templates/dotnetTemplates/templating-dotnet-template-samples-content at main \302\267 dotnet-templating.url" @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://github.com/dotnet/templating/tree/main/dotnet-template-samples/content diff --git a/Templates/dotnetTemplates/uninstallPackage.bat b/Templates/dotnetTemplates/uninstallPackage.bat new file mode 100644 index 00000000000..3e71acd4aa5 --- /dev/null +++ b/Templates/dotnetTemplates/uninstallPackage.bat @@ -0,0 +1 @@ +dotnet new uninstall nkast.Kni.Templates \ No newline at end of file