@joebigelow / wix-1 / commits / 21c430b0

Rename FullyResolved to SymbolsFinalized and TryAddSymbolXxx to TryProcessSymbol

Plus fix up more documentation

Rob Mensching committed Feb 23, 2021 at 07:45 UTC 21c430b0d2a46bae326655209fefde13ae17b051
4 files changed +61 -79
src/WixToolset.Extensibility/BaseBurnBackendExtension.cs
+22 -41
@@ -2,6 +2,7 @@
2
3 namespace WixToolset.Extensibility
4 {
5 + using System;
6 using System.Collections.Generic;
7 using System.Linq;
8 using WixToolset.Data;
@@ -35,24 +36,8 @@ namespace WixToolset.Extensibility
36 protected virtual IEnumerable<IntermediateSymbolDefinition> SymbolDefinitions => Enumerable.Empty<IntermediateSymbolDefinition>();
37
38 /// <summary>
38 - /// Called after all output changes occur and right before the output is bound into its final format.
39 + /// See <see cref="IBurnBackendExtension.PreBackendBind(IBindContext)"/>
40 /// </summary>
40 - public virtual void BundleFinalize()
41 - {
42 - }
43 -
44 - /// <summary>
45 - /// Called after output is bound into its final format.
46 - /// </summary>
47 - /// <param name="result"></param>
48 - public virtual void PostBackendBind(IBindResult result)
49 - {
50 - }
51 -
52 - /// <summary>
53 - /// Called before binding occurs.
54 - /// </summary>
55 - /// <param name="context"></param>
41 public virtual void PreBackendBind(IBindContext context)
42 {
43 this.Context = context;
@@ -61,44 +46,32 @@ namespace WixToolset.Extensibility
46 }
47
48 /// <summary>
64 - ///
49 + /// See <see cref="IBurnBackendExtension.ResolveRelatedFile(String, String, String, SourceLineNumber)"/>
50 /// </summary>
66 - /// <param name="source"></param>
67 - /// <param name="relatedSource"></param>
68 - /// <param name="type"></param>
69 - /// <param name="sourceLineNumbers"></param>
70 - /// <param name="bindStage"></param>
71 - /// <returns></returns>
72 - public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage)
51 + public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers)
52 {
53 return null;
54 }
55
56 /// <summary>
78 - ///
57 + /// See <see cref="IBurnBackendExtension.SymbolsFinalized(IntermediateSection)"/>
58 + /// </summary>
59 + public virtual void SymbolsFinalized(IntermediateSection section)
60 + {
61 + }
62 +
63 + /// <summary>
64 + /// See <see cref="IBurnBackendExtension.ResolveUrl(String, String, String, String, String)"/>
65 /// </summary>
80 - /// <param name="url"></param>
81 - /// <param name="fallbackUrl"></param>
82 - /// <param name="packageId"></param>
83 - /// <param name="payloadId"></param>
84 - /// <param name="fileName"></param>
85 - /// <returns></returns>
66 public virtual string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName)
67 {
68 return null;
69 }
70
71 /// <summary>
92 - /// Called for each extension symbol that hasn't been handled yet.
93 - /// Use IBurnBackendHelper to add data to the appropriate data manifest.
72 + /// See <see cref="IBurnBackendExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol)"/>
73 /// </summary>
95 - /// <param name="section">The linked section.</param>
96 - /// <param name="symbol">The current symbol.</param>
97 - /// <returns>
98 - /// True if the extension handled the symbol, false otherwise.
99 - /// The Burn backend will warn on all unhandled symbols.
100 - /// </returns>
101 - public virtual bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol)
74 + public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol)
75 {
76 if (this.SymbolDefinitions.Any(t => t == symbol.Definition) &&
77 symbol.Definition.HasTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag))
@@ -109,5 +82,13 @@ namespace WixToolset.Extensibility
82
83 return false;
84 }
85 +
86 + /// <summary>
87 + /// See <see cref="IBurnBackendExtension.PostBackendBind(IBindResult)"/>
88 + /// </summary>
89 + /// <param name="result"></param>
90 + public virtual void PostBackendBind(IBindResult result)
91 + {
92 + }
93 }
94 }
src/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs
+5 -5
@@ -53,9 +53,9 @@ namespace WixToolset.Extensibility
53 }
54
55 /// <summary>
56 - /// See <see cref="IWindowsInstallerBackendBinderExtension.FullyResolved(IntermediateSection)"/>
56 + /// See <see cref="IWindowsInstallerBackendBinderExtension.SymbolsFinalized(IntermediateSection)"/>
57 /// </summary>
58 - public virtual void FullyResolved(IntermediateSection section)
58 + public virtual void SymbolsFinalized(IntermediateSection section)
59 {
60 }
61
@@ -70,13 +70,13 @@ namespace WixToolset.Extensibility
70 public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) => null;
71
72 /// <summary>
73 - /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/>
73 + /// See <see cref="IWindowsInstallerBackendBinderExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol, WindowsInstallerData, TableDefinitionCollection)"/>
74 /// </summary>
75 - public virtual bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions)
75 + public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions)
76 {
77 if (this.TableDefinitions.Any(t => t.SymbolDefinition == symbol.Definition))
78 {
79 - return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, output, tableDefinitions);
79 + return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, data, tableDefinitions);
80 }
81
82 return false;
src/WixToolset.Extensibility/IBurnBackendExtension.cs
+23 -22
@@ -16,30 +16,36 @@ namespace WixToolset.Extensibility
16 void PreBackendBind(IBindContext context);
17
18 /// <summary>
19 - ///
19 + /// Called to find a file related to another source in the authoring. For example, most often used
20 + /// to find cabinets and uncompressed files for an MSI package.
21 /// </summary>
21 - /// <param name="source"></param>
22 - /// <param name="relatedSource"></param>
23 - /// <param name="type"></param>
24 - /// <param name="sourceLineNumbers"></param>
25 - /// <param name="bindStage"></param>
26 - /// <returns></returns>
27 - IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage);
22 + /// <param name="source">Path to the source package.</param>
23 + /// <param name="relatedSource">Expected path to the related file.</param>
24 + /// <param name="type">Type of related file, such as "File" or "Cabinet"</param>
25 + /// <param name="sourceLineNumbers">Source line number of source package.</param>
26 + /// <returns><c>IResolveFileResult</c> if the related file was found, or null for default handling.</returns>
27 + IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers);
28
29 /// <summary>
30 - ///
30 + /// Called right before the output is bound into its final format.
31 /// </summary>
32 - /// <param name="url"></param>
33 - /// <param name="fallbackUrl"></param>
34 - /// <param name="packageId"></param>
35 - /// <param name="payloadId"></param>
36 - /// <param name="fileName"></param>
37 - /// <returns></returns>
32 + /// <param name="section">The finalized intermediate section.</param>
33 + void SymbolsFinalized(IntermediateSection section);
34 +
35 + /// <summary>
36 + /// Called to customize the DownloadUrl provided in source cde.
37 + /// </summary>
38 + /// <param name="url">The value from the source code. May not actually be a URL.</param>
39 + /// <param name="fallbackUrl">The default URL if the extension does not return a value.</param>
40 + /// <param name="packageId">Identifier of the package.</param>
41 + /// <param name="payloadId">Identifier of the payload.</param>
42 + /// <param name="fileName">Filename of the payload.</param>
43 + /// <returns>Url to override, or null to use default value.</returns>
44 string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName);
45
46 /// <summary>
47 /// Called for each extension symbol that hasn't been handled yet.
42 - /// Use IBurnBackendHelper to add data to the appropriate data manifest.
48 + /// Use IBurnBackendHelper to add data.
49 /// </summary>
50 /// <param name="section">The linked section.</param>
51 /// <param name="symbol">The current symbol.</param>
@@ -47,12 +53,7 @@ namespace WixToolset.Extensibility
53 /// True if the extension handled the symbol, false otherwise.
54 /// The Burn backend will warn on all unhandled symbols.
55 /// </returns>
50 - bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol);
51 -
52 - /// <summary>
53 - /// Called after all output changes occur and right before the output is bound into its final format.
54 - /// </summary>
55 - void BundleFinalize();
56 + bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol);
57
58 /// <summary>
59 /// Called after output is bound into its final format.
src/WixToolset.Extensibility/IWindowsInstallerBackendBinderExtension.cs
+11 -11
@@ -24,10 +24,10 @@ namespace WixToolset.Extensibility
24 void PreBackendBind(IBindContext context);
25
26 /// <summary>
27 - ///
27 + /// Extension can process the intermediate before the Windows Installer data is created.
28 /// </summary>
29 - /// <param name="section">The resolved intermedate section.</param>
30 - void FullyResolved(IntermediateSection section);
29 + /// <param name="section">The finalized intermediate section.</param>
30 + void SymbolsFinalized(IntermediateSection section);
31
32 /// <summary>
33 /// Finds an existing cabinet that contains the provided files.
@@ -41,20 +41,20 @@ namespace WixToolset.Extensibility
41 /// Override layout location for a media.
42 /// </summary>
43 /// <param name="mediaSymbol">Media symbol.</param>
44 - /// <param name="mediaLayoutDirectory">Default media layout directory.</param>
45 - /// <param name="layoutDirectory">Default layout directory.</param>
44 + /// <param name="mediaLayoutDirectory">Default media specific layout directory.</param>
45 + /// <param name="layoutDirectory">Default overall layout directory.</param>
46 /// <returns>Layout location or null to use the default processing.</returns>
47 string ResolveMedia(MediaSymbol mediaSymbol, string mediaLayoutDirectory, string layoutDirectory);
48
49 /// <summary>
50 - ///
50 + /// Called for each extension symbol that hasn't been handled yet.
51 /// </summary>
52 - /// <param name="section"></param>
53 - /// <param name="symbol"></param>
54 - /// <param name="output">Windows Installer data </param>
52 + /// <param name="section">The linked section.</param>
53 + /// <param name="symbol">The current symbol.</param>
54 + /// <param name="data">Windows Installer data </param>
55 /// <param name="tableDefinitions">Collection of table definitions available for the output.</param>
56 - /// <returns>True if the symbol was added to the output, or false if not.</returns>
57 - bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions);
56 + /// <returns>True if the symbol was handled, or false if not.</returns>
57 + bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions);
58
59 /// <summary>
60 /// Called after all output changes occur and right before the output is bound into its final format.