diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-14 23:08:24 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-14 23:08:24 -0800 |
| commit | 404f34f00ecce034a8a06fe4757789c6ce62f3f6 (patch) | |
| tree | 7132435cfa13f0f9b0e872a57ab19d52a12bb103 /src | |
| parent | 3f6e936c5e9d7a9df7e3e0ed1bc17001c53db5b3 (diff) | |
| download | wix-404f34f00ecce034a8a06fe4757789c6ce62f3f6.tar.gz wix-404f34f00ecce034a8a06fe4757789c6ce62f3f6.tar.bz2 wix-404f34f00ecce034a8a06fe4757789c6ce62f3f6.zip | |
Remove ICompilerCore, introduce IParseHelper and other small fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Extensibility/BaseCompilerExtension.cs (renamed from src/WixToolset.Extensibility/CompilerExtension.cs) | 21 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/CompilerConstants.cs | 2 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/ComponentKeyPath.cs | 2 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/IBinderCore.cs | 35 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/ICompileContext.cs | 4 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/ICompilerExtension.cs | 14 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/Services/IParseHelper.cs (renamed from src/WixToolset.Extensibility/ICompilerCore.cs) | 121 |
7 files changed, 77 insertions, 122 deletions
diff --git a/src/WixToolset.Extensibility/CompilerExtension.cs b/src/WixToolset.Extensibility/BaseCompilerExtension.cs index d0bb4a10..508886d3 100644 --- a/src/WixToolset.Extensibility/CompilerExtension.cs +++ b/src/WixToolset.Extensibility/BaseCompilerExtension.cs | |||
| @@ -5,17 +5,17 @@ namespace WixToolset.Extensibility | |||
| 5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
| 6 | using System.Xml.Linq; | 6 | using System.Xml.Linq; |
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility.Services; | ||
| 8 | 9 | ||
| 9 | /// <summary> | 10 | /// <summary> |
| 10 | /// Base class for creating a compiler extension. | 11 | /// Base class for creating a compiler extension. |
| 11 | /// </summary> | 12 | /// </summary> |
| 12 | public abstract class CompilerExtension : ICompilerExtension | 13 | public abstract class BaseCompilerExtension : ICompilerExtension |
| 13 | { | 14 | { |
| 14 | /// <summary> | 15 | /// <summary> |
| 15 | /// Gets or sets the compiler core for the extension. | 16 | /// ParserHelper for use by the extension. |
| 16 | /// </summary> | 17 | /// </summary> |
| 17 | /// <value>Compiler core for the extension.</value> | 18 | protected IParseHelper ParseHelper { get; private set; } |
| 18 | public ICompilerCore Core { get; set; } | ||
| 19 | 19 | ||
| 20 | /// <summary> | 20 | /// <summary> |
| 21 | /// Gets the schema namespace for this extension. | 21 | /// Gets the schema namespace for this extension. |
| @@ -28,6 +28,7 @@ namespace WixToolset.Extensibility | |||
| 28 | /// </summary> | 28 | /// </summary> |
| 29 | public virtual void PreCompile(ICompileContext context) | 29 | public virtual void PreCompile(ICompileContext context) |
| 30 | { | 30 | { |
| 31 | this.ParseHelper = context.ServiceProvider.GetService<IParseHelper>(); | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | /// <summary> | 34 | /// <summary> |
| @@ -36,9 +37,9 @@ namespace WixToolset.Extensibility | |||
| 36 | /// <param name="parentElement">Parent element of attribute.</param> | 37 | /// <param name="parentElement">Parent element of attribute.</param> |
| 37 | /// <param name="attribute">Attribute to process.</param> | 38 | /// <param name="attribute">Attribute to process.</param> |
| 38 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> | 39 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> |
| 39 | public virtual void ParseAttribute(XElement parentElement, XAttribute attribute, IDictionary<string, string> context) | 40 | public virtual void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context) |
| 40 | { | 41 | { |
| 41 | this.Core.UnexpectedAttribute(parentElement, attribute); | 42 | this.ParseHelper.UnexpectedAttribute(parentElement, attribute); |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | /// <summary> | 45 | /// <summary> |
| @@ -47,9 +48,9 @@ namespace WixToolset.Extensibility | |||
| 47 | /// <param name="parentElement">Parent element of element to process.</param> | 48 | /// <param name="parentElement">Parent element of element to process.</param> |
| 48 | /// <param name="element">Element to process.</param> | 49 | /// <param name="element">Element to process.</param> |
| 49 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | 50 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> |
| 50 | public virtual void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) | 51 | public virtual void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) |
| 51 | { | 52 | { |
| 52 | this.Core.UnexpectedElement(parentElement, element); | 53 | this.ParseHelper.UnexpectedElement(parentElement, element); |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | /// <summary> | 56 | /// <summary> |
| @@ -59,9 +60,9 @@ namespace WixToolset.Extensibility | |||
| 59 | /// <param name="element">Element to process.</param> | 60 | /// <param name="element">Element to process.</param> |
| 60 | /// <param name="keyPath">Explicit key path.</param> | 61 | /// <param name="keyPath">Explicit key path.</param> |
| 61 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | 62 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> |
| 62 | public virtual ComponentKeyPath ParsePossibleKeyPathElement(XElement parentElement, XElement element, IDictionary<string, string> context) | 63 | public virtual ComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) |
| 63 | { | 64 | { |
| 64 | this.ParseElement(parentElement, element, context); | 65 | this.ParseElement(intermediate, section, parentElement, element, context); |
| 65 | return null; | 66 | return null; |
| 66 | } | 67 | } |
| 67 | 68 | ||
diff --git a/src/WixToolset.Extensibility/CompilerConstants.cs b/src/WixToolset.Extensibility/CompilerConstants.cs index 6d4ca742..9f666b43 100644 --- a/src/WixToolset.Extensibility/CompilerConstants.cs +++ b/src/WixToolset.Extensibility/CompilerConstants.cs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // 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. | 1 | // 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. |
| 2 | 2 | ||
| 3 | namespace WixToolset | 3 | namespace WixToolset.Extensibility |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | 6 | ||
diff --git a/src/WixToolset.Extensibility/ComponentKeyPath.cs b/src/WixToolset.Extensibility/ComponentKeyPath.cs index f00e8f74..15cbb02f 100644 --- a/src/WixToolset.Extensibility/ComponentKeyPath.cs +++ b/src/WixToolset.Extensibility/ComponentKeyPath.cs | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Extensibility | 3 | namespace WixToolset.Extensibility |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 6 | |||
| 7 | public enum ComponentKeyPathType | 5 | public enum ComponentKeyPathType |
| 8 | { | 6 | { |
| 9 | /// <summary> | 7 | /// <summary> |
diff --git a/src/WixToolset.Extensibility/IBinderCore.cs b/src/WixToolset.Extensibility/IBinderCore.cs deleted file mode 100644 index dd3fa3fe..00000000 --- a/src/WixToolset.Extensibility/IBinderCore.cs +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Extensibility | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | |||
| 7 | public interface IBinderCore : IMessageHandler | ||
| 8 | { | ||
| 9 | /// <summary> | ||
| 10 | /// Gets or sets the file manager core for the extension. | ||
| 11 | /// </summary> | ||
| 12 | /// <value>File manager core for the extension.</value> | ||
| 13 | IBinderFileManagerCore FileManagerCore { get; set; } | ||
| 14 | |||
| 15 | /// <summary> | ||
| 16 | /// Gets whether the binder core encountered an error while processing. | ||
| 17 | /// </summary> | ||
| 18 | /// <value>Flag if core encountered an error during processing.</value> | ||
| 19 | bool EncounteredError { get; } | ||
| 20 | |||
| 21 | /// <summary> | ||
| 22 | /// Gets the table definitions used by the Binder. | ||
| 23 | /// </summary> | ||
| 24 | /// <value>Table definitions used by the binder.</value> | ||
| 25 | //TableDefinitionCollection TableDefinitions { get; } | ||
| 26 | |||
| 27 | /// <summary> | ||
| 28 | /// Generate an identifier by hashing data from the row. | ||
| 29 | /// </summary> | ||
| 30 | /// <param name="prefix">Three letter or less prefix for generated row identifier.</param> | ||
| 31 | /// <param name="args">Information to hash.</param> | ||
| 32 | /// <returns>The generated identifier.</returns> | ||
| 33 | string CreateIdentifier(string prefix, params string[] args); | ||
| 34 | } | ||
| 35 | } | ||
diff --git a/src/WixToolset.Extensibility/ICompileContext.cs b/src/WixToolset.Extensibility/ICompileContext.cs index d48e9539..bd0d0a4b 100644 --- a/src/WixToolset.Extensibility/ICompileContext.cs +++ b/src/WixToolset.Extensibility/ICompileContext.cs | |||
| @@ -19,6 +19,10 @@ namespace WixToolset.Extensibility | |||
| 19 | 19 | ||
| 20 | string OutputPath { get; set; } | 20 | string OutputPath { get; set; } |
| 21 | 21 | ||
| 22 | /// <summary> | ||
| 23 | /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements. | ||
| 24 | /// </summary> | ||
| 25 | /// <value>The platform which the compiler will use when defaulting 64-bit attributes and elements.</value> | ||
| 22 | Platform Platform { get; set; } | 26 | Platform Platform { get; set; } |
| 23 | 27 | ||
| 24 | XDocument Source { get; set; } | 28 | XDocument Source { get; set; } |
diff --git a/src/WixToolset.Extensibility/ICompilerExtension.cs b/src/WixToolset.Extensibility/ICompilerExtension.cs index 1746a571..0aa5c9e2 100644 --- a/src/WixToolset.Extensibility/ICompilerExtension.cs +++ b/src/WixToolset.Extensibility/ICompilerExtension.cs | |||
| @@ -5,20 +5,12 @@ namespace WixToolset.Extensibility | |||
| 5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
| 6 | using System.Xml.Linq; | 6 | using System.Xml.Linq; |
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility.Services; | ||
| 9 | 8 | ||
| 10 | /// <summary> | 9 | /// <summary> |
| 11 | /// Interface all compiler extensions implement. | 10 | /// Interface all compiler extensions implement. |
| 12 | /// </summary> | 11 | /// </summary> |
| 13 | public interface ICompilerExtension | 12 | public interface ICompilerExtension |
| 14 | { | 13 | { |
| 15 | #if false | ||
| 16 | /// <summary> | ||
| 17 | /// Gets or sets the compiler core for the extension. | ||
| 18 | /// </summary> | ||
| 19 | /// <value>Compiler core for the extension.</value> | ||
| 20 | ICompilerCore Core { get; set; } | ||
| 21 | #endif | ||
| 22 | /// <summary> | 14 | /// <summary> |
| 23 | /// Gets the schema namespace for this extension. | 15 | /// Gets the schema namespace for this extension. |
| 24 | /// </summary> | 16 | /// </summary> |
| @@ -36,7 +28,7 @@ namespace WixToolset.Extensibility | |||
| 36 | /// <param name="parentElement">Parent element of attribute.</param> | 28 | /// <param name="parentElement">Parent element of attribute.</param> |
| 37 | /// <param name="attribute">Attribute to process.</param> | 29 | /// <param name="attribute">Attribute to process.</param> |
| 38 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> | 30 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> |
| 39 | void ParseAttribute(XElement parentElement, XAttribute attribute, IDictionary<string, string> context); | 31 | void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context); |
| 40 | 32 | ||
| 41 | /// <summary> | 33 | /// <summary> |
| 42 | /// Processes an element for the Compiler. | 34 | /// Processes an element for the Compiler. |
| @@ -44,7 +36,7 @@ namespace WixToolset.Extensibility | |||
| 44 | /// <param name="parentElement">Parent element of element to process.</param> | 36 | /// <param name="parentElement">Parent element of element to process.</param> |
| 45 | /// <param name="element">Element to process.</param> | 37 | /// <param name="element">Element to process.</param> |
| 46 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> | 38 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> |
| 47 | void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context); | 39 | void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context); |
| 48 | 40 | ||
| 49 | /// <summary> | 41 | /// <summary> |
| 50 | /// Processes an element for the Compiler, with the ability to supply a component keypath. | 42 | /// Processes an element for the Compiler, with the ability to supply a component keypath. |
| @@ -52,7 +44,7 @@ namespace WixToolset.Extensibility | |||
| 52 | /// <param name="parentElement">Parent element of element to process.</param> | 44 | /// <param name="parentElement">Parent element of element to process.</param> |
| 53 | /// <param name="element">Element to process.</param> | 45 | /// <param name="element">Element to process.</param> |
| 54 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | 46 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> |
| 55 | ComponentKeyPath ParsePossibleKeyPathElement(XElement parentElement, XElement element, IDictionary<string, string> context); | 47 | ComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context); |
| 56 | 48 | ||
| 57 | /// <summary> | 49 | /// <summary> |
| 58 | /// Called at the end of the compilation of a source file. | 50 | /// Called at the end of the compilation of a source file. |
diff --git a/src/WixToolset.Extensibility/ICompilerCore.cs b/src/WixToolset.Extensibility/Services/IParseHelper.cs index d71f9cbe..46ade2e1 100644 --- a/src/WixToolset.Extensibility/ICompilerCore.cs +++ b/src/WixToolset.Extensibility/Services/IParseHelper.cs | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | // 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. | 1 | // 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. |
| 2 | 2 | ||
| 3 | namespace WixToolset.Extensibility | 3 | namespace WixToolset.Extensibility.Services |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections; | ||
| 7 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 8 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
| 9 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| @@ -11,21 +10,9 @@ namespace WixToolset.Extensibility | |||
| 11 | /// <summary> | 10 | /// <summary> |
| 12 | /// Core interface provided by the compiler. | 11 | /// Core interface provided by the compiler. |
| 13 | /// </summary> | 12 | /// </summary> |
| 14 | public interface ICompilerCore : IMessageHandler | 13 | public interface IParseHelper |
| 15 | { | 14 | { |
| 16 | /// <summary> | 15 | /// <summary> |
| 17 | /// Gets whether the compiler core encountered an error while processing. | ||
| 18 | /// </summary> | ||
| 19 | /// <value>Flag if core encountered an error during processing.</value> | ||
| 20 | bool EncounteredError { get; } | ||
| 21 | |||
| 22 | /// <summary> | ||
| 23 | /// Gets the platform which the compiler will use when defaulting 64-bit attributes and elements. | ||
| 24 | /// </summary> | ||
| 25 | /// <value>The platform which the compiler will use when defaulting 64-bit attributes and elements.</value> | ||
| 26 | Platform CurrentPlatform { get; } | ||
| 27 | |||
| 28 | /// <summary> | ||
| 29 | /// Creates a version 3 name-based UUID. | 16 | /// Creates a version 3 name-based UUID. |
| 30 | /// </summary> | 17 | /// </summary> |
| 31 | /// <param name="namespaceGuid">The namespace UUID.</param> | 18 | /// <param name="namespaceGuid">The namespace UUID.</param> |
| @@ -49,20 +36,38 @@ namespace WixToolset.Extensibility | |||
| 49 | Identifier CreateIdentifierFromFilename(string filename); | 36 | Identifier CreateIdentifierFromFilename(string filename); |
| 50 | 37 | ||
| 51 | /// <summary> | 38 | /// <summary> |
| 52 | /// Convert a bit array into an int value. | 39 | /// Creates a row in the section. |
| 53 | /// </summary> | 40 | /// </summary> |
| 54 | /// <param name="bits">The bit array to convert.</param> | 41 | /// <param name="section">Section to add the new tuple to.</param> |
| 55 | /// <returns>The converted int value.</returns> | 42 | /// <param name="sourceLineNumbers">Source and line number of current row.</param> |
| 56 | int CreateIntegerFromBitArray(BitArray bits); | 43 | /// <param name="tableName">Name of table to create row in.</param> |
| 44 | /// <param name="identifier">Optional identifier for the row.</param> | ||
| 45 | /// <returns>New row.</returns> | ||
| 46 | IntermediateTuple CreateRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, string tableName, Identifier identifier = null); | ||
| 57 | 47 | ||
| 58 | /// <summary> | 48 | /// <summary> |
| 59 | /// Creates a row in the active section. | 49 | /// Creates a row in the section. |
| 60 | /// </summary> | 50 | /// </summary> |
| 51 | /// <param name="section">Section to add the new tuple to.</param> | ||
| 61 | /// <param name="sourceLineNumbers">Source and line number of current row.</param> | 52 | /// <param name="sourceLineNumbers">Source and line number of current row.</param> |
| 62 | /// <param name="tableName">Name of table to create row in.</param> | 53 | /// <param name="tupleType">Type of tuple to create.</param> |
| 63 | /// <param name="identifier">Optional identifier for the row.</param> | 54 | /// <param name="identifier">Optional identifier for the row.</param> |
| 64 | /// <returns>New row.</returns> | 55 | /// <returns>New row.</returns> |
| 65 | IntermediateTuple CreateRow(SourceLineNumber sourceLineNumbers, string tableName, Identifier identifier = null); | 56 | IntermediateTuple CreateRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, TupleDefinitionType tupleType, Identifier identifier = null); |
| 57 | |||
| 58 | /// <summary> | ||
| 59 | /// Creates a directory row from a name. | ||
| 60 | /// </summary> | ||
| 61 | /// <param name="section">Section to add the new tuple to.</param> | ||
| 62 | /// <param name="sourceLineNumbers">Source line information.</param> | ||
| 63 | /// <param name="id">Optional identifier for the new row.</param> | ||
| 64 | /// <param name="parentId">Optional identifier for the parent row.</param> | ||
| 65 | /// <param name="name">Long name of the directory.</param> | ||
| 66 | /// <param name="shortName">Optional short name of the directory.</param> | ||
| 67 | /// <param name="sourceName">Optional source name for the directory.</param> | ||
| 68 | /// <param name="shortSourceName">Optional short source name for the directory.</param> | ||
| 69 | /// <returns>Identifier for the newly created row.</returns> | ||
| 70 | Identifier CreateDirectoryRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, string shortName = null, string sourceName = null, string shortSourceName = null, ISet<string> sectionInlinedDirectoryIds = null); | ||
| 66 | 71 | ||
| 67 | /// <summary> | 72 | /// <summary> |
| 68 | /// Creates directories using the inline directory syntax. | 73 | /// Creates directories using the inline directory syntax. |
| @@ -71,7 +76,7 @@ namespace WixToolset.Extensibility | |||
| 71 | /// <param name="attribute">The attribute to parse.</param> | 76 | /// <param name="attribute">The attribute to parse.</param> |
| 72 | /// <param name="parentId">Optional identifier of parent directory.</param> | 77 | /// <param name="parentId">Optional identifier of parent directory.</param> |
| 73 | /// <returns>Identifier of the leaf directory created.</returns> | 78 | /// <returns>Identifier of the leaf directory created.</returns> |
| 74 | string CreateDirectoryReferenceFromInlineSyntax(SourceLineNumber sourceLineNumbers, XAttribute attribute, string parentId); | 79 | string CreateDirectoryReferenceFromInlineSyntax(IntermediateSection section, SourceLineNumber sourceLineNumbers, XAttribute attribute, string parentId); |
| 75 | 80 | ||
| 76 | /// <summary> | 81 | /// <summary> |
| 77 | /// Creates a Registry row in the active section. | 82 | /// Creates a Registry row in the active section. |
| @@ -83,7 +88,7 @@ namespace WixToolset.Extensibility | |||
| 83 | /// <param name="value">The registry entry value.</param> | 88 | /// <param name="value">The registry entry value.</param> |
| 84 | /// <param name="componentId">The component which will control installation/uninstallation of the registry entry.</param> | 89 | /// <param name="componentId">The component which will control installation/uninstallation of the registry entry.</param> |
| 85 | /// <param name="escapeLeadingHash">If true, "escape" leading '#' characters so the value is written as a REG_SZ.</param> | 90 | /// <param name="escapeLeadingHash">If true, "escape" leading '#' characters so the value is written as a REG_SZ.</param> |
| 86 | Identifier CreateRegistryRow(SourceLineNumber sourceLineNumbers, int root, string key, string name, string value, string componentId, bool escapeLeadingHash = false); | 91 | Identifier CreateRegistryRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, int root, string key, string name, string value, string componentId, bool escapeLeadingHash); |
| 87 | 92 | ||
| 88 | /// <summary> | 93 | /// <summary> |
| 89 | /// Creates a short file/directory name using an identifier and long file/directory name as input. | 94 | /// Creates a short file/directory name using an identifier and long file/directory name as input. |
| @@ -101,7 +106,7 @@ namespace WixToolset.Extensibility | |||
| 101 | /// <param name="sourceLineNumbers">Source line information for the row.</param> | 106 | /// <param name="sourceLineNumbers">Source line information for the row.</param> |
| 102 | /// <param name="tableName">The table name of the simple reference.</param> | 107 | /// <param name="tableName">The table name of the simple reference.</param> |
| 103 | /// <param name="primaryKeys">The primary keys of the simple reference.</param> | 108 | /// <param name="primaryKeys">The primary keys of the simple reference.</param> |
| 104 | void CreateSimpleReference(SourceLineNumber sourceLineNumbers, string tableName, params string[] primaryKeys); | 109 | void CreateSimpleReference(IntermediateSection section, SourceLineNumber sourceLineNumbers, string tableName, params string[] primaryKeys); |
| 105 | 110 | ||
| 106 | /// <summary> | 111 | /// <summary> |
| 107 | /// Creates WixComplexReference and WixGroup rows in the active section. | 112 | /// Creates WixComplexReference and WixGroup rows in the active section. |
| @@ -113,16 +118,17 @@ namespace WixToolset.Extensibility | |||
| 113 | /// <param name="childType">The child type.</param> | 118 | /// <param name="childType">The child type.</param> |
| 114 | /// <param name="childId">The child id.</param> | 119 | /// <param name="childId">The child id.</param> |
| 115 | /// <param name="isPrimary">Whether the child is primary.</param> | 120 | /// <param name="isPrimary">Whether the child is primary.</param> |
| 116 | void CreateComplexReference(SourceLineNumber sourceLineNumbers, ComplexReferenceParentType parentType, string parentId, string parentLanguage, ComplexReferenceChildType childType, string childId, bool isPrimary); | 121 | void CreateComplexReference(IntermediateSection section, SourceLineNumber sourceLineNumbers, ComplexReferenceParentType parentType, string parentId, string parentLanguage, ComplexReferenceChildType childType, string childId, bool isPrimary); |
| 117 | 122 | ||
| 118 | /// <summary> | 123 | /// <summary> |
| 119 | /// Creates a patch resource reference to the list of resoures to be filtered when producing a patch. This method should only be used when processing children of a patch family. | 124 | /// A row in the WixGroup table is added for this child node and its parent node. |
| 120 | /// </summary> | 125 | /// </summary> |
| 121 | /// <param name="sourceLineNumbers">Source and line number of current row.</param> | 126 | /// <param name="sourceLineNumbers">Source line information for the row.</param> |
| 122 | /// <param name="tableName">Name of table to create row in.</param> | 127 | /// <param name="parentType">Type of child's complex reference parent.</param> |
| 123 | /// <param name="primaryKeys">Array of keys that make up the primary key of the table.</param> | 128 | /// <param name="parentId">Id of the parenet node.</param> |
| 124 | /// <returns>New row.</returns> | 129 | /// <param name="childType">Complex reference type of child</param> |
| 125 | void CreatePatchFamilyChildReference(SourceLineNumber sourceLineNumbers, string tableName, params string[] primaryKeys); | 130 | /// <param name="childId">Id of the Child Node.</param> |
| 131 | void CreateWixGroupRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, ComplexReferenceParentType parentType, string parentId, ComplexReferenceChildType childType, string childId); | ||
| 126 | 132 | ||
| 127 | /// <summary> | 133 | /// <summary> |
| 128 | /// Checks if the string contains a property (i.e. "foo[Property]bar") | 134 | /// Checks if the string contains a property (i.e. "foo[Property]bar") |
| @@ -136,7 +142,7 @@ namespace WixToolset.Extensibility | |||
| 136 | /// </summary> | 142 | /// </summary> |
| 137 | /// <param name="sourceLineNumbers">Source line numbers.</param> | 143 | /// <param name="sourceLineNumbers">Source line numbers.</param> |
| 138 | /// <param name="tableName">Name of the table to ensure existance of.</param> | 144 | /// <param name="tableName">Name of the table to ensure existance of.</param> |
| 139 | void EnsureTable(SourceLineNumber sourceLineNumbers, string tableName); | 145 | void EnsureTable(IntermediateSection section, SourceLineNumber sourceLineNumbers, string tableName); |
| 140 | 146 | ||
| 141 | /// <summary> | 147 | /// <summary> |
| 142 | /// Get an attribute value and displays an error if the value is empty by default. | 148 | /// Get an attribute value and displays an error if the value is empty by default. |
| @@ -148,14 +154,6 @@ namespace WixToolset.Extensibility | |||
| 148 | string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly); | 154 | string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly); |
| 149 | 155 | ||
| 150 | /// <summary> | 156 | /// <summary> |
| 151 | /// Gets a Bundle variable value and displays an error for an illegal value. | ||
| 152 | /// </summary> | ||
| 153 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | ||
| 154 | /// <param name="attribute">The attribute containing the value to get.</param> | ||
| 155 | /// <returns>The attribute's value.</returns> | ||
| 156 | string GetAttributeBundleVariableValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); | ||
| 157 | |||
| 158 | /// <summary> | ||
| 159 | /// Get a guid attribute value and displays an error for an illegal guid value. | 157 | /// Get a guid attribute value and displays an error for an illegal guid value. |
| 160 | /// </summary> | 158 | /// </summary> |
| 161 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 159 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
| @@ -182,6 +180,15 @@ namespace WixToolset.Extensibility | |||
| 182 | string GetAttributeIdentifierValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); | 180 | string GetAttributeIdentifierValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); |
| 183 | 181 | ||
| 184 | /// <summary> | 182 | /// <summary> |
| 183 | /// Gets the attribute value as inline directory syntax. | ||
| 184 | /// </summary> | ||
| 185 | /// <param name="sourceLineNumbers">Source line information.</param> | ||
| 186 | /// <param name="attribute">Attribute containing the value to get.</param> | ||
| 187 | /// <param name="resultUsedToCreateReference">Flag indicates whether the inline directory syntax should be processed to create a directory row or to create a directory reference.</param> | ||
| 188 | /// <returns>Inline directory syntax split into array of strings or null if the syntax did not parse.</returns> | ||
| 189 | string[] GetAttributeInlineDirectorySyntax(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool resultUsedToCreateReference); | ||
| 190 | |||
| 191 | /// <summary> | ||
| 185 | /// Get an integer attribute value and displays an error for an illegal integer value. | 192 | /// Get an integer attribute value and displays an error for an illegal integer value. |
| 186 | /// </summary> | 193 | /// </summary> |
| 187 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 194 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
| @@ -212,15 +219,6 @@ namespace WixToolset.Extensibility | |||
| 212 | string GetAttributeLongFilename(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowWildcards = false, bool allowRelative = false); | 219 | string GetAttributeLongFilename(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowWildcards = false, bool allowRelative = false); |
| 213 | 220 | ||
| 214 | /// <summary> | 221 | /// <summary> |
| 215 | /// Gets a RegistryRoot as a MsiInterop.MsidbRegistryRoot value and displays an error for an illegal value. | ||
| 216 | /// </summary> | ||
| 217 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | ||
| 218 | /// <param name="attribute">The attribute containing the value to get.</param> | ||
| 219 | /// <param name="allowHkmu">Whether HKMU is returned as -1 (true), or treated as an error (false).</param> | ||
| 220 | /// <returns>The attribute's RegisitryRootType value.</returns> | ||
| 221 | int GetAttributeMsidbRegistryRootValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowHkmu); | ||
| 222 | |||
| 223 | /// <summary> | ||
| 224 | /// Gets a version value or possibly a binder variable and displays an error for an illegal version value. | 222 | /// Gets a version value or possibly a binder variable and displays an error for an illegal version value. |
| 225 | /// </summary> | 223 | /// </summary> |
| 226 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> | 224 | /// <param name="sourceLineNumbers">Source line information about the owner element.</param> |
| @@ -295,7 +293,7 @@ namespace WixToolset.Extensibility | |||
| 295 | /// <param name="element">Element containing attribute to be parsed.</param> | 293 | /// <param name="element">Element containing attribute to be parsed.</param> |
| 296 | /// <param name="attribute">Attribute to be parsed.</param> | 294 | /// <param name="attribute">Attribute to be parsed.</param> |
| 297 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> | 295 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> |
| 298 | void ParseExtensionAttribute(XElement element, XAttribute attribute, IDictionary<string, string> context = null); | 296 | void ParseExtensionAttribute(IEnumerable<ICompilerExtension> extensions, Intermediate intermediate, IntermediateSection section, XElement element, XAttribute attribute, IDictionary<string, string> context = null); |
| 299 | 297 | ||
| 300 | /// <summary> | 298 | /// <summary> |
| 301 | /// Attempts to use an extension to parse the element. | 299 | /// Attempts to use an extension to parse the element. |
| @@ -303,24 +301,21 @@ namespace WixToolset.Extensibility | |||
| 303 | /// <param name="parentElement">Element containing element to be parsed.</param> | 301 | /// <param name="parentElement">Element containing element to be parsed.</param> |
| 304 | /// <param name="element">Element to be parsed.</param> | 302 | /// <param name="element">Element to be parsed.</param> |
| 305 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | 303 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> |
| 306 | void ParseExtensionElement(XElement parentElement, XElement element, IDictionary<string, string> context = null); | 304 | void ParseExtensionElement(IEnumerable<ICompilerExtension> extensions, Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context = null); |
| 307 | 305 | ||
| 308 | /// <summary> | 306 | /// <summary> |
| 309 | /// Process all children of the element looking for extensions and erroring on the unexpected. | 307 | /// Attempts to use an extension to parse the element, with support for setting component keypath. |
| 310 | /// </summary> | 308 | /// </summary> |
| 311 | /// <param name="element">Element to parse children.</param> | 309 | /// <param name="parentElement">Element containing element to be parsed.</param> |
| 312 | void ParseForExtensionElements(XElement element); | 310 | /// <param name="element">Element to be parsed.</param> |
| 311 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | ||
| 312 | ComponentKeyPath ParsePossibleKeyPathExtensionElement(IEnumerable<ICompilerExtension> extensions, Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context); | ||
| 313 | 313 | ||
| 314 | /// <summary> | 314 | /// <summary> |
| 315 | /// Sets a bit in a bit array based on the index at which an attribute name was found in a string array. | 315 | /// Process all children of the element looking for extensions and erroring on the unexpected. |
| 316 | /// </summary> | 316 | /// </summary> |
| 317 | /// <param name="attributeNames">Array of attributes that map to bits.</param> | 317 | /// <param name="element">Element to parse children.</param> |
| 318 | /// <param name="attributeName">Name of attribute to check.</param> | 318 | void ParseForExtensionElements(IEnumerable<ICompilerExtension> extensions, Intermediate intermediate, IntermediateSection section, XElement element); |
| 319 | /// <param name="attributeValue">Value of attribute to check.</param> | ||
| 320 | /// <param name="bits">The bit array in which the bit will be set if found.</param> | ||
| 321 | /// <param name="offset">The offset into the bit array.</param> | ||
| 322 | /// <returns>true if the bit was set; false otherwise.</returns> | ||
| 323 | bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset); | ||
| 324 | 319 | ||
| 325 | /// <summary> | 320 | /// <summary> |
| 326 | /// Called when the compiler encounters an unexpected attribute. | 321 | /// Called when the compiler encounters an unexpected attribute. |
