From 41622a07f82c57cf3d80393b0b6914f5ccb76e33 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 1 Jan 2019 00:26:30 -0800 Subject: Load .wixlib intermediates with single creator Using a single creator ensures definitions are shared and consistent across the entire build. --- .../ExtensibilityServices/TupleDefinitionCreator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs') diff --git a/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs b/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs index b442da2b..e223e3a4 100644 --- a/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs +++ b/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs @@ -1,4 +1,4 @@ -// 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. +// 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 WixToolset.Core.ExtensibilityServices { @@ -23,7 +23,10 @@ namespace WixToolset.Core.ExtensibilityServices public void AddCustomTupleDefinition(IntermediateTupleDefinition definition) { - this.CustomDefinitionByName.Add(definition.Name, definition); + if (!this.CustomDefinitionByName.TryGetValue(definition.Name, out var existing) || definition.Revision > existing.Revision) + { + this.CustomDefinitionByName[definition.Name] = definition; + } } public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) -- cgit v1.2.3-55-g6feb