src/Templates/README.md
For easy building and testing you can use the build.ps1 script. This script is only for manual use and not part of any pipeline.
[!NOTE] On macOS you find encounter and error like:
error NU5119: Warning As Error: File '/file/path/.DS_Store' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandlinewhen this happens, run agit clean -xfdon the repository to remove all.DS_Storefiles from the filesystem.
The script:
.tempTemplateOutput folder which is used for the temporary files used by this scriptsrc\Templates\src\Microsoft.Maui.Templates.csproj projectsrc\Templates\src\Microsoft.Maui.Templates.csproj project into a .nupkg file and outputs it to the .tempTemplateOutput directory, this directly is excluded from git~\templateengine folder.tempTemplateOutput directoryThe script defines a coupe of parameters you can use. All have default values, so you only have to set them whenever you want to deviate from the default behavior.
The parameters are as follows:
projectType: Specifies the type of .NET project to create (default is maui).templateVersion: Specifies the version number to use for the template pack build (default is 13.3.7, needs to be a valid major, minor, patch version number, for example 1.2.3).templatesProjectPath: Specifies the path to the template project to build (default is src\Microsoft.Maui.Templates.csproj).startVsAfterBuild: Specifies whether to start Visual Studio (Code) after creating the new project with the latest template changes (default is true).Find sample usages of the different parameters below, of course these can be mixed and matched as needed.
.\build.ps1 -projectType maui-blazor.\build.ps1 -templateVersion 1.2.3.\build.ps1 -templatesProjectPath src\Microsoft.Maui.Templates-new.csproj.\build.ps1 -startVsAfterBuild $false