From 7efd412cda00b369bc331c9bedd8db971d98fee7 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 18 Oct 2017 15:21:45 -0700 Subject: Incorporate refactoring of WixToolset.Core assemblies --- src/WixToolset.Extensibility/AssemblyInfo.cs | 2 +- src/WixToolset.Extensibility/BindPath.cs | 52 ------------------- src/WixToolset.Extensibility/BindStage.cs | 27 ---------- src/WixToolset.Extensibility/BinderExtension.cs | 40 --------------- .../BinderExtensionBase.cs | 55 ++++++++++++++++++++ src/WixToolset.Extensibility/IBackend.cs | 17 +++++++ src/WixToolset.Extensibility/IBackendFactory.cs | 11 ++++ .../IBindVariableResolver.cs | 26 ++++++++++ src/WixToolset.Extensibility/IBinderExtension.cs | 20 +++++--- src/WixToolset.Extensibility/IBinderFileManager.cs | 29 ----------- .../IBinderFileManagerCore.cs | 1 + .../IBurnBackendExtension.cs | 25 +++++++++ src/WixToolset.Extensibility/IDelayedField.cs | 13 +++++ .../IExpectedExtractFile.cs | 15 ++++++ src/WixToolset.Extensibility/IInscribeContext.cs | 22 ++++++++ .../ILibrarianExtension.cs | 15 ++++++ src/WixToolset.Extensibility/ILibraryContext.cs | 20 ++++++++ src/WixToolset.Extensibility/ILocalizer.cs | 15 ++++++ src/WixToolset.Extensibility/IUnbindContext.cs | 23 +++++++++ .../IWindowsInstallerBackendExtension.cs | 29 +++++++++++ src/WixToolset.Extensibility/Identifier.cs | 31 ------------ .../Services/IBindContext.cs | 59 ++++++++++++++++++++++ .../Services/ICommandLine.cs | 9 ++++ .../Services/ICommandLineCommand.cs | 9 ++++ .../Services/ICommandLineContext.cs | 20 ++++++++ .../Services/IExtensionManager.cs | 16 ++++++ .../Services/ServiceProviderExtensions.cs | 14 +++++ 27 files changed, 427 insertions(+), 188 deletions(-) delete mode 100644 src/WixToolset.Extensibility/BindPath.cs delete mode 100644 src/WixToolset.Extensibility/BindStage.cs delete mode 100644 src/WixToolset.Extensibility/BinderExtension.cs create mode 100644 src/WixToolset.Extensibility/BinderExtensionBase.cs create mode 100644 src/WixToolset.Extensibility/IBackend.cs create mode 100644 src/WixToolset.Extensibility/IBackendFactory.cs create mode 100644 src/WixToolset.Extensibility/IBindVariableResolver.cs delete mode 100644 src/WixToolset.Extensibility/IBinderFileManager.cs create mode 100644 src/WixToolset.Extensibility/IBurnBackendExtension.cs create mode 100644 src/WixToolset.Extensibility/IDelayedField.cs create mode 100644 src/WixToolset.Extensibility/IExpectedExtractFile.cs create mode 100644 src/WixToolset.Extensibility/IInscribeContext.cs create mode 100644 src/WixToolset.Extensibility/ILibrarianExtension.cs create mode 100644 src/WixToolset.Extensibility/ILibraryContext.cs create mode 100644 src/WixToolset.Extensibility/ILocalizer.cs create mode 100644 src/WixToolset.Extensibility/IUnbindContext.cs create mode 100644 src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs delete mode 100644 src/WixToolset.Extensibility/Identifier.cs create mode 100644 src/WixToolset.Extensibility/Services/IBindContext.cs create mode 100644 src/WixToolset.Extensibility/Services/ICommandLine.cs create mode 100644 src/WixToolset.Extensibility/Services/ICommandLineCommand.cs create mode 100644 src/WixToolset.Extensibility/Services/ICommandLineContext.cs create mode 100644 src/WixToolset.Extensibility/Services/IExtensionManager.cs create mode 100644 src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs (limited to 'src') diff --git a/src/WixToolset.Extensibility/AssemblyInfo.cs b/src/WixToolset.Extensibility/AssemblyInfo.cs index 6512230a..b3740b2a 100644 --- a/src/WixToolset.Extensibility/AssemblyInfo.cs +++ b/src/WixToolset.Extensibility/AssemblyInfo.cs @@ -5,5 +5,5 @@ using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCulture("")] -[assembly:CLSCompliant(true)] +[assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/WixToolset.Extensibility/BindPath.cs b/src/WixToolset.Extensibility/BindPath.cs deleted file mode 100644 index 236ee4ec..00000000 --- a/src/WixToolset.Extensibility/BindPath.cs +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -namespace WixToolset.Extensibility -{ - using System; - - /// - /// Bind path representation. - /// - public class BindPath - { - /// - /// Creates an unnamed bind path. - /// - /// Path for the bind path. - public BindPath(string path) : this(String.Empty, path) - { - } - - /// - /// Creates a named bind path. - /// - /// Name of the bind path. - /// Path for the bind path. - public BindPath(string name, string path) - { - this.Name = name; - this.Path = path; - } - - /// - /// Parses a bind path from its string representation - /// - /// String representation of bind path that looks like: [name=]path - /// Parsed bind path. - public static BindPath Parse(string bindPath) - { - string[] namedPath = bindPath.Split(new char[] { '=' }, 2); - return (1 == namedPath.Length) ? new BindPath(namedPath[0]) : new BindPath(namedPath[0], namedPath[1]); - } - - /// - /// Name of the bind path or String.Empty if the path is unnamed. - /// - public string Name { get; set; } - - /// - /// Path for the bind path. - /// - public string Path { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/BindStage.cs b/src/WixToolset.Extensibility/BindStage.cs deleted file mode 100644 index 71ac5616..00000000 --- a/src/WixToolset.Extensibility/BindStage.cs +++ /dev/null @@ -1,27 +0,0 @@ -// 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. - -namespace WixToolset.Extensibility -{ - /// - /// Bind stage of a file.. The reason we need this is to change the ResolveFile behavior based on if - /// dynamic bindpath plugin is desirable. We cannot change the signature of ResolveFile since it might - /// break existing implementers which derived from BinderFileManager - /// - public enum BindStage - { - /// - /// Normal binding - /// - Normal, - - /// - /// Bind the file path of the target build file - /// - Target, - - /// - /// Bind the file path of the updated build file - /// - Updated, - } -} diff --git a/src/WixToolset.Extensibility/BinderExtension.cs b/src/WixToolset.Extensibility/BinderExtension.cs deleted file mode 100644 index c6ccb3c2..00000000 --- a/src/WixToolset.Extensibility/BinderExtension.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -namespace WixToolset.Extensibility -{ - using WixToolset.Data; - - /// - /// Base class for creating an binder extension. - /// - public abstract class BinderExtension : IBinderExtension - { - /// - /// Gets or sets the binder core for the extension. - /// - /// Binder core for the extension. - public IBinderCore Core { get; set; } - - - /// - /// Called before binding occurs. - /// - public virtual void Initialize(Output output) - { - } - - /// - /// Called after variable resolution occurs. - /// - public virtual void AfterResolvedFields(Output output) - { - } - - /// - /// Called after all output changes occur and right before the output is bound into its final format. - /// - public virtual void Finish(Output output) - { - } - } -} diff --git a/src/WixToolset.Extensibility/BinderExtensionBase.cs b/src/WixToolset.Extensibility/BinderExtensionBase.cs new file mode 100644 index 00000000..a0b34a31 --- /dev/null +++ b/src/WixToolset.Extensibility/BinderExtensionBase.cs @@ -0,0 +1,55 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + using WixToolset.Data.Bind; + using WixToolset.Extensibility.Services; + + public abstract class BinderExtensionBase : IBinderExtension + { + protected IBindContext Context { get; private set; } + + /// + /// Called before binding occurs. + /// + public virtual void PreBind(IBindContext context) + { + this.Context = context; + } + + /// + /// Called after variable resolution occurs. + /// + public virtual void AfterResolvedFields(Output output) + { + } + + public virtual string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage) + { + return null; + } + + public virtual bool? CompareFiles(string targetFile, string updatedFile) + { + return null; + } + + public virtual bool CopyFile(string source, string destination, bool overwrite) + { + return false; + } + + public virtual bool MoveFile(string source, string destination, bool overwrite) + { + return false; + } + + /// + /// Called after binding is complete before the files are moved to their final locations. + /// + public virtual void PostBind(BindResult result) + { + } + } +} diff --git a/src/WixToolset.Extensibility/IBackend.cs b/src/WixToolset.Extensibility/IBackend.cs new file mode 100644 index 00000000..e38de544 --- /dev/null +++ b/src/WixToolset.Extensibility/IBackend.cs @@ -0,0 +1,17 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + using WixToolset.Data.Bind; + using WixToolset.Extensibility.Services; + + public interface IBackend + { + BindResult Bind(IBindContext context); + + Output Unbind(IUnbindContext context); + + bool Inscribe(IInscribeContext context); + } +} diff --git a/src/WixToolset.Extensibility/IBackendFactory.cs b/src/WixToolset.Extensibility/IBackendFactory.cs new file mode 100644 index 00000000..12704c0f --- /dev/null +++ b/src/WixToolset.Extensibility/IBackendFactory.cs @@ -0,0 +1,11 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Extensibility.Services; + + public interface IBackendFactory + { + bool TryCreateBackend(string outputType, string outputPath, IBindContext context, out IBackend backend); + } +} diff --git a/src/WixToolset.Extensibility/IBindVariableResolver.cs b/src/WixToolset.Extensibility/IBindVariableResolver.cs new file mode 100644 index 00000000..4c2c3003 --- /dev/null +++ b/src/WixToolset.Extensibility/IBindVariableResolver.cs @@ -0,0 +1,26 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + using WixToolset.Data.Rows; + + public interface IBindVariableResolver + { + int VariableCount { get; } + + void AddVariable(string name, string value); + + void AddVariable(WixVariableRow wixVariableRow); + + string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly); + + string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, bool errorOnUnknown, out bool isDefault, out bool delayedResolve); + + string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault); + + string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault, out bool delayedResolve); + + bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl); + } +} diff --git a/src/WixToolset.Extensibility/IBinderExtension.cs b/src/WixToolset.Extensibility/IBinderExtension.cs index 19790b14..9673d60e 100644 --- a/src/WixToolset.Extensibility/IBinderExtension.cs +++ b/src/WixToolset.Extensibility/IBinderExtension.cs @@ -3,31 +3,35 @@ namespace WixToolset.Extensibility { using WixToolset.Data; + using WixToolset.Data.Bind; + using WixToolset.Extensibility.Services; /// /// Interface all binder extensions implement. /// public interface IBinderExtension { - /// - /// Gets or sets the binder core for the extension. - /// - /// Binder core for the extension. - IBinderCore Core { get; set; } - /// /// Called before binding occurs. /// - void Initialize(Output output); + void PreBind(IBindContext context); /// /// Called after variable resolution occurs. /// void AfterResolvedFields(Output output); + string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); + + bool? CompareFiles(string targetFile, string updatedFile); + + bool CopyFile(string source, string destination, bool overwrite); + + bool MoveFile(string source, string destination, bool overwrite); + /// /// Called after all output changes occur and right before the output is bound into its final format. /// - void Finish(Output output); + void PostBind(BindResult result); } } diff --git a/src/WixToolset.Extensibility/IBinderFileManager.cs b/src/WixToolset.Extensibility/IBinderFileManager.cs deleted file mode 100644 index 3a2b1d40..00000000 --- a/src/WixToolset.Extensibility/IBinderFileManager.cs +++ /dev/null @@ -1,29 +0,0 @@ -// 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. - -namespace WixToolset.Extensibility -{ - using System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Data.Rows; - - public interface IBinderFileManager - { - IBinderFileManagerCore Core { set; } - - ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable files); - - string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); - - string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); - - string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory); - - string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); - - bool? CompareFiles(string targetFile, string updatedFile); - - bool CopyFile(string source, string destination, bool overwrite); - - bool MoveFile(string source, string destination, bool overwrite); - } -} diff --git a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs b/src/WixToolset.Extensibility/IBinderFileManagerCore.cs index f5adf4e1..c6d46e11 100644 --- a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs +++ b/src/WixToolset.Extensibility/IBinderFileManagerCore.cs @@ -4,6 +4,7 @@ namespace WixToolset.Extensibility { using System.Collections.Generic; using WixToolset.Data; + using WixToolset.Data.Bind; public interface IBinderFileManagerCore : IMessageHandler { diff --git a/src/WixToolset.Extensibility/IBurnBackendExtension.cs b/src/WixToolset.Extensibility/IBurnBackendExtension.cs new file mode 100644 index 00000000..c8b8e407 --- /dev/null +++ b/src/WixToolset.Extensibility/IBurnBackendExtension.cs @@ -0,0 +1,25 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + using WixToolset.Data.Bind; + using WixToolset.Extensibility.Services; + + public interface IBurnBackendExtension + { + /// + /// Called before binding occurs. + /// + void PreBackendBind(IBindContext context); + + string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); + + string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); + + /// + /// Called after all output changes occur and right before the output is bound into its final format. + /// + void PostBackendBind(BindResult result); + } +} diff --git a/src/WixToolset.Extensibility/IDelayedField.cs b/src/WixToolset.Extensibility/IDelayedField.cs new file mode 100644 index 00000000..a6cc7a2e --- /dev/null +++ b/src/WixToolset.Extensibility/IDelayedField.cs @@ -0,0 +1,13 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + + public interface IDelayedField + { + Field Field { get; } + + Row Row { get; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/IExpectedExtractFile.cs b/src/WixToolset.Extensibility/IExpectedExtractFile.cs new file mode 100644 index 00000000..06e4f77f --- /dev/null +++ b/src/WixToolset.Extensibility/IExpectedExtractFile.cs @@ -0,0 +1,15 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using System; + + public interface IExpectedExtractFile + { + Uri Uri { get; set; } + + int EmbeddedFileIndex { get; set; } + + string OutputPath { get; set; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/IInscribeContext.cs b/src/WixToolset.Extensibility/IInscribeContext.cs new file mode 100644 index 00000000..6294271e --- /dev/null +++ b/src/WixToolset.Extensibility/IInscribeContext.cs @@ -0,0 +1,22 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using System; + using WixToolset.Data; + + public interface IInscribeContext + { + IServiceProvider ServiceProvider { get; } + + string InputFilePath { get; set; } + + string IntermediateFolder { get; set; } + + Messaging Messaging { get; } + + string OutputFile { get; set; } + + string SignedEngineFile { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/ILibrarianExtension.cs b/src/WixToolset.Extensibility/ILibrarianExtension.cs new file mode 100644 index 00000000..08d37607 --- /dev/null +++ b/src/WixToolset.Extensibility/ILibrarianExtension.cs @@ -0,0 +1,15 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + + public interface ILibrarianExtension + { + void PreCombine(ILibraryContext context); + + string Resolve(SourceLineNumber sourceLineNumber, string table, string path); + + void PostCombine(Library library); + } +} diff --git a/src/WixToolset.Extensibility/ILibraryContext.cs b/src/WixToolset.Extensibility/ILibraryContext.cs new file mode 100644 index 00000000..4e13696b --- /dev/null +++ b/src/WixToolset.Extensibility/ILibraryContext.cs @@ -0,0 +1,20 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using System.Collections.Generic; + using WixToolset.Data; + + public interface ILibraryContext + { + bool BindFiles { get; set; } + + IEnumerable Extensions { get; set; } + + IEnumerable Localizations { get; set; } + + IEnumerable
Sections { get; set; } + + IBindVariableResolver WixVariableResolver { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/ILocalizer.cs b/src/WixToolset.Extensibility/ILocalizer.cs new file mode 100644 index 00000000..3ce29aab --- /dev/null +++ b/src/WixToolset.Extensibility/ILocalizer.cs @@ -0,0 +1,15 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + + public interface ILocalizer + { + int Codepage { get; } + + string GetLocalizedValue(string id); + + LocalizedControl GetLocalizedControl(string dialog, string control); + } +} diff --git a/src/WixToolset.Extensibility/IUnbindContext.cs b/src/WixToolset.Extensibility/IUnbindContext.cs new file mode 100644 index 00000000..82364652 --- /dev/null +++ b/src/WixToolset.Extensibility/IUnbindContext.cs @@ -0,0 +1,23 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using WixToolset.Data; + + public interface IUnbindContext + { + string ExportBasePath { get; set; } + + string InputFilePath { get; set; } + + string IntermediateFolder { get; set; } + + bool IsAdminImage { get; set; } + + Messaging Messaging { get; } + + bool SuppressDemodularization { get; set; } + + bool SuppressExtractCabinets { get; set; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs b/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs new file mode 100644 index 00000000..3b01cc0d --- /dev/null +++ b/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs @@ -0,0 +1,29 @@ +// 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. + +namespace WixToolset.Extensibility +{ + using System.Collections.Generic; + using WixToolset.Data.Rows; + using WixToolset.Data.Bind; + using WixToolset.Extensibility.Services; + + /// + /// Interface all binder extensions implement. + /// + public interface IWindowsInstallerBackendExtension + { + /// + /// Called before binding occurs. + /// + void PreBackendBind(IBindContext context); + + ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable files); + + string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory); + + /// + /// Called after all output changes occur and right before the output is bound into its final format. + /// + void PostBackendBind(BindResult result); + } +} diff --git a/src/WixToolset.Extensibility/Identifier.cs b/src/WixToolset.Extensibility/Identifier.cs deleted file mode 100644 index 628cd335..00000000 --- a/src/WixToolset.Extensibility/Identifier.cs +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -namespace WixToolset.Extensibility -{ - using System; - using WixToolset.Data; - - /// - /// Class to define the identifier and access for a row. - /// - public class Identifier - { - public static Identifier Invalid = new Identifier(null, AccessModifier.Private); - - public Identifier(string id, AccessModifier access) - { - this.Id = id; - this.Access = access; - } - - /// - /// Access modifier for a row. - /// - public AccessModifier Access { get; private set; } - - /// - /// Identifier for the row. - /// - public string Id { get; private set; } - } -} diff --git a/src/WixToolset.Extensibility/Services/IBindContext.cs b/src/WixToolset.Extensibility/Services/IBindContext.cs new file mode 100644 index 00000000..ce78709b --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IBindContext.cs @@ -0,0 +1,59 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + + public interface IBindContext + { + IServiceProvider ServiceProvider { get; } + + Messaging Messaging { get; set; } + + IEnumerable BindPaths { get; set; } + + int CabbingThreadCount { get; set; } + + string CabCachePath { get; set; } + + int Codepage { get; set; } + + CompressionLevel DefaultCompressionLevel { get; set; } + + IEnumerable DelayedFields { get; set; } + + IEnumerable ExpectedEmbeddedFiles { get; set; } + + IExtensionManager ExtensionManager { get; set; } + + IEnumerable Extensions { get; set; } + + IEnumerable Ices { get; set; } + + string IntermediateFolder { get; set; } + + Output IntermediateRepresentation { get; set; } + + string OutputPath { get; set; } + + string OutputPdbPath { get; set; } + + bool SuppressAclReset { get; set; } + + IEnumerable SuppressIces { get; set; } + + bool SuppressValidation { get; set; } + + IBindVariableResolver WixVariableResolver { get; set; } + + string ContentsFile { get; set; } + + string OutputsFile { get; set; } + + string BuiltOutputsFile { get; set; } + + string WixprojectFile { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Services/ICommandLine.cs b/src/WixToolset.Extensibility/Services/ICommandLine.cs new file mode 100644 index 00000000..9dd247ff --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLine.cs @@ -0,0 +1,9 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + public interface ICommandLine + { + ICommandLineCommand ParseStandardCommandLine(ICommandLineContext commandLineContext); + } +} diff --git a/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs b/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs new file mode 100644 index 00000000..f2333c55 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs @@ -0,0 +1,9 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + public interface ICommandLineCommand + { + int Execute(); + } +} diff --git a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs new file mode 100644 index 00000000..0e040d7f --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs @@ -0,0 +1,20 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + using System; + using WixToolset.Data; + + public interface ICommandLineContext + { + IServiceProvider ServiceProvider { get; } + + Messaging Messaging { get; set; } + + IExtensionManager ExtensionManager { get; set; } + + string Arguments { get; set; } + + string[] ParsedArguments { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Services/IExtensionManager.cs b/src/WixToolset.Extensibility/Services/IExtensionManager.cs new file mode 100644 index 00000000..1d693ee4 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IExtensionManager.cs @@ -0,0 +1,16 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + using System.Collections.Generic; + using System.Reflection; + + public interface IExtensionManager + { + Assembly Add(Assembly assembly); + + Assembly Load(string extension); + + IEnumerable Create() where T : class; + } +} diff --git a/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs new file mode 100644 index 00000000..f4a5e8c3 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs @@ -0,0 +1,14 @@ +// 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. + +namespace WixToolset.Extensibility.Services +{ + using System; + + public static class ServiceProviderExtensions + { + public static T GetService(this IServiceProvider serviceProvider) where T : class + { + return (T)serviceProvider.GetService(typeof(T)); + } + } +} -- cgit v1.2.3-55-g6feb