aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Linker.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-07-23 14:21:40 -0700
committerRob Mensching <rob@firegiant.com>2018-07-23 14:27:11 -0700
commit5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2 (patch)
treed409a2399bd831f16ecdb8e68947ea672dcd65d4 /src/WixToolset.Core/Linker.cs
parent2724cfee4c163f3297ee25edfd2372767cfd4945 (diff)
downloadwix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.gz
wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.bz2
wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.zip
Integrate Extensibility.Data namespace change from Extensibility repo
Diffstat (limited to 'src/WixToolset.Core/Linker.cs')
-rw-r--r--src/WixToolset.Core/Linker.cs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs
index db2514fb..4d1a6965 100644
--- a/src/WixToolset.Core/Linker.cs
+++ b/src/WixToolset.Core/Linker.cs
@@ -12,6 +12,7 @@ namespace WixToolset.Core
12 using WixToolset.Data; 12 using WixToolset.Data;
13 using WixToolset.Data.Tuples; 13 using WixToolset.Data.Tuples;
14 using WixToolset.Extensibility; 14 using WixToolset.Extensibility;
15 using WixToolset.Extensibility.Data;
15 using WixToolset.Extensibility.Services; 16 using WixToolset.Extensibility.Services;
16 using WixToolset.Link; 17 using WixToolset.Link;
17 18
@@ -31,11 +32,14 @@ namespace WixToolset.Core
31 public Linker(IServiceProvider serviceProvider) 32 public Linker(IServiceProvider serviceProvider)
32 { 33 {
33 this.ServiceProvider = serviceProvider; 34 this.ServiceProvider = serviceProvider;
35 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
34 this.sectionIdOnRows = true; // TODO: what is the correct value for this? 36 this.sectionIdOnRows = true; // TODO: what is the correct value for this?
35 } 37 }
36 38
37 private IServiceProvider ServiceProvider { get; } 39 private IServiceProvider ServiceProvider { get; }
38 40
41 private IMessaging Messaging { get; }
42
39 private ILinkContext Context { get; set; } 43 private ILinkContext Context { get; set; }
40 44
41 /// <summary> 45 /// <summary>
@@ -71,7 +75,6 @@ namespace WixToolset.Core
71 var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>(); 75 var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>();
72 76
73 this.Context = this.ServiceProvider.GetService<ILinkContext>(); 77 this.Context = this.ServiceProvider.GetService<ILinkContext>();
74 this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>();
75 this.Context.Extensions = extensionManager.Create<ILinkerExtension>(); 78 this.Context.Extensions = extensionManager.Create<ILinkerExtension>();
76 this.Context.ExtensionData = extensionManager.Create<IExtensionData>(); 79 this.Context.ExtensionData = extensionManager.Create<IExtensionData>();
77 this.Context.ExpectedOutputType = this.OutputType; 80 this.Context.ExpectedOutputType = this.OutputType;
@@ -151,7 +154,7 @@ namespace WixToolset.Core
151 154
152 // First find the entry section and while processing all sections load all the symbols from all of the sections. 155 // First find the entry section and while processing all sections load all the symbols from all of the sections.
153 // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols); 156 // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols);
154 var find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, sections); 157 var find = new FindEntrySectionAndLoadSymbolsCommand(this.Messaging, sections);
155 find.ExpectedOutputType = this.Context.ExpectedOutputType; 158 find.ExpectedOutputType = this.Context.ExpectedOutputType;
156 find.Execute(); 159 find.Execute();
157 160
@@ -166,12 +169,12 @@ namespace WixToolset.Core
166 169
167 // Resolve the symbol references to find the set of sections we care about for linking. 170 // Resolve the symbol references to find the set of sections we care about for linking.
168 // Of course, we start with the entry section (that's how it got its name after all). 171 // Of course, we start with the entry section (that's how it got its name after all).
169 var resolve = new ResolveReferencesCommand(this.Context.Messaging, find.EntrySection, find.Symbols); 172 var resolve = new ResolveReferencesCommand(this.Messaging, find.EntrySection, find.Symbols);
170 resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type); 173 resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type);
171 174
172 resolve.Execute(); 175 resolve.Execute();
173 176
174 if (this.Context.Messaging.EncounteredError) 177 if (this.Messaging.EncounteredError)
175 { 178 {
176 return null; 179 return null;
177 } 180 }
@@ -185,7 +188,7 @@ namespace WixToolset.Core
185 188
186 this.FlattenSectionsComplexReferences(sections); 189 this.FlattenSectionsComplexReferences(sections);
187 190
188 if (this.Context.Messaging.EncounteredError) 191 if (this.Messaging.EncounteredError)
189 { 192 {
190 return null; 193 return null;
191 } 194 }
@@ -197,7 +200,7 @@ namespace WixToolset.Core
197 var modulesToFeatures = new ConnectToFeatureCollection(); 200 var modulesToFeatures = new ConnectToFeatureCollection();
198 this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures); 201 this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures);
199 202
200 if (this.Context.Messaging.EncounteredError) 203 if (this.Messaging.EncounteredError)
201 { 204 {
202 return null; 205 return null;
203 } 206 }
@@ -212,10 +215,10 @@ namespace WixToolset.Core
212 } 215 }
213 216
214 // Report duplicates that would ultimately end up being primary key collisions. 217 // Report duplicates that would ultimately end up being primary key collisions.
215 var reportDupes = new ReportConflictingSymbolsCommand(this.Context.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); 218 var reportDupes = new ReportConflictingSymbolsCommand(this.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections);
216 reportDupes.Execute(); 219 reportDupes.Execute();
217 220
218 if (this.Context.Messaging.EncounteredError) 221 if (this.Messaging.EncounteredError)
219 { 222 {
220 return null; 223 return null;
221 } 224 }
@@ -716,12 +719,12 @@ namespace WixToolset.Core
716 // Bundles have groups of data that must be flattened in a way different from other types. 719 // Bundles have groups of data that must be flattened in a way different from other types.
717 this.FlattenBundleTables(resolvedSection); 720 this.FlattenBundleTables(resolvedSection);
718 721
719 if (this.Context.Messaging.EncounteredError) 722 if (this.Messaging.EncounteredError)
720 { 723 {
721 return null; 724 return null;
722 } 725 }
723 726
724 var collate = new CollateLocalizationsCommand(this.Context.Messaging, localizations); 727 var collate = new CollateLocalizationsCommand(this.Messaging, localizations);
725 var localizationsByCulture = collate.Execute(); 728 var localizationsByCulture = collate.Execute();
726 729
727 intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null); 730 intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null);
@@ -738,7 +741,7 @@ namespace WixToolset.Core
738 } 741 }
739 } 742 }
740 743
741 return this.Context.Messaging.EncounteredError ? null : intermediate; 744 return this.Messaging.EncounteredError ? null : intermediate;
742 } 745 }
743 746
744#if SOLVE_CUSTOM_TABLE 747#if SOLVE_CUSTOM_TABLE
@@ -1118,7 +1121,7 @@ namespace WixToolset.Core
1118 /// <param name="message">Message event arguments.</param> 1121 /// <param name="message">Message event arguments.</param>
1119 public void OnMessage(Message message) 1122 public void OnMessage(Message message)
1120 { 1123 {
1121 this.Context.Messaging.Write(message); 1124 this.Messaging.Write(message);
1122 } 1125 }
1123 1126
1124 /// <summary> 1127 /// <summary>
@@ -1616,7 +1619,7 @@ namespace WixToolset.Core
1616 // will hold Payloads under UX, ChainPackages (references?) under Chain, 1619 // will hold Payloads under UX, ChainPackages (references?) under Chain,
1617 // and ChainPackages/Payloads under the attached and any detatched 1620 // and ChainPackages/Payloads under the attached and any detatched
1618 // Containers. 1621 // Containers.
1619 var groups = new WixGroupingOrdering(entrySection, this.Context.Messaging); 1622 var groups = new WixGroupingOrdering(entrySection, this.Messaging);
1620 1623
1621 // Create UX payloads and Package payloads 1624 // Create UX payloads and Package payloads
1622 groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" }); 1625 groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" });