diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
| commit | 2bb37beda887d120a0ddabf874ad25357101faa1 (patch) | |
| tree | c35e97b03274b86cfc9ff7fd2caeee211165a140 /src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs | |
| parent | df7413aeed3aea3425dff20ae0c8b1be3a3ab525 (diff) | |
| download | wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.gz wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.bz2 wix-2bb37beda887d120a0ddabf874ad25357101faa1.zip | |
Update to WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs')
| -rw-r--r-- | src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs index 39c3a5c2..ac0dd7ec 100644 --- a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs | |||
| @@ -6,17 +6,18 @@ namespace WixToolset.Link | |||
| 6 | using System.Linq; | 6 | using System.Linq; |
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | 8 | ||
| 9 | public class ReportConflictingSymbolsCommand : ICommand | 9 | public class ReportConflictingSymbolsCommand |
| 10 | { | 10 | { |
| 11 | private IEnumerable<Symbol> possibleConflicts; | 11 | public ReportConflictingSymbolsCommand(IEnumerable<Symbol> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) |
| 12 | private IEnumerable<Section> resolvedSections; | ||
| 13 | |||
| 14 | public ReportConflictingSymbolsCommand(IEnumerable<Symbol> possibleConflicts, IEnumerable<Section> resolvedSections) | ||
| 15 | { | 12 | { |
| 16 | this.possibleConflicts = possibleConflicts; | 13 | this.PossibleConflicts = possibleConflicts; |
| 17 | this.resolvedSections = resolvedSections; | 14 | this.ResolvedSections = resolvedSections; |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 17 | private IEnumerable<Symbol> PossibleConflicts { get; } | ||
| 18 | |||
| 19 | private IEnumerable<IntermediateSection> ResolvedSections { get; } | ||
| 20 | |||
| 20 | public void Execute() | 21 | public void Execute() |
| 21 | { | 22 | { |
| 22 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow | 23 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow |
| @@ -25,10 +26,11 @@ namespace WixToolset.Link | |||
| 25 | // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate | 26 | // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate |
| 26 | // (aka: conflicting) symbol. This should catch any rows with colliding primary keys (since symbols are based | 27 | // (aka: conflicting) symbol. This should catch any rows with colliding primary keys (since symbols are based |
| 27 | // on the primary keys of rows). | 28 | // on the primary keys of rows). |
| 28 | List<Symbol> illegalDuplicates = possibleConflicts.Where(s => "WixAction" != s.Row.Table.Name && "WixVariable" != s.Row.Table.Name).ToList(); | 29 | var illegalDuplicates = this.PossibleConflicts.Where(s => s.Row.Definition.Type != TupleDefinitionType.WixAction && s.Row.Definition.Type != TupleDefinitionType.WixVariable).ToList(); |
| 29 | if (0 < illegalDuplicates.Count) | 30 | if (0 < illegalDuplicates.Count) |
| 30 | { | 31 | { |
| 31 | HashSet<Section> referencedSections = new HashSet<Section>(resolvedSections); | 32 | var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections); |
| 33 | |||
| 32 | foreach (Symbol referencedDuplicateSymbol in illegalDuplicates.Where(s => referencedSections.Contains(s.Section))) | 34 | foreach (Symbol referencedDuplicateSymbol in illegalDuplicates.Where(s => referencedSections.Contains(s.Section))) |
| 33 | { | 35 | { |
| 34 | List<Symbol> actuallyReferencedDuplicateSymbols = referencedDuplicateSymbol.PossiblyConflictingSymbols.Where(s => referencedSections.Contains(s.Section)).ToList(); | 36 | List<Symbol> actuallyReferencedDuplicateSymbols = referencedDuplicateSymbol.PossiblyConflictingSymbols.Where(s => referencedSections.Contains(s.Section)).ToList(); |
