Vixen
02b45cc4
csharp
public static class PlayerBuild

Turning a project into an application: dotnet publish, and what to tell it.

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

Remarks

The point is that it is one command, not that it is a new build system. Doc 17 asks for content build + dotnet publish + platform packaging behind a single verb, so that the ordering — and the fact that content is stale unless something rebuilt it — is not a thing every developer has to know. Underneath it is the ordinary .NET publish, deliberately: a project that cannot be built by dotnet alone is a project this tool has captured.

⚠ Here rather than in Tools/Vixen.Cli, which is where it was, and for ProjectWorkspace's reason. Doc 20's B7 asks for a Build Settings window "over Tools/Vixen.Cli's existing calls", and the only way for a window to be over those calls rather than beside them is for the calls to live somewhere both heads can reach. Two orchestrations over one dotnet publish drift, and the way this particular drift shows up is the editor's Build and Run producing a different artefact from vixen build for the same project — which reads as a machine problem for as long as it takes somebody to compare two output directories by hand.

The variant is a property, not a configuration. Doc 17's variants are orthogonal to Debug/Release — a Development build is optimised and keeps its profiler, and a Server build differs from a Release one only in having no window. So the variant travels as VixenVariant and the compiler configuration is chosen from it, which keeps -c Release meaning what it means everywhere else.

What this does not do is sign anything. Doc 17's packaging table ends in notarised DMGs, provisioned IPAs and AABs with per-ABI splits. Those are Nuke's job and they need credentials; what is here stops at the artefact dotnet publish produces, and says so rather than implying a shippable result.

Fields and properties (3)

  • public static IReadOnlyList<string> Targets

    The targets doc 20's Build menu offers, in menu order.

  • public static IReadOnlyList<string> Variants

    Doc 17's build variants, less the Editor one, in the order that table lists them.

  • public const int NoExecutable

    What LaunchAsync answers when there was nothing to launch.

Methods (6)

  • public static bool TryDescribe(string target, out TargetShape shape)

    What each target is published as.

  • public static string? WhyNotPublishable(string target)

    Why a target cannot be published, or when it can.

  • public static bool TryFindProjectFile(string root, out string projectFile)

    The one project file in the project root.

  • public static Task<bool> PublishAsync(string projectFile, TargetShape shape, string variant, string output, TextWriter log, bool capture = false, CancellationToken cancellationToken = default(CancellationToken))

    Publishes the project. The content build is the caller's, and runs first.

  • public static Task<int> LaunchAsync(string directory, string assemblyName, IReadOnlyList<string> passthrough, TextWriter log, bool capture = false, CancellationToken cancellationToken = default(CancellationToken))

    Launches what was published.

  • public static string ConfigurationFor(string variant)

    Which compiler configuration a variant is built as.

Used by (7)

  • BuildIdsVixen.Editor.App
  • BuildSettingsViewVixen.Editor.App
  • ContentTasksVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • PlayerBuildTestsVixen.Editor.Assets.Tests
  • VixenCommandVixen.Cli
  • VixenCommandTestsVixen.Cli.Tests