Vixen
02b45cc4
csharp
public static class ScaffoldRunner

Writes a new project.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Why this exists next to dotnet new rather than instead of it. [Doc 17](../../docs/plan/17-app-heads-and-shipping.md) specifies a template pack — dotnet new vixen-game and its siblings — and that is the right thing for somebody who has installed one. This is the version that works before anything is installed, which is the state a person is in when they are deciding whether to try the engine at all.

The two now produce the same output because they read the same files. Tools/Vixen.Templates holds one tree; the pack ships it and this assembly embeds it, and TemplateCatalog is the fifty lines that apply the one substitution the templates use. Until that existed the scaffold was C# string literals beside a template pack that did not exist yet, which is two copies of every file waiting to disagree.

What it scaffolds against is the SDK, not a pile of package references. A game project says <Project Sdk="Vixen.Sdk/x.y.z"> and gets the import-before-compile and content-build-after-build wiring with nothing else written down — Tools/Vixen.Sdk's whole point. The alternative, a template listing every PackageReference the engine currently needs, is a template that is wrong one release later.

Nothing is overwritten. A scaffolder that clobbers is one nobody runs twice, and "I pointed it at the wrong directory" is the ordinary mistake rather than the exotic one.

Fields and properties (1)

  • public static string SdkVersion

    The version a new project pins, for the SDK and for every package it references.

Methods (1)

  • public static ExitCode Run(string template, string name, string directory, TextWriter output)

    Writes the project.

Used by (3)

  • TemplateTestsVixen.Templates.Tests
  • VixenCommandVixen.Cli
  • VixenCommandTestsVixen.Cli.Tests