Vixen
02b45cc4
csharp
public static class TargetOverrides

Applies a settings block's per-target overrides for one build target.

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

Remarks

maxSize: 2048 compression: Bc7 overrides: - target: Android compression: Astc6x6 maxSize: 1024 - target: Android/Vulkan maxSize: 2048 Resolved for Android/Vulkan: compression: Astc6x6 from the first, maxSize: 2048 from the second, everything else from the base.

A node-level merge, not a partial record. Doc 08 sketched TargetOverride<TSettings> — a sparse copy of the settings type with every member nullable — which needs a generic type per settings type, and the reflection generator describes closed types only. It is also more machinery than the problem needs: "the keys that are present win" is exactly a mapping merge, so the base and the overrides are merged as nodes and the result is bound once. Sparseness falls out of a key being absent rather than out of a member being null, which also means an override cannot accidentally set something to null by omitting it.

Most general first. Android is applied before Android/Vulkan, so the more specific target wins where they disagree — and an override for a target that is not a prefix of the one being built is not applied at all.

Fields and properties (2)

  • public const string OverridesKey

    The key holding the overrides.

  • public const string TargetKey

    The key inside an override naming what it applies to.

Methods (1)

  • public static YamlMapping Resolve(YamlMapping settings, string target)

    Produces the settings as they apply to one target.

Used by (3)

  • MetaTestsVixen.Core.Yaml.Tests
  • ImportPipelineVixen.Editor.Assets
  • ImportSettingsDocumentVixen.Editor.AssetEditors