From c2b00d75493798d9f2452d5e5014b14afcb14889 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 5 Jan 2022 21:51:00 -0600 Subject: Always run upgrade related bundles last. #5128 --- .../ForTestingUseOnlyBurnBackendExtension.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs (limited to 'src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs') diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs new file mode 100644 index 00000000..fff23274 --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace ForTestingUseOnly +{ + using System.Collections.Generic; + using System.Linq; + using ForTestingUseOnly.Symbols; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using WixToolset.Extensibility; + + /// + /// Extension for doing completely unsupported things in the name of testing. + /// + public class ForTestingUseOnlyBurnBackendExtension : BaseBurnBackendBinderExtension + { + private static readonly IntermediateSymbolDefinition[] BurnSymbolDefinitions = + { + ForTestingUseOnlySymbolDefinitions.ForTestingUseOnlyBundle, + }; + + protected override IReadOnlyCollection SymbolDefinitions => BurnSymbolDefinitions; + + public override void SymbolsFinalized(IntermediateSection section) + { + base.SymbolsFinalized(section); + + this.FinalizeBundleSymbol(section); + } + + private void FinalizeBundleSymbol(IntermediateSection section) + { + var forTestingUseOnlyBundleSymbol = section.Symbols.OfType().SingleOrDefault(); + if (null == forTestingUseOnlyBundleSymbol) + { + return; + } + + var bundleSymbol = section.Symbols.OfType().Single(); + bundleSymbol.ProviderKey = bundleSymbol.BundleId = forTestingUseOnlyBundleSymbol.BundleId; + } + } +} -- cgit v1.2.3-55-g6feb