diff options
Diffstat (limited to 'src/WixToolset.Core/Link/WixGroupingOrdering.cs')
-rw-r--r-- | src/WixToolset.Core/Link/WixGroupingOrdering.cs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/WixToolset.Core/Link/WixGroupingOrdering.cs b/src/WixToolset.Core/Link/WixGroupingOrdering.cs index 9080775e..563cd565 100644 --- a/src/WixToolset.Core/Link/WixGroupingOrdering.cs +++ b/src/WixToolset.Core/Link/WixGroupingOrdering.cs | |||
@@ -12,19 +12,19 @@ namespace WixToolset.Core.Link | |||
12 | using WixToolset.Data; | 12 | using WixToolset.Data; |
13 | using WixToolset.Data.Tuples; | 13 | using WixToolset.Data.Tuples; |
14 | using WixToolset.Extensibility.Services; | 14 | using WixToolset.Extensibility.Services; |
15 | using WixToolset.Data.Burn; | ||
15 | 16 | ||
16 | /// <summary> | 17 | /// <summary> |
17 | /// Grouping and Ordering class of the WiX toolset. | 18 | /// Grouping and Ordering class of the WiX toolset. |
18 | /// </summary> | 19 | /// </summary> |
19 | internal class WixGroupingOrdering | 20 | internal class WixGroupingOrdering |
20 | { | 21 | { |
21 | private readonly IMessaging messageHandler; | 22 | private readonly IMessaging Messaging; |
22 | private List<string> groupTypes; | 23 | private List<string> groupTypes; |
23 | private List<string> itemTypes; | 24 | private List<string> itemTypes; |
24 | private ItemCollection items; | 25 | private ItemCollection items; |
25 | private readonly List<int> rowsUsed; | 26 | private readonly List<int> rowsUsed; |
26 | private bool loaded; | 27 | private bool loaded; |
27 | private bool encounteredError; | ||
28 | 28 | ||
29 | /// <summary> | 29 | /// <summary> |
30 | /// Creates a WixGroupingOrdering object. | 30 | /// Creates a WixGroupingOrdering object. |
@@ -36,11 +36,10 @@ namespace WixToolset.Core.Link | |||
36 | public WixGroupingOrdering(IntermediateSection entrySections, IMessaging messageHandler) | 36 | public WixGroupingOrdering(IntermediateSection entrySections, IMessaging messageHandler) |
37 | { | 37 | { |
38 | this.EntrySection = entrySections; | 38 | this.EntrySection = entrySections; |
39 | this.messageHandler = messageHandler; | 39 | this.Messaging = messageHandler; |
40 | 40 | ||
41 | this.rowsUsed = new List<int>(); | 41 | this.rowsUsed = new List<int>(); |
42 | this.loaded = false; | 42 | this.loaded = false; |
43 | this.encounteredError = false; | ||
44 | } | 43 | } |
45 | 44 | ||
46 | private IntermediateSection EntrySection { get; } | 45 | private IntermediateSection EntrySection { get; } |
@@ -71,7 +70,7 @@ namespace WixToolset.Core.Link | |||
71 | Debug.Assert(this.groupTypes.Contains(parentTypeString)); | 70 | Debug.Assert(this.groupTypes.Contains(parentTypeString)); |
72 | 71 | ||
73 | this.CreateOrderedList(parentTypeString, parentId, out var orderedItems); | 72 | this.CreateOrderedList(parentTypeString, parentId, out var orderedItems); |
74 | if (this.encounteredError) | 73 | if (this.Messaging.EncounteredError) |
75 | { | 74 | { |
76 | return; | 75 | return; |
77 | } | 76 | } |
@@ -95,7 +94,7 @@ namespace WixToolset.Core.Link | |||
95 | Debug.Assert(this.groupTypes.Contains(parentTypeString)); | 94 | Debug.Assert(this.groupTypes.Contains(parentTypeString)); |
96 | 95 | ||
97 | this.LoadFlattenOrderGroups(); | 96 | this.LoadFlattenOrderGroups(); |
98 | if (this.encounteredError) | 97 | if (this.Messaging.EncounteredError) |
99 | { | 98 | { |
100 | return; | 99 | return; |
101 | } | 100 | } |
@@ -127,14 +126,14 @@ namespace WixToolset.Core.Link | |||
127 | orderedItems = null; | 126 | orderedItems = null; |
128 | 127 | ||
129 | this.LoadFlattenOrderGroups(); | 128 | this.LoadFlattenOrderGroups(); |
130 | if (this.encounteredError) | 129 | if (this.Messaging.EncounteredError) |
131 | { | 130 | { |
132 | return; | 131 | return; |
133 | } | 132 | } |
134 | 133 | ||
135 | if (!this.items.TryGetValue(parentType, parentId, out var parentItem)) | 134 | if (!this.items.TryGetValue(parentType, parentId, out var parentItem)) |
136 | { | 135 | { |
137 | this.messageHandler.Write(ErrorMessages.IdentifierNotFound(parentType, parentId)); | 136 | this.Messaging.Write(ErrorMessages.IdentifierNotFound(parentType, parentId)); |
138 | return; | 137 | return; |
139 | } | 138 | } |
140 | 139 | ||
@@ -216,7 +215,7 @@ namespace WixToolset.Core.Link | |||
216 | // dependencies. Group references, however, we can check directly. | 215 | // dependencies. Group references, however, we can check directly. |
217 | this.FindCircularGroupReferences(); | 216 | this.FindCircularGroupReferences(); |
218 | 217 | ||
219 | if (!this.encounteredError) | 218 | if (!this.Messaging.EncounteredError) |
220 | { | 219 | { |
221 | this.FlattenGroups(); | 220 | this.FlattenGroups(); |
222 | this.FlattenOrdering(); | 221 | this.FlattenOrdering(); |
@@ -304,7 +303,7 @@ namespace WixToolset.Core.Link | |||
304 | if (this.FindCircularGroupReference(item, item, itemsSeen, out circularReference)) | 303 | if (this.FindCircularGroupReference(item, item, itemsSeen, out circularReference)) |
305 | { | 304 | { |
306 | itemsInKnownLoops.Add(itemsSeen); | 305 | itemsInKnownLoops.Add(itemsSeen); |
307 | this.messageHandler.Write(ErrorMessages.ReferenceLoopDetected(item.Row.SourceLineNumbers, circularReference)); | 306 | this.Messaging.Write(ErrorMessages.ReferenceLoopDetected(item.Row.SourceLineNumbers, circularReference)); |
308 | } | 307 | } |
309 | } | 308 | } |
310 | } | 309 | } |
@@ -376,12 +375,12 @@ namespace WixToolset.Core.Link | |||
376 | 375 | ||
377 | if (!this.items.TryGetValue(rowItemType, rowItemName, out var item)) | 376 | if (!this.items.TryGetValue(rowItemType, rowItemName, out var item)) |
378 | { | 377 | { |
379 | this.messageHandler.Write(ErrorMessages.IdentifierNotFound(rowItemType, rowItemName)); | 378 | this.Messaging.Write(ErrorMessages.IdentifierNotFound(rowItemType, rowItemName)); |
380 | } | 379 | } |
381 | 380 | ||
382 | if (!this.items.TryGetValue(rowDependsOnType, rowDependsOnName, out var dependsOn)) | 381 | if (!this.items.TryGetValue(rowDependsOnType, rowDependsOnName, out var dependsOn)) |
383 | { | 382 | { |
384 | this.messageHandler.Write(ErrorMessages.IdentifierNotFound(rowDependsOnType, rowDependsOnName)); | 383 | this.Messaging.Write(ErrorMessages.IdentifierNotFound(rowDependsOnType, rowDependsOnName)); |
385 | } | 384 | } |
386 | 385 | ||
387 | if (null == item || null == dependsOn) | 386 | if (null == item || null == dependsOn) |
@@ -389,7 +388,7 @@ namespace WixToolset.Core.Link | |||
389 | continue; | 388 | continue; |
390 | } | 389 | } |
391 | 390 | ||
392 | item.AddAfter(dependsOn, this.messageHandler); | 391 | item.AddAfter(dependsOn, this.Messaging); |
393 | } | 392 | } |
394 | } | 393 | } |
395 | 394 | ||
@@ -404,12 +403,12 @@ namespace WixToolset.Core.Link | |||
404 | // ordering. | 403 | // ordering. |
405 | foreach (Item item in this.items) | 404 | foreach (Item item in this.items) |
406 | { | 405 | { |
407 | item.PropagateAfterToChildItems(this.messageHandler); | 406 | item.PropagateAfterToChildItems(this.Messaging); |
408 | } | 407 | } |
409 | 408 | ||
410 | foreach (Item item in this.items) | 409 | foreach (Item item in this.items) |
411 | { | 410 | { |
412 | item.FlattenAfters(this.messageHandler); | 411 | item.FlattenAfters(this.Messaging); |
413 | } | 412 | } |
414 | } | 413 | } |
415 | 414 | ||
@@ -668,7 +667,7 @@ namespace WixToolset.Core.Link | |||
668 | { | 667 | { |
669 | if (String.Equals(nameof(ComplexReferenceChildType.Package), this.Type, StringComparison.Ordinal) || | 668 | if (String.Equals(nameof(ComplexReferenceChildType.Package), this.Type, StringComparison.Ordinal) || |
670 | (String.Equals(nameof(ComplexReferenceParentType.Container), this.Type, StringComparison.Ordinal) && | 669 | (String.Equals(nameof(ComplexReferenceParentType.Container), this.Type, StringComparison.Ordinal) && |
671 | !String.Equals(Compiler.BurnUXContainerId.Id, this.Id, StringComparison.Ordinal))) | 670 | !String.Equals(BurnConstants.BurnUXContainerName, this.Id, StringComparison.Ordinal))) |
672 | { | 671 | { |
673 | return false; | 672 | return false; |
674 | } | 673 | } |