dotnet new chromapperplugin, the template engine accepts parameters that customize the generated project. Pass them as flags on the command line.
Basic usage
-o / --output flag sets the output directory and the project name at the same time (see below).
Parameters
The author of the plugin. The template engine replaces every occurrence of the literal string So
YourName in the generated files with the value you supply.In Plugin.cs this sets the Author constant, which is used to build the plugin’s unique identifier:--Author "alice" with -o CoolPlugin produces ID = "com.alice.CoolPlugin".The output directory for the generated project. Because the template’s
sourceName is ChroMapperPluginTemplate, the dotnet template engine also replaces every occurrence of the string ChroMapperPluginTemplate throughout all generated files with the directory name you provide here.This means the output directory name becomes:- The C# namespace (
namespace MyPlugin;) - The assembly name (
<AssemblyName>MyPlugin</AssemblyName>) - The
Nameconstant inPlugin.cs(public const string Name = "MyPlugin";) - The
.csprojfilename (MyPlugin.csproj)
-o, the template generates files in the current directory and uses the current directory name as the project name.Parameter table
| Flag | Type | Default | Description |
|---|---|---|---|
--Author | text | YourName | Replaces the YourName literal in all generated files |
-o / --output | text | Current directory | Sets the output directory; also renames the project via sourceName substitution |
Example commands
Minimal — use the default author name:Plugin.cs constants for the command above:
templateTest.ps1):
How parameter substitution works
The template engine performs two independent substitutions when it generates your project:sourceNamesubstitution — replaces the literal stringChroMapperPluginTemplateeverywhere (file names, directory names, file content) with the value of-o.symbolssubstitution — replaces the literal stringYourNameeverywhere with the value of--Author.
dotnet new.