diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-12-21 13:37:19 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-12-21 13:42:38 -0800 |
| commit | 5287c9ce70877b6b1e96d3253a395101fe30de8f (patch) | |
| tree | afd373b856aa2a2320d13666e20548378c84b3e3 /src | |
| parent | 21be85310baadfb1a479ca5b8c4d8f27018ff8f8 (diff) | |
| download | wix-5287c9ce70877b6b1e96d3253a395101fe30de8f.tar.gz wix-5287c9ce70877b6b1e96d3253a395101fe30de8f.tar.bz2 wix-5287c9ce70877b6b1e96d3253a395101fe30de8f.zip | |
Introduce IResolveExtension and IFileSystemExtension with cleanup
Diffstat (limited to 'src')
19 files changed, 254 insertions, 188 deletions
diff --git a/src/WixToolset.Extensibility/BaseResolverExtension.cs b/src/WixToolset.Extensibility/BaseResolverExtension.cs new file mode 100644 index 00000000..9498d126 --- /dev/null +++ b/src/WixToolset.Extensibility/BaseResolverExtension.cs | |||
| @@ -0,0 +1,38 @@ | |||
| 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 | using WixToolset.Data.Bind; | ||
| 7 | |||
| 8 | /// <summary> | ||
| 9 | /// Base class for creating a resolver extension. | ||
| 10 | /// </summary> | ||
| 11 | public abstract class BaseResolverExtension : IResolverExtension | ||
| 12 | { | ||
| 13 | /// <summary> | ||
| 14 | /// Context for use by the extension. | ||
| 15 | /// </summary> | ||
| 16 | protected IResolveContext Context { get; private set; } | ||
| 17 | |||
| 18 | /// <summary> | ||
| 19 | /// Called at the beginning of the resolving variables and files. | ||
| 20 | /// </summary> | ||
| 21 | public virtual void PreResolve(IResolveContext context) | ||
| 22 | { | ||
| 23 | this.Context = context; | ||
| 24 | } | ||
| 25 | |||
| 26 | public virtual string ResolveFile(string source, IntermediateTupleDefinition tupleDefinition, SourceLineNumber sourceLineNumbers, BindStage bindStage) | ||
| 27 | { | ||
| 28 | return null; | ||
| 29 | } | ||
| 30 | |||
| 31 | /// <summary> | ||
| 32 | /// Called at the end of resolve. | ||
| 33 | /// </summary> | ||
| 34 | public virtual void PostResolve(ResolveResult result) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
diff --git a/src/WixToolset.Extensibility/BinderExtensionBase.cs b/src/WixToolset.Extensibility/BinderExtensionBase.cs deleted file mode 100644 index f3f3d63b..00000000 --- a/src/WixToolset.Extensibility/BinderExtensionBase.cs +++ /dev/null | |||
| @@ -1,55 +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 | using WixToolset.Data.Bind; | ||
| 7 | using WixToolset.Extensibility.Services; | ||
| 8 | |||
| 9 | public abstract class BinderExtensionBase : IBinderExtension | ||
| 10 | { | ||
| 11 | protected IBindContext Context { get; private set; } | ||
| 12 | |||
| 13 | /// <summary> | ||
| 14 | /// Called before binding occurs. | ||
| 15 | /// </summary> | ||
| 16 | public virtual void PreBind(IBindContext context) | ||
| 17 | { | ||
| 18 | this.Context = context; | ||
| 19 | } | ||
| 20 | |||
| 21 | /// <summary> | ||
| 22 | /// Called after variable resolution occurs. | ||
| 23 | /// </summary> | ||
| 24 | public virtual void AfterResolvedFields(Intermediate intermediate) | ||
| 25 | { | ||
| 26 | } | ||
| 27 | |||
| 28 | public virtual string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage) | ||
| 29 | { | ||
| 30 | return null; | ||
| 31 | } | ||
| 32 | |||
| 33 | public virtual bool? CompareFiles(string targetFile, string updatedFile) | ||
| 34 | { | ||
| 35 | return null; | ||
| 36 | } | ||
| 37 | |||
| 38 | public virtual bool CopyFile(string source, string destination, bool overwrite) | ||
| 39 | { | ||
| 40 | return false; | ||
| 41 | } | ||
| 42 | |||
| 43 | public virtual bool MoveFile(string source, string destination, bool overwrite) | ||
| 44 | { | ||
| 45 | return false; | ||
| 46 | } | ||
| 47 | |||
| 48 | /// <summary> | ||
| 49 | /// Called after binding is complete before the files are moved to their final locations. | ||
| 50 | /// </summary> | ||
| 51 | public virtual void PostBind(BindResult result) | ||
| 52 | { | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
diff --git a/src/WixToolset.Extensibility/IBackend.cs b/src/WixToolset.Extensibility/IBackend.cs index 9b950364..385fd086 100644 --- a/src/WixToolset.Extensibility/IBackend.cs +++ b/src/WixToolset.Extensibility/IBackend.cs | |||
| @@ -4,7 +4,6 @@ namespace WixToolset.Extensibility | |||
| 4 | { | 4 | { |
| 5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 6 | using WixToolset.Data.Bind; | 6 | using WixToolset.Data.Bind; |
| 7 | using WixToolset.Extensibility.Services; | ||
| 8 | 7 | ||
| 9 | public interface IBackend | 8 | public interface IBackend |
| 10 | { | 9 | { |
diff --git a/src/WixToolset.Extensibility/Services/IBindContext.cs b/src/WixToolset.Extensibility/IBindContext.cs index ad1aa818..1cb1c558 100644 --- a/src/WixToolset.Extensibility/Services/IBindContext.cs +++ b/src/WixToolset.Extensibility/IBindContext.cs | |||
| @@ -1,10 +1,11 @@ | |||
| 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.Services | 3 | namespace WixToolset.Extensibility |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility.Services; | ||
| 8 | 9 | ||
| 9 | public interface IBindContext | 10 | public interface IBindContext |
| 10 | { | 11 | { |
| @@ -12,8 +13,6 @@ namespace WixToolset.Extensibility.Services | |||
| 12 | 13 | ||
| 13 | IMessaging Messaging { get; set; } | 14 | IMessaging Messaging { get; set; } |
| 14 | 15 | ||
| 15 | IEnumerable<BindPath> BindPaths { get; set; } | ||
| 16 | |||
| 17 | int CabbingThreadCount { get; set; } | 16 | int CabbingThreadCount { get; set; } |
| 18 | 17 | ||
| 19 | string CabCachePath { get; set; } | 18 | string CabCachePath { get; set; } |
| @@ -26,9 +25,7 @@ namespace WixToolset.Extensibility.Services | |||
| 26 | 25 | ||
| 27 | IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | 26 | IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } |
| 28 | 27 | ||
| 29 | IExtensionManager ExtensionManager { get; set; } | 28 | IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } |
| 30 | |||
| 31 | IEnumerable<IBinderExtension> Extensions { get; set; } | ||
| 32 | 29 | ||
| 33 | IEnumerable<string> Ices { get; set; } | 30 | IEnumerable<string> Ices { get; set; } |
| 34 | 31 | ||
| @@ -40,14 +37,10 @@ namespace WixToolset.Extensibility.Services | |||
| 40 | 37 | ||
| 41 | string OutputPdbPath { get; set; } | 38 | string OutputPdbPath { get; set; } |
| 42 | 39 | ||
| 43 | bool SuppressAclReset { get; set; } | ||
| 44 | |||
| 45 | IEnumerable<string> SuppressIces { get; set; } | 40 | IEnumerable<string> SuppressIces { get; set; } |
| 46 | 41 | ||
| 47 | bool SuppressValidation { get; set; } | 42 | bool SuppressValidation { get; set; } |
| 48 | 43 | ||
| 49 | IBindVariableResolver WixVariableResolver { get; set; } | ||
| 50 | |||
| 51 | string ContentsFile { get; set; } | 44 | string ContentsFile { get; set; } |
| 52 | 45 | ||
| 53 | string OutputsFile { get; set; } | 46 | string OutputsFile { get; set; } |
diff --git a/src/WixToolset.Extensibility/IBindVariableResolver.cs b/src/WixToolset.Extensibility/IBindVariableResolver.cs deleted file mode 100644 index f584f327..00000000 --- a/src/WixToolset.Extensibility/IBindVariableResolver.cs +++ /dev/null | |||
| @@ -1,26 +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 | using WixToolset.Data.Tuples; | ||
| 7 | |||
| 8 | public interface IBindVariableResolver | ||
| 9 | { | ||
| 10 | int VariableCount { get; } | ||
| 11 | |||
| 12 | void AddVariable(string name, string value); | ||
| 13 | |||
| 14 | void AddVariable(WixVariableTuple wixVariableRow); | ||
| 15 | |||
| 16 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly); | ||
| 17 | |||
| 18 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, bool errorOnUnknown, out bool isDefault, out bool delayedResolve); | ||
| 19 | |||
| 20 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault); | ||
| 21 | |||
| 22 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault, out bool delayedResolve); | ||
| 23 | |||
| 24 | bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl); | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/src/WixToolset.Extensibility/IBinderExtension.cs b/src/WixToolset.Extensibility/IBinderExtension.cs deleted file mode 100644 index 0e9df10b..00000000 --- a/src/WixToolset.Extensibility/IBinderExtension.cs +++ /dev/null | |||
| @@ -1,37 +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 | using WixToolset.Data.Bind; | ||
| 7 | using WixToolset.Extensibility.Services; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// Interface all binder extensions implement. | ||
| 11 | /// </summary> | ||
| 12 | public interface IBinderExtension | ||
| 13 | { | ||
| 14 | /// <summary> | ||
| 15 | /// Called before binding occurs. | ||
| 16 | /// </summary> | ||
| 17 | void PreBind(IBindContext context); | ||
| 18 | |||
| 19 | /// <summary> | ||
| 20 | /// Called after variable resolution occurs. | ||
| 21 | /// </summary> | ||
| 22 | void AfterResolvedFields(Intermediate intermediate); | ||
| 23 | |||
| 24 | string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
| 25 | |||
| 26 | bool? CompareFiles(string targetFile, string updatedFile); | ||
| 27 | |||
| 28 | bool CopyFile(string source, string destination, bool overwrite); | ||
| 29 | |||
| 30 | bool MoveFile(string source, string destination, bool overwrite); | ||
| 31 | |||
| 32 | /// <summary> | ||
| 33 | /// Called after all output changes occur and right before the output is bound into its final format. | ||
| 34 | /// </summary> | ||
| 35 | void PostBind(BindResult result); | ||
| 36 | } | ||
| 37 | } | ||
diff --git a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs b/src/WixToolset.Extensibility/IBinderFileManagerCore.cs deleted file mode 100644 index 27644413..00000000 --- a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs +++ /dev/null | |||
| @@ -1,55 +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 System.Collections.Generic; | ||
| 6 | using WixToolset.Data; | ||
| 7 | using WixToolset.Data.Bind; | ||
| 8 | |||
| 9 | public interface IBinderFileManagerCore | ||
| 10 | { | ||
| 11 | /// <summary> | ||
| 12 | /// Gets or sets the path to cabinet cache. | ||
| 13 | /// </summary> | ||
| 14 | /// <value>The path to cabinet cache.</value> | ||
| 15 | string CabCachePath { get; } | ||
| 16 | |||
| 17 | /// <summary> | ||
| 18 | /// Gets or sets the active subStorage used for binding. | ||
| 19 | /// </summary> | ||
| 20 | /// <value>The subStorage object.</value> | ||
| 21 | //SubStorage ActiveSubStorage { get; } | ||
| 22 | |||
| 23 | /// <summary> | ||
| 24 | /// Gets or sets the output object used for binding. | ||
| 25 | /// </summary> | ||
| 26 | /// <value>The output object.</value> | ||
| 27 | Intermediate Intermediate { get; } | ||
| 28 | |||
| 29 | /// <summary> | ||
| 30 | /// Gets or sets the path to the temp files location. | ||
| 31 | /// </summary> | ||
| 32 | /// <value>The path to the temp files location.</value> | ||
| 33 | string TempFilesLocation { get; } | ||
| 34 | |||
| 35 | /// <summary> | ||
| 36 | /// Gets the property if re-basing target is true or false | ||
| 37 | /// </summary> | ||
| 38 | /// <value>It returns true if target bind path is to be replaced, otherwise false.</value> | ||
| 39 | bool RebaseTarget { get; } | ||
| 40 | |||
| 41 | /// <summary> | ||
| 42 | /// Gets the property if re-basing updated build is true or false | ||
| 43 | /// </summary> | ||
| 44 | /// <value>It returns true if updated bind path is to be replaced, otherwise false.</value> | ||
| 45 | bool RebaseUpdated { get; } | ||
| 46 | |||
| 47 | /// <summary> | ||
| 48 | /// Gets the collection of paths to locate files during ResolveFile for the provided BindStage and name. | ||
| 49 | /// </summary> | ||
| 50 | /// <param name="stage">Optional stage to get bind paths for. Default is normal.</param> | ||
| 51 | /// <param name="name">Optional name of the bind paths to get. Default is the unnamed paths.</param> | ||
| 52 | /// <value>The bind paths to locate files.</value> | ||
| 53 | IEnumerable<string> GetBindPaths(BindStage stage = BindStage.Normal, string name = null); | ||
| 54 | } | ||
| 55 | } | ||
diff --git a/src/WixToolset.Extensibility/IFileSystemContext.cs b/src/WixToolset.Extensibility/IFileSystemContext.cs new file mode 100644 index 00000000..32783957 --- /dev/null +++ b/src/WixToolset.Extensibility/IFileSystemContext.cs | |||
| @@ -0,0 +1,25 @@ | |||
| 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 System; | ||
| 6 | using WixToolset.Data; | ||
| 7 | using WixToolset.Extensibility.Services; | ||
| 8 | |||
| 9 | public interface IFileSystemContext | ||
| 10 | { | ||
| 11 | IServiceProvider ServiceProvider { get; } | ||
| 12 | |||
| 13 | IMessaging Messaging { get; set; } | ||
| 14 | |||
| 15 | string CabCachePath { get; set; } | ||
| 16 | |||
| 17 | string IntermediateFolder { get; set; } | ||
| 18 | |||
| 19 | Intermediate IntermediateRepresentation { get; set; } | ||
| 20 | |||
| 21 | string OutputPath { get; set; } | ||
| 22 | |||
| 23 | string OutputPdbPath { get; set; } | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/src/WixToolset.Extensibility/IFileSystemExtension.cs b/src/WixToolset.Extensibility/IFileSystemExtension.cs new file mode 100644 index 00000000..37b8e24a --- /dev/null +++ b/src/WixToolset.Extensibility/IFileSystemExtension.cs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 | /// <summary> | ||
| 6 | /// Interface all file system extensions implement. | ||
| 7 | /// </summary> | ||
| 8 | public interface IFileSystemExtension | ||
| 9 | { | ||
| 10 | void Initialize(IFileSystemContext context); | ||
| 11 | |||
| 12 | bool? CompareFiles(string targetFile, string updatedFile); | ||
| 13 | |||
| 14 | bool CopyFile(string source, string destination, bool overwrite); | ||
| 15 | |||
| 16 | bool MoveFile(string source, string destination, bool overwrite); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/src/WixToolset.Extensibility/ILayoutContext.cs b/src/WixToolset.Extensibility/ILayoutContext.cs new file mode 100644 index 00000000..5b4f014d --- /dev/null +++ b/src/WixToolset.Extensibility/ILayoutContext.cs | |||
| @@ -0,0 +1,34 @@ | |||
| 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 System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Data.Bind; | ||
| 8 | using WixToolset.Extensibility.Services; | ||
| 9 | |||
| 10 | public interface ILayoutContext | ||
| 11 | { | ||
| 12 | IServiceProvider ServiceProvider { get; } | ||
| 13 | |||
| 14 | IMessaging Messaging { get; set; } | ||
| 15 | |||
| 16 | IEnumerable<ILayoutExtension> Extensions { get; set; } | ||
| 17 | |||
| 18 | IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } | ||
| 19 | |||
| 20 | IEnumerable<string> ContentFilePaths { get; set; } | ||
| 21 | |||
| 22 | IEnumerable<FileTransfer> FileTransfers { get; set; } | ||
| 23 | |||
| 24 | string OutputPdbPath { get; set; } | ||
| 25 | |||
| 26 | string ContentsFile { get; set; } | ||
| 27 | |||
| 28 | string OutputsFile { get; set; } | ||
| 29 | |||
| 30 | string BuiltOutputsFile { get; set; } | ||
| 31 | |||
| 32 | bool SuppressAclReset { get; set; } | ||
| 33 | } | ||
| 34 | } | ||
diff --git a/src/WixToolset.Extensibility/ILayoutExtension.cs b/src/WixToolset.Extensibility/ILayoutExtension.cs new file mode 100644 index 00000000..b1de5bd2 --- /dev/null +++ b/src/WixToolset.Extensibility/ILayoutExtension.cs | |||
| @@ -0,0 +1,20 @@ | |||
| 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 | /// <summary> | ||
| 6 | /// Interface all resolver extensions implement. | ||
| 7 | /// </summary> | ||
| 8 | public interface ILayoutExtension | ||
| 9 | { | ||
| 10 | /// <summary> | ||
| 11 | /// Called before resolving occurs. | ||
| 12 | /// </summary> | ||
| 13 | void PreLayout(ILayoutContext context); | ||
| 14 | |||
| 15 | /// <summary> | ||
| 16 | /// Called after all resolving occurs. | ||
| 17 | /// </summary> | ||
| 18 | void PostLayout(); | ||
| 19 | } | ||
| 20 | } | ||
diff --git a/src/WixToolset.Extensibility/ILibrarianExtension.cs b/src/WixToolset.Extensibility/ILibrarianExtension.cs index ae4529d8..381abf01 100644 --- a/src/WixToolset.Extensibility/ILibrarianExtension.cs +++ b/src/WixToolset.Extensibility/ILibrarianExtension.cs | |||
| @@ -8,7 +8,7 @@ namespace WixToolset.Extensibility | |||
| 8 | { | 8 | { |
| 9 | void PreCombine(ILibraryContext context); | 9 | void PreCombine(ILibraryContext context); |
| 10 | 10 | ||
| 11 | string Resolve(SourceLineNumber sourceLineNumber, string table, string path); | 11 | string Resolve(SourceLineNumber sourceLineNumber, IntermediateTupleDefinition tupleDefinition, string path); |
| 12 | 12 | ||
| 13 | void PostCombine(Intermediate library); | 13 | void PostCombine(Intermediate library); |
| 14 | } | 14 | } |
diff --git a/src/WixToolset.Extensibility/ILibraryContext.cs b/src/WixToolset.Extensibility/ILibraryContext.cs index e715080f..0c29a3dd 100644 --- a/src/WixToolset.Extensibility/ILibraryContext.cs +++ b/src/WixToolset.Extensibility/ILibraryContext.cs | |||
| @@ -24,7 +24,5 @@ namespace WixToolset.Extensibility | |||
| 24 | IEnumerable<Localization> Localizations { get; set; } | 24 | IEnumerable<Localization> Localizations { get; set; } |
| 25 | 25 | ||
| 26 | IEnumerable<Intermediate> Intermediates { get; set; } | 26 | IEnumerable<Intermediate> Intermediates { get; set; } |
| 27 | |||
| 28 | IBindVariableResolver WixVariableResolver { get; set; } | ||
| 29 | } | 27 | } |
| 30 | } | 28 | } |
diff --git a/src/WixToolset.Extensibility/Services/ILinkContext.cs b/src/WixToolset.Extensibility/ILinkContext.cs index e098a900..65eeb6f1 100644 --- a/src/WixToolset.Extensibility/Services/ILinkContext.cs +++ b/src/WixToolset.Extensibility/ILinkContext.cs | |||
| @@ -1,10 +1,11 @@ | |||
| 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.Services | 3 | namespace WixToolset.Extensibility |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility.Services; | ||
| 8 | 9 | ||
| 9 | public interface ILinkContext | 10 | public interface ILinkContext |
| 10 | { | 11 | { |
diff --git a/src/WixToolset.Extensibility/IResolveContext.cs b/src/WixToolset.Extensibility/IResolveContext.cs new file mode 100644 index 00000000..026e5a35 --- /dev/null +++ b/src/WixToolset.Extensibility/IResolveContext.cs | |||
| @@ -0,0 +1,26 @@ | |||
| 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 System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Data; | ||
| 8 | using WixToolset.Extensibility.Services; | ||
| 9 | |||
| 10 | public interface IResolveContext | ||
| 11 | { | ||
| 12 | IServiceProvider ServiceProvider { get; } | ||
| 13 | |||
| 14 | IMessaging Messaging { get; set; } | ||
| 15 | |||
| 16 | IEnumerable<BindPath> BindPaths { get; set; } | ||
| 17 | |||
| 18 | IEnumerable<IResolverExtension> Extensions { get; set; } | ||
| 19 | |||
| 20 | string IntermediateFolder { get; set; } | ||
| 21 | |||
| 22 | Intermediate IntermediateRepresentation { get; set; } | ||
| 23 | |||
| 24 | IBindVariableResolver WixVariableResolver { get; set; } | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/src/WixToolset.Extensibility/IResolverExtension.cs b/src/WixToolset.Extensibility/IResolverExtension.cs new file mode 100644 index 00000000..b0478ff0 --- /dev/null +++ b/src/WixToolset.Extensibility/IResolverExtension.cs | |||
| @@ -0,0 +1,25 @@ | |||
| 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 | using WixToolset.Data.Bind; | ||
| 7 | |||
| 8 | /// <summary> | ||
| 9 | /// Interface all resolver extensions implement. | ||
| 10 | /// </summary> | ||
| 11 | public interface IResolverExtension | ||
| 12 | { | ||
| 13 | /// <summary> | ||
| 14 | /// Called before resolving occurs. | ||
| 15 | /// </summary> | ||
| 16 | void PreResolve(IResolveContext context); | ||
| 17 | |||
| 18 | string ResolveFile(string source, IntermediateTupleDefinition tupleDefinition, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
| 19 | |||
| 20 | /// <summary> | ||
| 21 | /// Called after all resolving occurs. | ||
| 22 | /// </summary> | ||
| 23 | void PostResolve(ResolveResult result); | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/src/WixToolset.Extensibility/ResolveResult.cs b/src/WixToolset.Extensibility/ResolveResult.cs new file mode 100644 index 00000000..14073ab0 --- /dev/null +++ b/src/WixToolset.Extensibility/ResolveResult.cs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 System.Collections.Generic; | ||
| 6 | using WixToolset.Data; | ||
| 7 | |||
| 8 | public class ResolveResult | ||
| 9 | { | ||
| 10 | public int Codepage { get; set; } | ||
| 11 | |||
| 12 | public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | ||
| 13 | |||
| 14 | public IEnumerable<IDelayedField> DelayedFields { get; set; } | ||
| 15 | |||
| 16 | public Intermediate IntermediateRepresentation { get; set; } | ||
| 17 | } | ||
| 18 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Extensibility/Services/BindVariableResolution.cs b/src/WixToolset.Extensibility/Services/BindVariableResolution.cs new file mode 100644 index 00000000..cdd1fa19 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/BindVariableResolution.cs | |||
| @@ -0,0 +1,27 @@ | |||
| 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.Services | ||
| 4 | { | ||
| 5 | public class BindVariableResolution | ||
| 6 | { | ||
| 7 | /// <summary> | ||
| 8 | /// Indicates whether the variable should be delay resolved. | ||
| 9 | /// </summary> | ||
| 10 | public bool DelayedResolve { get; set; } | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// Indicates whether the value is the default value of the variable. | ||
| 14 | /// </summary> | ||
| 15 | public bool IsDefault { get; set; } | ||
| 16 | |||
| 17 | /// <summary> | ||
| 18 | /// Indicates whether the value changed. | ||
| 19 | /// </summary> | ||
| 20 | public bool UpdatedValue { get; set; } | ||
| 21 | |||
| 22 | /// <summary> | ||
| 23 | /// Resolved value. | ||
| 24 | /// </summary> | ||
| 25 | public string Value { get; set; } | ||
| 26 | } | ||
| 27 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs b/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs new file mode 100644 index 00000000..50071658 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs | |||
| @@ -0,0 +1,17 @@ | |||
| 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.Services | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | |||
| 7 | public interface IBindVariableResolver | ||
| 8 | { | ||
| 9 | int VariableCount { get; } | ||
| 10 | |||
| 11 | void AddVariable(string name, string value, bool overridable); | ||
| 12 | |||
| 13 | BindVariableResolution ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly); | ||
| 14 | |||
| 15 | bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl); | ||
| 16 | } | ||
| 17 | } | ||
