diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-16 19:38:46 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-03-16 20:14:37 -0500 |
commit | b279d9c6d38058ff60b8461b35f33d5c056334c9 (patch) | |
tree | 3eeb1c8ab6b6290a74239398aa804cb49dbf133b | |
parent | db22d99a4d603caab18fd42cb40881431c353912 (diff) | |
download | wix-b279d9c6d38058ff60b8461b35f33d5c056334c9.tar.gz wix-b279d9c6d38058ff60b8461b35f33d5c056334c9.tar.bz2 wix-b279d9c6d38058ff60b8461b35f33d5c056334c9.zip |
Change IParseHelper to not be an IBundleValidator.
6 files changed, 16 insertions, 32 deletions
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs index de2c6f9f..3a71d120 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs | |||
@@ -13,7 +13,7 @@ namespace WixToolset.Extensibility.Services | |||
13 | /// <summary> | 13 | /// <summary> |
14 | /// Interface provided to help compiler extensions parse. | 14 | /// Interface provided to help compiler extensions parse. |
15 | /// </summary> | 15 | /// </summary> |
16 | public interface IParseHelper : IBundleValidator | 16 | public interface IParseHelper |
17 | { | 17 | { |
18 | /// <summary> | 18 | /// <summary> |
19 | /// Creates a version 3 name-based UUID. | 19 | /// Creates a version 3 name-based UUID. |
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/PerformBundleBackendValidationCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/PerformBundleBackendValidationCommand.cs index ee18ff2c..2db5841b 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/PerformBundleBackendValidationCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/PerformBundleBackendValidationCommand.cs | |||
@@ -19,13 +19,13 @@ namespace WixToolset.Core.Burn.Bundles | |||
19 | this.PackageFacadesById = packageFacadesById; | 19 | this.PackageFacadesById = packageFacadesById; |
20 | } | 20 | } |
21 | 21 | ||
22 | public IMessaging Messaging { get; } | 22 | private IMessaging Messaging { get; } |
23 | 23 | ||
24 | public IBurnBackendHelper BackendHelper { get; } | 24 | private IBurnBackendHelper BackendHelper { get; } |
25 | 25 | ||
26 | public IntermediateSection Section { get; } | 26 | private IntermediateSection Section { get; } |
27 | 27 | ||
28 | public IDictionary<string, PackageFacade> PackageFacadesById { get; } | 28 | private IDictionary<string, PackageFacade> PackageFacadesById { get; } |
29 | 29 | ||
30 | public void Execute() | 30 | public void Execute() |
31 | { | 31 | { |
diff --git a/src/wix/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs b/src/wix/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs index d77606fb..ed662b7f 100644 --- a/src/wix/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs +++ b/src/wix/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs | |||
@@ -158,6 +158,7 @@ namespace WixToolset.Core.Burn.ExtensibilityServices | |||
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region IBundleValidator | 160 | #region IBundleValidator |
161 | |||
161 | public string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath) | 162 | public string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath) |
162 | { | 163 | { |
163 | return this.bundleValidator.GetCanonicalRelativePath(sourceLineNumbers, elementName, attributeName, relativePath); | 164 | return this.bundleValidator.GetCanonicalRelativePath(sourceLineNumbers, elementName, attributeName, relativePath); |
@@ -177,6 +178,7 @@ namespace WixToolset.Core.Burn.ExtensibilityServices | |||
177 | { | 178 | { |
178 | return this.bundleValidator.ValidateBundleCondition(sourceLineNumbers, elementName, attributeName, condition, phase); | 179 | return this.bundleValidator.ValidateBundleCondition(sourceLineNumbers, elementName, attributeName, condition, phase); |
179 | } | 180 | } |
181 | |||
180 | #endregion | 182 | #endregion |
181 | 183 | ||
182 | #region IInternalBurnBackendHelper interfaces | 184 | #region IInternalBurnBackendHelper interfaces |
diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs index 301a4f6a..5e2b3342 100644 --- a/src/wix/WixToolset.Core/Compiler.cs +++ b/src/wix/WixToolset.Core/Compiler.cs | |||
@@ -114,9 +114,10 @@ namespace WixToolset.Core | |||
114 | // Try to compile it. | 114 | // Try to compile it. |
115 | try | 115 | try |
116 | { | 116 | { |
117 | var bundleValidator = this.Context.ServiceProvider.GetService<IBundleValidator>(); | ||
117 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); | 118 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); |
118 | 119 | ||
119 | this.Core = new CompilerCore(target, this.Messaging, parseHelper, extensionsByNamespace); | 120 | this.Core = new CompilerCore(target, this.Messaging, bundleValidator, parseHelper, extensionsByNamespace); |
120 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; | 121 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; |
121 | this.componentIdPlaceholders = new Dictionary<string, string>(); | 122 | this.componentIdPlaceholders = new Dictionary<string, string>(); |
122 | 123 | ||
diff --git a/src/wix/WixToolset.Core/CompilerCore.cs b/src/wix/WixToolset.Core/CompilerCore.cs index 7effa0b9..e23b1e70 100644 --- a/src/wix/WixToolset.Core/CompilerCore.cs +++ b/src/wix/WixToolset.Core/CompilerCore.cs | |||
@@ -26,6 +26,7 @@ namespace WixToolset.Core | |||
26 | internal static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; | 26 | internal static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; |
27 | 27 | ||
28 | private readonly Dictionary<XNamespace, ICompilerExtension> extensions; | 28 | private readonly Dictionary<XNamespace, ICompilerExtension> extensions; |
29 | private readonly IBundleValidator bundleValidator; | ||
29 | private readonly IParseHelper parseHelper; | 30 | private readonly IParseHelper parseHelper; |
30 | private readonly Intermediate intermediate; | 31 | private readonly Intermediate intermediate; |
31 | private readonly IMessaging messaging; | 32 | private readonly IMessaging messaging; |
@@ -37,11 +38,13 @@ namespace WixToolset.Core | |||
37 | /// </summary> | 38 | /// </summary> |
38 | /// <param name="intermediate">The Intermediate object representing compiled source document.</param> | 39 | /// <param name="intermediate">The Intermediate object representing compiled source document.</param> |
39 | /// <param name="messaging"></param> | 40 | /// <param name="messaging"></param> |
41 | /// <param name="bundleValidator"></param> | ||
40 | /// <param name="parseHelper"></param> | 42 | /// <param name="parseHelper"></param> |
41 | /// <param name="extensions">The WiX extensions collection.</param> | 43 | /// <param name="extensions">The WiX extensions collection.</param> |
42 | internal CompilerCore(Intermediate intermediate, IMessaging messaging, IParseHelper parseHelper, Dictionary<XNamespace, ICompilerExtension> extensions) | 44 | internal CompilerCore(Intermediate intermediate, IMessaging messaging, IBundleValidator bundleValidator, IParseHelper parseHelper, Dictionary<XNamespace, ICompilerExtension> extensions) |
43 | { | 45 | { |
44 | this.extensions = extensions; | 46 | this.extensions = extensions; |
47 | this.bundleValidator = bundleValidator; | ||
45 | this.parseHelper = parseHelper; | 48 | this.parseHelper = parseHelper; |
46 | this.intermediate = intermediate; | 49 | this.intermediate = intermediate; |
47 | this.messaging = messaging; | 50 | this.messaging = messaging; |
@@ -765,7 +768,7 @@ namespace WixToolset.Core | |||
765 | 768 | ||
766 | if (!String.IsNullOrEmpty(value)) | 769 | if (!String.IsNullOrEmpty(value)) |
767 | { | 770 | { |
768 | this.parseHelper.ValidateBundleVariableName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); | 771 | this.bundleValidator.ValidateBundleVariableName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); |
769 | } | 772 | } |
770 | 773 | ||
771 | return value; | 774 | return value; |
@@ -783,7 +786,7 @@ namespace WixToolset.Core | |||
783 | 786 | ||
784 | if (0 < value.Length) | 787 | if (0 < value.Length) |
785 | { | 788 | { |
786 | this.parseHelper.ValidateBundleMsiPropertyName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); | 789 | this.bundleValidator.ValidateBundleMsiPropertyName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); |
787 | } | 790 | } |
788 | 791 | ||
789 | return value; | 792 | return value; |
diff --git a/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index fa4f50ba..2d5c5b2e 100644 --- a/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | |||
@@ -468,7 +468,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
468 | } | 468 | } |
469 | else if (allowRelative) | 469 | else if (allowRelative) |
470 | { | 470 | { |
471 | value = this.GetCanonicalRelativePath(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); | 471 | value = this.BundleValidator.GetCanonicalRelativePath(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value); |
472 | } | 472 | } |
473 | else if (CompilerCore.IsAmbiguousFilename(value)) | 473 | else if (CompilerCore.IsAmbiguousFilename(value)) |
474 | { | 474 | { |
@@ -859,27 +859,5 @@ namespace WixToolset.Core.ExtensibilityServices | |||
859 | 859 | ||
860 | return extension != null; | 860 | return extension != null; |
861 | } | 861 | } |
862 | |||
863 | #region IBundleValidator | ||
864 | public string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath) | ||
865 | { | ||
866 | return this.BundleValidator.GetCanonicalRelativePath(sourceLineNumbers, elementName, attributeName, relativePath); | ||
867 | } | ||
868 | |||
869 | public bool ValidateBundleMsiPropertyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyName) | ||
870 | { | ||
871 | return this.BundleValidator.ValidateBundleMsiPropertyName(sourceLineNumbers, elementName, attributeName, propertyName); | ||
872 | } | ||
873 | |||
874 | public bool ValidateBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName) | ||
875 | { | ||
876 | return this.BundleValidator.ValidateBundleVariableName(sourceLineNumbers, elementName, attributeName, variableName); | ||
877 | } | ||
878 | |||
879 | public bool ValidateBundleCondition(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string condition, BundleConditionPhase phase) | ||
880 | { | ||
881 | return this.BundleValidator.ValidateBundleCondition(sourceLineNumbers, elementName, attributeName, condition, phase); | ||
882 | } | ||
883 | #endregion | ||
884 | } | 862 | } |
885 | } | 863 | } |