From e130a7a296696e3a7b1229cf580de393b3f20cbd Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 23 Jul 2018 13:46:09 -0700 Subject: Reorganize data into Extensibility.Data namespace --- .../BaseBinderExtension.cs | 2 +- .../BaseCompilerExtension.cs | 3 +- .../BaseLayoutExtension.cs | 10 ++ .../BasePreprocessorExtension.cs | 8 ++ .../BaseResolverExtension.cs | 10 +- .../BaseWindowsInstallerBackendExtension.cs | 9 +- src/WixToolset.Extensibility/BindFileWithPath.cs | 20 ---- src/WixToolset.Extensibility/CabinetBuildOption.cs | 25 ----- src/WixToolset.Extensibility/ComponentKeyPath.cs | 55 ---------- .../Data/BindFileWithPath.cs | 20 ++++ src/WixToolset.Extensibility/Data/BindPath.cs | 59 +++++++++++ src/WixToolset.Extensibility/Data/BindResult.cs | 13 +++ src/WixToolset.Extensibility/Data/BindStage.cs | 22 ++++ .../Data/CabinetBuildOption.cs | 25 +++++ .../Data/ComponentKeyPath.cs | 55 ++++++++++ .../Data/ExtensionCommandLineSwitch.cs | 14 +++ src/WixToolset.Extensibility/Data/FileTransfer.cs | 114 +++++++++++++++++++++ src/WixToolset.Extensibility/Data/IBindContext.cs | 43 ++++++++ .../Data/ICommandLineArguments.cs | 23 +++++ .../Data/ICommandLineCommand.cs | 9 ++ .../Data/ICommandLineContext.cs | 16 +++ .../Data/ICompileContext.cs | 28 +++++ src/WixToolset.Extensibility/Data/IDelayedField.cs | 13 +++ .../Data/IExpectedExtractFile.cs | 15 +++ .../Data/IFileSystemContext.cs | 22 ++++ .../Data/IInscribeContext.cs | 19 ++++ .../Data/ILayoutContext.cs | 26 +++++ .../Data/ILibraryContext.cs | 25 +++++ src/WixToolset.Extensibility/Data/ILinkContext.cs | 23 +++++ .../Data/IPreprocessContext.cs | 29 ++++++ .../Data/IResolveContext.cs | 30 ++++++ .../Data/IUnbindContext.cs | 23 +++++ src/WixToolset.Extensibility/Data/ResolveResult.cs | 18 ++++ .../Data/ResolvedCabinet.cs | 20 ++++ src/WixToolset.Extensibility/IBackend.cs | 2 +- src/WixToolset.Extensibility/IBackendFactory.cs | 2 +- src/WixToolset.Extensibility/IBindContext.cs | 46 --------- src/WixToolset.Extensibility/IBindExtension.cs | 1 + .../IBurnBackendExtension.cs | 2 +- src/WixToolset.Extensibility/ICompileContext.cs | 31 ------ src/WixToolset.Extensibility/ICompilerExtension.cs | 1 + .../IDecompilerExtension.cs | 2 - src/WixToolset.Extensibility/IDelayedField.cs | 13 --- .../IExpectedExtractFile.cs | 15 --- .../IExtensionCommandLine.cs | 11 +- src/WixToolset.Extensibility/IFileSystemContext.cs | 25 ----- .../IFileSystemExtension.cs | 2 + src/WixToolset.Extensibility/IInscribeContext.cs | 22 ---- src/WixToolset.Extensibility/ILayoutContext.cs | 32 ------ src/WixToolset.Extensibility/ILayoutExtension.cs | 2 + .../ILibrarianExtension.cs | 1 + src/WixToolset.Extensibility/ILibraryContext.cs | 28 ----- src/WixToolset.Extensibility/ILinkContext.cs | 26 ----- src/WixToolset.Extensibility/ILinkerExtension.cs | 2 +- src/WixToolset.Extensibility/IPreprocessContext.cs | 32 ------ .../IPreprocessorExtension.cs | 1 + src/WixToolset.Extensibility/IResolveContext.cs | 32 ------ src/WixToolset.Extensibility/IResolverExtension.cs | 2 +- src/WixToolset.Extensibility/IUnbindContext.cs | 26 ----- .../IWindowsInstallerBackendExtension.cs | 1 + src/WixToolset.Extensibility/ResolveResult.cs | 18 ---- src/WixToolset.Extensibility/ResolvedCabinet.cs | 20 ---- .../ServiceProviderExtensions.cs | 14 --- .../Services/ICommandLine.cs | 8 +- .../Services/ICommandLineArguments.cs | 23 ----- .../Services/ICommandLineCommand.cs | 9 -- .../Services/ICommandLineContext.cs | 17 --- .../Services/IParseHelper.cs | 1 + .../Services/IPreprocessHelper.cs | 1 + .../Services/ServiceProviderExtensions.cs | 14 +++ .../WixToolset.Extensibility.csproj | 2 +- 71 files changed, 781 insertions(+), 552 deletions(-) delete mode 100644 src/WixToolset.Extensibility/BindFileWithPath.cs delete mode 100644 src/WixToolset.Extensibility/CabinetBuildOption.cs delete mode 100644 src/WixToolset.Extensibility/ComponentKeyPath.cs create mode 100644 src/WixToolset.Extensibility/Data/BindFileWithPath.cs create mode 100644 src/WixToolset.Extensibility/Data/BindPath.cs create mode 100644 src/WixToolset.Extensibility/Data/BindResult.cs create mode 100644 src/WixToolset.Extensibility/Data/BindStage.cs create mode 100644 src/WixToolset.Extensibility/Data/CabinetBuildOption.cs create mode 100644 src/WixToolset.Extensibility/Data/ComponentKeyPath.cs create mode 100644 src/WixToolset.Extensibility/Data/ExtensionCommandLineSwitch.cs create mode 100644 src/WixToolset.Extensibility/Data/FileTransfer.cs create mode 100644 src/WixToolset.Extensibility/Data/IBindContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ICommandLineArguments.cs create mode 100644 src/WixToolset.Extensibility/Data/ICommandLineCommand.cs create mode 100644 src/WixToolset.Extensibility/Data/ICommandLineContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ICompileContext.cs create mode 100644 src/WixToolset.Extensibility/Data/IDelayedField.cs create mode 100644 src/WixToolset.Extensibility/Data/IExpectedExtractFile.cs create mode 100644 src/WixToolset.Extensibility/Data/IFileSystemContext.cs create mode 100644 src/WixToolset.Extensibility/Data/IInscribeContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ILayoutContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ILibraryContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ILinkContext.cs create mode 100644 src/WixToolset.Extensibility/Data/IPreprocessContext.cs create mode 100644 src/WixToolset.Extensibility/Data/IResolveContext.cs create mode 100644 src/WixToolset.Extensibility/Data/IUnbindContext.cs create mode 100644 src/WixToolset.Extensibility/Data/ResolveResult.cs create mode 100644 src/WixToolset.Extensibility/Data/ResolvedCabinet.cs delete mode 100644 src/WixToolset.Extensibility/IBindContext.cs delete mode 100644 src/WixToolset.Extensibility/ICompileContext.cs delete mode 100644 src/WixToolset.Extensibility/IDelayedField.cs delete mode 100644 src/WixToolset.Extensibility/IExpectedExtractFile.cs delete mode 100644 src/WixToolset.Extensibility/IFileSystemContext.cs delete mode 100644 src/WixToolset.Extensibility/IInscribeContext.cs delete mode 100644 src/WixToolset.Extensibility/ILayoutContext.cs delete mode 100644 src/WixToolset.Extensibility/ILibraryContext.cs delete mode 100644 src/WixToolset.Extensibility/ILinkContext.cs delete mode 100644 src/WixToolset.Extensibility/IPreprocessContext.cs delete mode 100644 src/WixToolset.Extensibility/IResolveContext.cs delete mode 100644 src/WixToolset.Extensibility/IUnbindContext.cs delete mode 100644 src/WixToolset.Extensibility/ResolveResult.cs delete mode 100644 src/WixToolset.Extensibility/ResolvedCabinet.cs delete mode 100644 src/WixToolset.Extensibility/ServiceProviderExtensions.cs delete mode 100644 src/WixToolset.Extensibility/Services/ICommandLineArguments.cs delete mode 100644 src/WixToolset.Extensibility/Services/ICommandLineCommand.cs delete mode 100644 src/WixToolset.Extensibility/Services/ICommandLineContext.cs create mode 100644 src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs (limited to 'src') diff --git a/src/WixToolset.Extensibility/BaseBinderExtension.cs b/src/WixToolset.Extensibility/BaseBinderExtension.cs index e5e38793..51d63694 100644 --- a/src/WixToolset.Extensibility/BaseBinderExtension.cs +++ b/src/WixToolset.Extensibility/BaseBinderExtension.cs @@ -2,7 +2,7 @@ namespace WixToolset.Extensibility { - using WixToolset.Data.Bind; + using WixToolset.Extensibility.Data; /// /// Base class for creating a resolver extension. diff --git a/src/WixToolset.Extensibility/BaseCompilerExtension.cs b/src/WixToolset.Extensibility/BaseCompilerExtension.cs index abe2f4a9..e1584bc3 100644 --- a/src/WixToolset.Extensibility/BaseCompilerExtension.cs +++ b/src/WixToolset.Extensibility/BaseCompilerExtension.cs @@ -5,6 +5,7 @@ namespace WixToolset.Extensibility using System.Collections.Generic; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -40,7 +41,7 @@ namespace WixToolset.Extensibility { this.Context = context; - this.Messaging = context.Messaging; + this.Messaging = context.ServiceProvider.GetService(); this.ParseHelper = context.ServiceProvider.GetService(); } diff --git a/src/WixToolset.Extensibility/BaseLayoutExtension.cs b/src/WixToolset.Extensibility/BaseLayoutExtension.cs index bc80d432..78ec8d0a 100644 --- a/src/WixToolset.Extensibility/BaseLayoutExtension.cs +++ b/src/WixToolset.Extensibility/BaseLayoutExtension.cs @@ -2,6 +2,9 @@ namespace WixToolset.Extensibility { + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + /// /// Base class for creating a resolver extension. /// @@ -12,12 +15,19 @@ namespace WixToolset.Extensibility /// protected ILayoutContext Context { get; private set; } + /// + /// Messaging for use by the extension. + /// + protected IMessaging Messaging { get; private set; } + /// /// Called at the beginning of layout. /// public virtual void PreLayout(ILayoutContext context) { this.Context = context; + + this.Messaging = context.ServiceProvider.GetService(); } public virtual bool CopyFile(string source, string destination) diff --git a/src/WixToolset.Extensibility/BasePreprocessorExtension.cs b/src/WixToolset.Extensibility/BasePreprocessorExtension.cs index f5d89103..b7d29095 100644 --- a/src/WixToolset.Extensibility/BasePreprocessorExtension.cs +++ b/src/WixToolset.Extensibility/BasePreprocessorExtension.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility { using System.Xml.Linq; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -15,6 +16,11 @@ namespace WixToolset.Extensibility /// protected IPreprocessContext Context { get; private set; } + /// + /// Messaging for use by the extension. + /// + protected IMessaging Messaging { get; private set; } + /// /// PreprocessHelper for use by the extension. /// @@ -33,6 +39,8 @@ namespace WixToolset.Extensibility { this.Context = context; + this.Messaging = context.ServiceProvider.GetService(); + this.PreprocessHelper = context.ServiceProvider.GetService(); } diff --git a/src/WixToolset.Extensibility/BaseResolverExtension.cs b/src/WixToolset.Extensibility/BaseResolverExtension.cs index 9498d126..16219e93 100644 --- a/src/WixToolset.Extensibility/BaseResolverExtension.cs +++ b/src/WixToolset.Extensibility/BaseResolverExtension.cs @@ -3,7 +3,8 @@ namespace WixToolset.Extensibility { using WixToolset.Data; - using WixToolset.Data.Bind; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; /// /// Base class for creating a resolver extension. @@ -15,12 +16,19 @@ namespace WixToolset.Extensibility /// protected IResolveContext Context { get; private set; } + /// + /// Messaging for use by the extension. + /// + protected IMessaging Messaging { get; private set; } + /// /// Called at the beginning of the resolving variables and files. /// public virtual void PreResolve(IResolveContext context) { this.Context = context; + + this.Messaging = context.ServiceProvider.GetService(); } public virtual string ResolveFile(string source, IntermediateTupleDefinition tupleDefinition, SourceLineNumber sourceLineNumbers, BindStage bindStage) diff --git a/src/WixToolset.Extensibility/BaseWindowsInstallerBackendExtension.cs b/src/WixToolset.Extensibility/BaseWindowsInstallerBackendExtension.cs index 28f3f927..4393dfda 100644 --- a/src/WixToolset.Extensibility/BaseWindowsInstallerBackendExtension.cs +++ b/src/WixToolset.Extensibility/BaseWindowsInstallerBackendExtension.cs @@ -4,9 +4,9 @@ namespace WixToolset.Extensibility { using System.Collections.Generic; using WixToolset.Data; - using WixToolset.Data.Bind; using WixToolset.Data.Tuples; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -19,6 +19,11 @@ namespace WixToolset.Extensibility /// protected IBindContext Context { get; private set; } + /// + /// Messaging for use by the extension. + /// + protected IMessaging Messaging { get; private set; } + /// /// Backend helper for use by the extension. /// @@ -33,6 +38,8 @@ namespace WixToolset.Extensibility { this.Context = context; + this.Messaging = context.ServiceProvider.GetService(); + this.BackendHelper = context.ServiceProvider.GetService(); } diff --git a/src/WixToolset.Extensibility/BindFileWithPath.cs b/src/WixToolset.Extensibility/BindFileWithPath.cs deleted file mode 100644 index f07873fc..00000000 --- a/src/WixToolset.Extensibility/BindFileWithPath.cs +++ /dev/null @@ -1,20 +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 file with its path. - /// - public class BindFileWithPath - { - /// - /// Gets or sets the identifier of the file with this path. - /// - public string Id { get; set; } - - /// - /// Gets or sets the file path. - /// - public string Path { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/CabinetBuildOption.cs b/src/WixToolset.Extensibility/CabinetBuildOption.cs deleted file mode 100644 index 6f63131c..00000000 --- a/src/WixToolset.Extensibility/CabinetBuildOption.cs +++ /dev/null @@ -1,25 +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 -{ - /// - /// Options for building the cabinet. - /// - public enum CabinetBuildOption - { - /// - /// Build the cabinet and move it to the target location. - /// - BuildAndMove, - - /// - /// Build the cabinet and copy it to the target location. - /// - BuildAndCopy, - - /// - /// Just copy the cabinet to the target location. - /// - Copy - } -} diff --git a/src/WixToolset.Extensibility/ComponentKeyPath.cs b/src/WixToolset.Extensibility/ComponentKeyPath.cs deleted file mode 100644 index 15cbb02f..00000000 --- a/src/WixToolset.Extensibility/ComponentKeyPath.cs +++ /dev/null @@ -1,55 +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 -{ - public enum ComponentKeyPathType - { - /// - /// Not a key path. - /// - None, - - /// - /// File resource as a key path. - /// - File, - - /// - /// Folder as a key path. - /// - Directory, - - /// - /// ODBC data source as a key path. - /// - OdbcDataSource, - - /// - /// A simple registry key acting as a key path. - /// - Registry, - - /// - /// A registry key that contains a formatted property acting as a key path. - /// - RegistryFormatted - } - - public class ComponentKeyPath - { - /// - /// Identifier of the resource to be a key path. - /// - public string Id { get; set; } - - /// - /// Indicates whether the key path was explicitly set for this resource. - /// - public bool Explicit { get; set; } - - /// - /// Type of resource to be the key path. - /// - public ComponentKeyPathType Type { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/Data/BindFileWithPath.cs b/src/WixToolset.Extensibility/Data/BindFileWithPath.cs new file mode 100644 index 00000000..d65ae1ba --- /dev/null +++ b/src/WixToolset.Extensibility/Data/BindFileWithPath.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.Data +{ + /// + /// Bind file with its path. + /// + public class BindFileWithPath + { + /// + /// Gets or sets the identifier of the file with this path. + /// + public string Id { get; set; } + + /// + /// Gets or sets the file path. + /// + public string Path { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/BindPath.cs b/src/WixToolset.Extensibility/Data/BindPath.cs new file mode 100644 index 00000000..3b0b73bb --- /dev/null +++ b/src/WixToolset.Extensibility/Data/BindPath.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.Data +{ + 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, BindStage.Normal) + { + } + + /// + /// Creates a named bind path. + /// + /// Name of the bind path. + /// Path for the bind path. + /// Stage for the bind path. + public BindPath(string name, string path, BindStage stage = BindStage.Normal) + { + this.Name = name; + this.Path = path; + this.Stage = stage; + } + + /// + /// 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; } + + /// + /// Stage for the bind path. + /// + public BindStage Stage { get; set; } + + /// + /// Parses a normal bind path from its string representation + /// + /// String representation of bind path that looks like: [name=]path + /// Parsed normal 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]); + } + } +} diff --git a/src/WixToolset.Extensibility/Data/BindResult.cs b/src/WixToolset.Extensibility/Data/BindResult.cs new file mode 100644 index 00000000..ec97154f --- /dev/null +++ b/src/WixToolset.Extensibility/Data/BindResult.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.Data +{ + using System.Collections.Generic; + + public class BindResult + { + public IEnumerable FileTransfers { get; set; } + + public IEnumerable ContentFilePaths { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/BindStage.cs b/src/WixToolset.Extensibility/Data/BindStage.cs new file mode 100644 index 00000000..559a5a5a --- /dev/null +++ b/src/WixToolset.Extensibility/Data/BindStage.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.Data +{ + 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/Data/CabinetBuildOption.cs b/src/WixToolset.Extensibility/Data/CabinetBuildOption.cs new file mode 100644 index 00000000..f9938814 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/CabinetBuildOption.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.Data +{ + /// + /// Options for building the cabinet. + /// + public enum CabinetBuildOption + { + /// + /// Build the cabinet and move it to the target location. + /// + BuildAndMove, + + /// + /// Build the cabinet and copy it to the target location. + /// + BuildAndCopy, + + /// + /// Just copy the cabinet to the target location. + /// + Copy + } +} diff --git a/src/WixToolset.Extensibility/Data/ComponentKeyPath.cs b/src/WixToolset.Extensibility/Data/ComponentKeyPath.cs new file mode 100644 index 00000000..112f562c --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ComponentKeyPath.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.Data +{ + public enum ComponentKeyPathType + { + /// + /// Not a key path. + /// + None, + + /// + /// File resource as a key path. + /// + File, + + /// + /// Folder as a key path. + /// + Directory, + + /// + /// ODBC data source as a key path. + /// + OdbcDataSource, + + /// + /// A simple registry key acting as a key path. + /// + Registry, + + /// + /// A registry key that contains a formatted property acting as a key path. + /// + RegistryFormatted + } + + public class ComponentKeyPath + { + /// + /// Identifier of the resource to be a key path. + /// + public string Id { get; set; } + + /// + /// Indicates whether the key path was explicitly set for this resource. + /// + public bool Explicit { get; set; } + + /// + /// Type of resource to be the key path. + /// + public ComponentKeyPathType Type { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ExtensionCommandLineSwitch.cs b/src/WixToolset.Extensibility/Data/ExtensionCommandLineSwitch.cs new file mode 100644 index 00000000..d1d8f0c3 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ExtensionCommandLineSwitch.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.Data +{ + /// + /// A command line option. + /// + public struct ExtensionCommandLineSwitch + { + public string Switch { get; set; } + + public string Description { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/FileTransfer.cs b/src/WixToolset.Extensibility/Data/FileTransfer.cs new file mode 100644 index 00000000..0356ac4c --- /dev/null +++ b/src/WixToolset.Extensibility/Data/FileTransfer.cs @@ -0,0 +1,114 @@ +// 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.Data +{ + using System; + using System.IO; + using WixToolset.Data; + + /// + /// Structure used for all file transfer information. + /// + public class FileTransfer + { + /// Source path to file. + public string Source { get; set; } + + /// Destination path for file. + public string Destination { get; set; } + + /// Flag if file should be moved (optimal). + public bool Move { get; set; } + + /// Optional source line numbers where this file transfer orginated. + public SourceLineNumber SourceLineNumbers { get; set; } + + /// Optional type of file this transfer is moving or copying. + public string Type { get; set; } + + /// Indicates whether the file transer was a built by this build or copied from other some build. + public bool Built { get; set; } + + /// Set during layout of media when the file transfer when the source and target resolve to the same path. + public bool Redundant { get; set; } + + /// + /// Prefer the TryCreate() method to create FileTransfer objects. + /// + /// Source path to file. + /// Destination path for file. + /// File if file should be moved (optimal). + /// Optional type of file this transfer is transferring. + /// Optional source line numbers wher this transfer originated. + public FileTransfer(string source, string destination, bool move, string type = null, SourceLineNumber sourceLineNumbers = null) + { + this.Source = source; + this.Destination = destination; + this.Move = move; + + this.Type = type; + this.SourceLineNumbers = sourceLineNumbers; + } + + /// + /// Creates a file transfer if the source and destination are different. + /// + /// Source path to file. + /// Destination path for file. + /// File if file should be moved (optimal). + /// Optional type of file this transfer is transferring. + /// Optional source line numbers where this transfer originated. + /// true if the source and destination are the different, false if no file transfer is created. + public static bool TryCreate(string source, string destination, bool move, string type, SourceLineNumber sourceLineNumbers, out FileTransfer transfer) + { + //string sourceFullPath = GetValidatedFullPath(sourceLineNumbers, source); + + //string fileLayoutFullPath = GetValidatedFullPath(sourceLineNumbers, destination); + + ////// if the current source path (where we know that the file already exists) and the resolved + ////// path as dictated by the Directory table are not the same, then propagate the file. The + ////// image that we create may have already been done by some other process other than the linker, so + ////// there is no reason to copy the files to the resolved source if they are already there. + ////if (String.Equals(sourceFullPath, fileLayoutFullPath, StringComparison.OrdinalIgnoreCase)) + ////{ + //// transfer = null; + //// return false; + ////} + + //transfer = new FileTransfer(source, destination, move, type, sourceLineNumbers); + //transfer.Redundant = String.Equals(sourceFullPath, fileLayoutFullPath, StringComparison.OrdinalIgnoreCase); + //return true; + throw new NotImplementedException(); + } + + //private static string GetValidatedFullPath(SourceLineNumber sourceLineNumbers, string path) + //{ + // string result; + + // try + // { + // result = Path.GetFullPath(path); + + // var filename = Path.GetFileName(result); + + // foreach (var reservedName in Common.ReservedFileNames) + // { + // if (reservedName.Equals(filename, StringComparison.OrdinalIgnoreCase)) + // { + // throw new WixException(ErrorMessages.InvalidFileName(sourceLineNumbers, path)); + // } + // } + // } + // catch (ArgumentException) + // { + // throw new WixException(ErrorMessages.InvalidFileName(sourceLineNumbers, path)); + // } + // catch (PathTooLongException) + // { + // throw new WixException(ErrorMessages.PathTooLong(sourceLineNumbers, path)); + // } + + // return result; + //} + } +} diff --git a/src/WixToolset.Extensibility/Data/IBindContext.cs b/src/WixToolset.Extensibility/Data/IBindContext.cs new file mode 100644 index 00000000..355b1a53 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/IBindContext.cs @@ -0,0 +1,43 @@ +// 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.Data +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + + public interface IBindContext + { + IServiceProvider ServiceProvider { get; } + + int CabbingThreadCount { get; set; } + + string CabCachePath { get; set; } + + int Codepage { get; set; } + + CompressionLevel? DefaultCompressionLevel { get; set; } + + IEnumerable DelayedFields { get; set; } + + IEnumerable ExpectedEmbeddedFiles { get; set; } + + IEnumerable Extensions { get; set; } + + IEnumerable FileSystemExtensions { get; set; } + + IEnumerable Ices { get; set; } + + string IntermediateFolder { get; set; } + + Intermediate IntermediateRepresentation { get; set; } + + string OutputPath { get; set; } + + string OutputPdbPath { get; set; } + + IEnumerable SuppressIces { get; set; } + + bool SuppressValidation { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs b/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs new file mode 100644 index 00000000..5729ff36 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ICommandLineArguments.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.Data +{ + using WixToolset.Extensibility.Services; + + public interface ICommandLineArguments + { + string[] OriginalArguments { get; set; } + + string[] Arguments { get; set; } + + string[] Extensions { get; set; } + + string ErrorArgument { get; set; } + + void Populate(string commandLine); + + void Populate(string[] args); + + IParseCommandLine Parse(); + } +} diff --git a/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs b/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs new file mode 100644 index 00000000..1146d40a --- /dev/null +++ b/src/WixToolset.Extensibility/Data/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.Data +{ + public interface ICommandLineCommand + { + int Execute(); + } +} diff --git a/src/WixToolset.Extensibility/Data/ICommandLineContext.cs b/src/WixToolset.Extensibility/Data/ICommandLineContext.cs new file mode 100644 index 00000000..1b2db4a4 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ICommandLineContext.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.Data +{ + using System; + using WixToolset.Extensibility.Services; + + public interface ICommandLineContext + { + IServiceProvider ServiceProvider { get; } + + IExtensionManager ExtensionManager { get; set; } + + ICommandLineArguments Arguments { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ICompileContext.cs b/src/WixToolset.Extensibility/Data/ICompileContext.cs new file mode 100644 index 00000000..50ad10b9 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ICompileContext.cs @@ -0,0 +1,28 @@ +// 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.Data +{ + using System; + using System.Collections.Generic; + using System.Xml.Linq; + using WixToolset.Data; + + public interface ICompileContext + { + IServiceProvider ServiceProvider { get; } + + string CompilationId { get; set; } + + IEnumerable Extensions { get; set; } + + string OutputPath { get; set; } + + /// + /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements. + /// + /// The platform which the compiler will use when defaulting 64-bit attributes and elements. + Platform Platform { get; set; } + + XDocument Source { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/IDelayedField.cs b/src/WixToolset.Extensibility/Data/IDelayedField.cs new file mode 100644 index 00000000..5c078762 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/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.Data +{ + using WixToolset.Data; + + public interface IDelayedField + { + IntermediateField Field { get; } + + IntermediateTuple Row { get; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/Data/IExpectedExtractFile.cs b/src/WixToolset.Extensibility/Data/IExpectedExtractFile.cs new file mode 100644 index 00000000..edcf82e0 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/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.Data +{ + 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/Data/IFileSystemContext.cs b/src/WixToolset.Extensibility/Data/IFileSystemContext.cs new file mode 100644 index 00000000..86fc106c --- /dev/null +++ b/src/WixToolset.Extensibility/Data/IFileSystemContext.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.Data +{ + using System; + using WixToolset.Data; + + public interface IFileSystemContext + { + IServiceProvider ServiceProvider { get; } + + string CabCachePath { get; set; } + + string IntermediateFolder { get; set; } + + Intermediate IntermediateRepresentation { get; set; } + + string OutputPath { get; set; } + + string OutputPdbPath { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/IInscribeContext.cs b/src/WixToolset.Extensibility/Data/IInscribeContext.cs new file mode 100644 index 00000000..4f13ba10 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/IInscribeContext.cs @@ -0,0 +1,19 @@ +// 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.Data +{ + using System; + + public interface IInscribeContext + { + IServiceProvider ServiceProvider { get; } + + string InputFilePath { get; set; } + + string IntermediateFolder { get; set; } + + string OutputFile { get; set; } + + string SignedEngineFile { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ILayoutContext.cs b/src/WixToolset.Extensibility/Data/ILayoutContext.cs new file mode 100644 index 00000000..c3555268 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ILayoutContext.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.Data +{ + using System; + using System.Collections.Generic; + + public interface ILayoutContext + { + IServiceProvider ServiceProvider { get; } + + IEnumerable Extensions { get; set; } + + IEnumerable ContentFilePaths { get; set; } + + IEnumerable FileTransfers { get; set; } + + string ContentsFile { get; set; } + + string OutputsFile { get; set; } + + string BuiltOutputsFile { get; set; } + + bool SuppressAclReset { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ILibraryContext.cs b/src/WixToolset.Extensibility/Data/ILibraryContext.cs new file mode 100644 index 00000000..08b4ed26 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ILibraryContext.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.Data +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + + public interface ILibraryContext + { + IServiceProvider ServiceProvider { get; } + + bool BindFiles { get; set; } + + IEnumerable BindPaths { get; set; } + + IEnumerable Extensions { get; set; } + + string LibraryId { get; set; } + + IEnumerable Localizations { get; set; } + + IEnumerable Intermediates { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/ILinkContext.cs b/src/WixToolset.Extensibility/Data/ILinkContext.cs new file mode 100644 index 00000000..8c1d6f22 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ILinkContext.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.Data +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + + public interface ILinkContext + { + IServiceProvider ServiceProvider { get; } + + IEnumerable Extensions { get; set; } + + IEnumerable ExtensionData { get; set; } + + OutputType ExpectedOutputType { get; set; } + + IEnumerable Intermediates { get; set; } + + ITupleDefinitionCreator TupleDefinitionCreator { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/IPreprocessContext.cs b/src/WixToolset.Extensibility/Data/IPreprocessContext.cs new file mode 100644 index 00000000..a923c4db --- /dev/null +++ b/src/WixToolset.Extensibility/Data/IPreprocessContext.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.Data +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + + public interface IPreprocessContext + { + IServiceProvider ServiceProvider { get; } + + IEnumerable Extensions { get; set; } + + IList IncludeSearchPaths { get; set; } + + /// + /// Gets the platform which the compiler will use when defaulting 64-bit attributes and elements. + /// + /// The platform which the compiler will use when defaulting 64-bit attributes and elements. + Platform Platform { get; set; } + + string SourceFile { get; set; } + + IDictionary Variables { get; set; } + + SourceLineNumber CurrentSourceLineNumber { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/IResolveContext.cs b/src/WixToolset.Extensibility/Data/IResolveContext.cs new file mode 100644 index 00000000..0e12a534 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/IResolveContext.cs @@ -0,0 +1,30 @@ +// 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.Data +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + using WixToolset.Extensibility.Services; + + public interface IResolveContext + { + IServiceProvider ServiceProvider { get; } + + IEnumerable BindPaths { get; set; } + + IEnumerable Extensions { get; set; } + + IEnumerable ExtensionData { get; set; } + + IEnumerable FilterCultures { get; set; } + + string IntermediateFolder { get; set; } + + Intermediate IntermediateRepresentation { get; set; } + + IEnumerable Localizations { get; set; } + + IVariableResolver VariableResolver { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/Data/IUnbindContext.cs b/src/WixToolset.Extensibility/Data/IUnbindContext.cs new file mode 100644 index 00000000..84dc5167 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/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.Data +{ + using System; + + public interface IUnbindContext + { + IServiceProvider ServiceProvider { get; } + + string ExportBasePath { get; set; } + + string InputFilePath { get; set; } + + string IntermediateFolder { get; set; } + + bool IsAdminImage { get; set; } + + bool SuppressDemodularization { get; set; } + + bool SuppressExtractCabinets { get; set; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/Data/ResolveResult.cs b/src/WixToolset.Extensibility/Data/ResolveResult.cs new file mode 100644 index 00000000..cdc9cfcc --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ResolveResult.cs @@ -0,0 +1,18 @@ +// 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.Data +{ + using System.Collections.Generic; + using WixToolset.Data; + + public class ResolveResult + { + public int Codepage { get; set; } + + public IEnumerable DelayedFields { get; set; } + + public IEnumerable ExpectedEmbeddedFiles { get; set; } + + public Intermediate IntermediateRepresentation { get; set; } + } +} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/Data/ResolvedCabinet.cs b/src/WixToolset.Extensibility/Data/ResolvedCabinet.cs new file mode 100644 index 00000000..047b7448 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ResolvedCabinet.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.Data +{ + /// + /// Data returned from build file manager ResolveCabinet callback. + /// + public class ResolvedCabinet + { + /// + /// Gets or sets the build option for the resolved cabinet. + /// + public CabinetBuildOption BuildOption { get; set; } + + /// + /// Gets or sets the path for the resolved cabinet. + /// + public string Path { get; set; } + } +} diff --git a/src/WixToolset.Extensibility/IBackend.cs b/src/WixToolset.Extensibility/IBackend.cs index 385fd086..80f885c3 100644 --- a/src/WixToolset.Extensibility/IBackend.cs +++ b/src/WixToolset.Extensibility/IBackend.cs @@ -3,7 +3,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data; - using WixToolset.Data.Bind; + using WixToolset.Extensibility.Data; public interface IBackend { diff --git a/src/WixToolset.Extensibility/IBackendFactory.cs b/src/WixToolset.Extensibility/IBackendFactory.cs index 12704c0f..02f0809a 100644 --- a/src/WixToolset.Extensibility/IBackendFactory.cs +++ b/src/WixToolset.Extensibility/IBackendFactory.cs @@ -2,7 +2,7 @@ namespace WixToolset.Extensibility { - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; public interface IBackendFactory { diff --git a/src/WixToolset.Extensibility/IBindContext.cs b/src/WixToolset.Extensibility/IBindContext.cs deleted file mode 100644 index 59509ecf..00000000 --- a/src/WixToolset.Extensibility/IBindContext.cs +++ /dev/null @@ -1,46 +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 System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface IBindContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { 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; } - - IEnumerable Extensions { get; set; } - - IEnumerable FileSystemExtensions { get; set; } - - IEnumerable Ices { get; set; } - - string IntermediateFolder { get; set; } - - Intermediate IntermediateRepresentation { get; set; } - - string OutputPath { get; set; } - - string OutputPdbPath { get; set; } - - IEnumerable SuppressIces { get; set; } - - bool SuppressValidation { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/IBindExtension.cs b/src/WixToolset.Extensibility/IBindExtension.cs index c9830a35..2dcf5eff 100644 --- a/src/WixToolset.Extensibility/IBindExtension.cs +++ b/src/WixToolset.Extensibility/IBindExtension.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data.Bind; + using WixToolset.Extensibility.Data; /// /// Interface all binder extensions implement. diff --git a/src/WixToolset.Extensibility/IBurnBackendExtension.cs b/src/WixToolset.Extensibility/IBurnBackendExtension.cs index c8b8e407..bcd0d5ee 100644 --- a/src/WixToolset.Extensibility/IBurnBackendExtension.cs +++ b/src/WixToolset.Extensibility/IBurnBackendExtension.cs @@ -4,7 +4,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data; using WixToolset.Data.Bind; - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; public interface IBurnBackendExtension { diff --git a/src/WixToolset.Extensibility/ICompileContext.cs b/src/WixToolset.Extensibility/ICompileContext.cs deleted file mode 100644 index fbe38d63..00000000 --- a/src/WixToolset.Extensibility/ICompileContext.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 System.Collections.Generic; - using System.Xml.Linq; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface ICompileContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - string CompilationId { get; set; } - - IEnumerable Extensions { get; set; } - - string OutputPath { get; set; } - - /// - /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements. - /// - /// The platform which the compiler will use when defaulting 64-bit attributes and elements. - Platform Platform { get; set; } - - XDocument Source { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ICompilerExtension.cs b/src/WixToolset.Extensibility/ICompilerExtension.cs index 0aa5c9e2..b2dd6d04 100644 --- a/src/WixToolset.Extensibility/ICompilerExtension.cs +++ b/src/WixToolset.Extensibility/ICompilerExtension.cs @@ -5,6 +5,7 @@ namespace WixToolset.Extensibility using System.Collections.Generic; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Data; /// /// Interface all compiler extensions implement. diff --git a/src/WixToolset.Extensibility/IDecompilerExtension.cs b/src/WixToolset.Extensibility/IDecompilerExtension.cs index 1574f964..e2b80089 100644 --- a/src/WixToolset.Extensibility/IDecompilerExtension.cs +++ b/src/WixToolset.Extensibility/IDecompilerExtension.cs @@ -2,8 +2,6 @@ namespace WixToolset.Extensibility { - using WixToolset.Data; - /// /// Base class for creating a decompiler extension. /// diff --git a/src/WixToolset.Extensibility/IDelayedField.cs b/src/WixToolset.Extensibility/IDelayedField.cs deleted file mode 100644 index e06dbe59..00000000 --- a/src/WixToolset.Extensibility/IDelayedField.cs +++ /dev/null @@ -1,13 +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; - - public interface IDelayedField - { - IntermediateField Field { get; } - - IntermediateTuple Row { get; } - } -} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/IExpectedExtractFile.cs b/src/WixToolset.Extensibility/IExpectedExtractFile.cs deleted file mode 100644 index 06e4f77f..00000000 --- a/src/WixToolset.Extensibility/IExpectedExtractFile.cs +++ /dev/null @@ -1,15 +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; - - 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/IExtensionCommandLine.cs b/src/WixToolset.Extensibility/IExtensionCommandLine.cs index 831a1bc2..5c6f578d 100644 --- a/src/WixToolset.Extensibility/IExtensionCommandLine.cs +++ b/src/WixToolset.Extensibility/IExtensionCommandLine.cs @@ -3,18 +3,9 @@ namespace WixToolset.Extensibility { using System.Collections.Generic; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; - /// - /// A command line option. - /// - public struct ExtensionCommandLineSwitch - { - public string Switch { get; set; } - - public string Description { get; set; } - } - /// /// Interface extensions implement to be able to parse command-line options. /// diff --git a/src/WixToolset.Extensibility/IFileSystemContext.cs b/src/WixToolset.Extensibility/IFileSystemContext.cs deleted file mode 100644 index 32783957..00000000 --- a/src/WixToolset.Extensibility/IFileSystemContext.cs +++ /dev/null @@ -1,25 +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; - using WixToolset.Extensibility.Services; - - public interface IFileSystemContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - string CabCachePath { get; set; } - - string IntermediateFolder { get; set; } - - Intermediate IntermediateRepresentation { get; set; } - - string OutputPath { get; set; } - - string OutputPdbPath { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/IFileSystemExtension.cs b/src/WixToolset.Extensibility/IFileSystemExtension.cs index 96c8a748..0a3e84b8 100644 --- a/src/WixToolset.Extensibility/IFileSystemExtension.cs +++ b/src/WixToolset.Extensibility/IFileSystemExtension.cs @@ -2,6 +2,8 @@ namespace WixToolset.Extensibility { + using WixToolset.Extensibility.Data; + /// /// Interface all file system extensions implement. /// diff --git a/src/WixToolset.Extensibility/IInscribeContext.cs b/src/WixToolset.Extensibility/IInscribeContext.cs deleted file mode 100644 index 7f741024..00000000 --- a/src/WixToolset.Extensibility/IInscribeContext.cs +++ /dev/null @@ -1,22 +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.Extensibility.Services; - - public interface IInscribeContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - string InputFilePath { get; set; } - - string IntermediateFolder { get; set; } - - string OutputFile { get; set; } - - string SignedEngineFile { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ILayoutContext.cs b/src/WixToolset.Extensibility/ILayoutContext.cs deleted file mode 100644 index 9ec559f9..00000000 --- a/src/WixToolset.Extensibility/ILayoutContext.cs +++ /dev/null @@ -1,32 +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 System.Collections.Generic; - using WixToolset.Data.Bind; - using WixToolset.Extensibility.Services; - - public interface ILayoutContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - IEnumerable Extensions { get; set; } - - IEnumerable ContentFilePaths { get; set; } - - IEnumerable FileTransfers { get; set; } - - string OutputPdbPath { get; set; } - - string ContentsFile { get; set; } - - string OutputsFile { get; set; } - - string BuiltOutputsFile { get; set; } - - bool SuppressAclReset { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ILayoutExtension.cs b/src/WixToolset.Extensibility/ILayoutExtension.cs index 1cf4871f..7bcee0a8 100644 --- a/src/WixToolset.Extensibility/ILayoutExtension.cs +++ b/src/WixToolset.Extensibility/ILayoutExtension.cs @@ -2,6 +2,8 @@ namespace WixToolset.Extensibility { + using WixToolset.Extensibility.Data; + /// /// Interface all layout extensions implement. /// diff --git a/src/WixToolset.Extensibility/ILibrarianExtension.cs b/src/WixToolset.Extensibility/ILibrarianExtension.cs index 381abf01..7319f8b9 100644 --- a/src/WixToolset.Extensibility/ILibrarianExtension.cs +++ b/src/WixToolset.Extensibility/ILibrarianExtension.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data; + using WixToolset.Extensibility.Data; public interface ILibrarianExtension { diff --git a/src/WixToolset.Extensibility/ILibraryContext.cs b/src/WixToolset.Extensibility/ILibraryContext.cs deleted file mode 100644 index 0c29a3dd..00000000 --- a/src/WixToolset.Extensibility/ILibraryContext.cs +++ /dev/null @@ -1,28 +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 System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface ILibraryContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - bool BindFiles { get; set; } - - IEnumerable BindPaths { get; set; } - - IEnumerable Extensions { get; set; } - - string LibraryId { get; set; } - - IEnumerable Localizations { get; set; } - - IEnumerable Intermediates { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ILinkContext.cs b/src/WixToolset.Extensibility/ILinkContext.cs deleted file mode 100644 index 65eeb6f1..00000000 --- a/src/WixToolset.Extensibility/ILinkContext.cs +++ /dev/null @@ -1,26 +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 System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface ILinkContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - IEnumerable Extensions { get; set; } - - IEnumerable ExtensionData { get; set; } - - OutputType ExpectedOutputType { get; set; } - - IEnumerable Intermediates { get; set; } - - ITupleDefinitionCreator TupleDefinitionCreator { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ILinkerExtension.cs b/src/WixToolset.Extensibility/ILinkerExtension.cs index cb82720a..febca1df 100644 --- a/src/WixToolset.Extensibility/ILinkerExtension.cs +++ b/src/WixToolset.Extensibility/ILinkerExtension.cs @@ -3,7 +3,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data; - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; /// /// Interface all binder extensions implement. diff --git a/src/WixToolset.Extensibility/IPreprocessContext.cs b/src/WixToolset.Extensibility/IPreprocessContext.cs deleted file mode 100644 index fcf698c1..00000000 --- a/src/WixToolset.Extensibility/IPreprocessContext.cs +++ /dev/null @@ -1,32 +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 System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface IPreprocessContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - IEnumerable Extensions { get; set; } - - IList IncludeSearchPaths { get; set; } - - /// - /// Gets the platform which the compiler will use when defaulting 64-bit attributes and elements. - /// - /// The platform which the compiler will use when defaulting 64-bit attributes and elements. - Platform Platform { get; set; } - - string SourceFile { get; set; } - - IDictionary Variables { get; set; } - - SourceLineNumber CurrentSourceLineNumber { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/IPreprocessorExtension.cs b/src/WixToolset.Extensibility/IPreprocessorExtension.cs index 68f82693..7eb8584f 100644 --- a/src/WixToolset.Extensibility/IPreprocessorExtension.cs +++ b/src/WixToolset.Extensibility/IPreprocessorExtension.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility { using System.Xml.Linq; + using WixToolset.Extensibility.Data; /// /// Interface for extending the WiX toolset preprocessor. diff --git a/src/WixToolset.Extensibility/IResolveContext.cs b/src/WixToolset.Extensibility/IResolveContext.cs deleted file mode 100644 index 26891d6b..00000000 --- a/src/WixToolset.Extensibility/IResolveContext.cs +++ /dev/null @@ -1,32 +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 System.Collections.Generic; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - public interface IResolveContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - IEnumerable BindPaths { get; set; } - - IEnumerable Extensions { get; set; } - - IEnumerable ExtensionData { get; set; } - - IEnumerable FilterCultures { get; set; } - - string IntermediateFolder { get; set; } - - Intermediate IntermediateRepresentation { get; set; } - - IEnumerable Localizations { get; set; } - - IVariableResolver VariableResolver { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/IResolverExtension.cs b/src/WixToolset.Extensibility/IResolverExtension.cs index b0478ff0..152ef64a 100644 --- a/src/WixToolset.Extensibility/IResolverExtension.cs +++ b/src/WixToolset.Extensibility/IResolverExtension.cs @@ -3,7 +3,7 @@ namespace WixToolset.Extensibility { using WixToolset.Data; - using WixToolset.Data.Bind; + using WixToolset.Extensibility.Data; /// /// Interface all resolver extensions implement. diff --git a/src/WixToolset.Extensibility/IUnbindContext.cs b/src/WixToolset.Extensibility/IUnbindContext.cs deleted file mode 100644 index beaa5491..00000000 --- a/src/WixToolset.Extensibility/IUnbindContext.cs +++ /dev/null @@ -1,26 +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.Extensibility.Services; - - public interface IUnbindContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - string ExportBasePath { get; set; } - - string InputFilePath { get; set; } - - string IntermediateFolder { get; set; } - - bool IsAdminImage { get; set; } - - 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 index 5ea73995..bc251bb2 100644 --- a/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs +++ b/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs @@ -7,6 +7,7 @@ namespace WixToolset.Extensibility using WixToolset.Data.Bind; using WixToolset.Data.Tuples; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Data; /// /// Interface all binder extensions implement. diff --git a/src/WixToolset.Extensibility/ResolveResult.cs b/src/WixToolset.Extensibility/ResolveResult.cs deleted file mode 100644 index 53f12fe9..00000000 --- a/src/WixToolset.Extensibility/ResolveResult.cs +++ /dev/null @@ -1,18 +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; - - public class ResolveResult - { - public int Codepage { get; set; } - - public IEnumerable DelayedFields { get; set; } - - public IEnumerable ExpectedEmbeddedFiles { get; set; } - - public Intermediate IntermediateRepresentation { get; set; } - } -} \ No newline at end of file diff --git a/src/WixToolset.Extensibility/ResolvedCabinet.cs b/src/WixToolset.Extensibility/ResolvedCabinet.cs deleted file mode 100644 index e98d6d96..00000000 --- a/src/WixToolset.Extensibility/ResolvedCabinet.cs +++ /dev/null @@ -1,20 +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 -{ - /// - /// Data returned from build file manager ResolveCabinet callback. - /// - public class ResolvedCabinet - { - /// - /// Gets or sets the build option for the resolved cabinet. - /// - public CabinetBuildOption BuildOption { get; set; } - - /// - /// Gets or sets the path for the resolved cabinet. - /// - public string Path { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/ServiceProviderExtensions.cs b/src/WixToolset.Extensibility/ServiceProviderExtensions.cs deleted file mode 100644 index 408d1523..00000000 --- a/src/WixToolset.Extensibility/ServiceProviderExtensions.cs +++ /dev/null @@ -1,14 +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; - - public static class ServiceProviderExtensions - { - public static T GetService(this IServiceProvider serviceProvider) where T : class - { - return (T)serviceProvider.GetService(typeof(T)); - } - } -} diff --git a/src/WixToolset.Extensibility/Services/ICommandLine.cs b/src/WixToolset.Extensibility/Services/ICommandLine.cs index 9dd247ff..48f3620f 100644 --- a/src/WixToolset.Extensibility/Services/ICommandLine.cs +++ b/src/WixToolset.Extensibility/Services/ICommandLine.cs @@ -2,8 +2,14 @@ namespace WixToolset.Extensibility.Services { + using WixToolset.Extensibility.Data; + public interface ICommandLine { - ICommandLineCommand ParseStandardCommandLine(ICommandLineContext commandLineContext); + IExtensionManager ExtensionManager { get; set; } + + ICommandLineArguments Arguments { get; set; } + + ICommandLineCommand ParseStandardCommandLine(); } } diff --git a/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs b/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs deleted file mode 100644 index eb1f8765..00000000 --- a/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs +++ /dev/null @@ -1,23 +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.Services -{ - using System.Collections.Generic; - - public interface ICommandLineArguments - { - string[] OriginalArguments { get; set; } - - string[] Arguments { get; set; } - - string[] Extensions { get; set; } - - string ErrorArgument { get; set; } - - void Populate(string commandLine); - - void Populate(string[] args); - - IParseCommandLine Parse(); - } -} diff --git a/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs b/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs deleted file mode 100644 index f2333c55..00000000 --- a/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs +++ /dev/null @@ -1,9 +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.Services -{ - public interface ICommandLineCommand - { - int Execute(); - } -} diff --git a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs deleted file mode 100644 index 84b9654f..00000000 --- a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs +++ /dev/null @@ -1,17 +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.Services -{ - using System; - - public interface ICommandLineContext - { - IServiceProvider ServiceProvider { get; } - - IMessaging Messaging { get; set; } - - IExtensionManager ExtensionManager { get; set; } - - ICommandLineArguments Arguments { get; set; } - } -} diff --git a/src/WixToolset.Extensibility/Services/IParseHelper.cs b/src/WixToolset.Extensibility/Services/IParseHelper.cs index 96e2c83c..49218d4f 100644 --- a/src/WixToolset.Extensibility/Services/IParseHelper.cs +++ b/src/WixToolset.Extensibility/Services/IParseHelper.cs @@ -6,6 +6,7 @@ namespace WixToolset.Extensibility.Services using System.Collections.Generic; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Data; /// /// Interface provided to help compiler extensions parse. diff --git a/src/WixToolset.Extensibility/Services/IPreprocessHelper.cs b/src/WixToolset.Extensibility/Services/IPreprocessHelper.cs index 01c55009..d55383db 100644 --- a/src/WixToolset.Extensibility/Services/IPreprocessHelper.cs +++ b/src/WixToolset.Extensibility/Services/IPreprocessHelper.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility.Services { using System.Xml.Linq; + using WixToolset.Extensibility.Data; /// /// Interface provided to help preprocessor extensions. 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)); + } + } +} diff --git a/src/WixToolset.Extensibility/WixToolset.Extensibility.csproj b/src/WixToolset.Extensibility/WixToolset.Extensibility.csproj index b1f758e5..31de1095 100644 --- a/src/WixToolset.Extensibility/WixToolset.Extensibility.csproj +++ b/src/WixToolset.Extensibility/WixToolset.Extensibility.csproj @@ -16,7 +16,7 @@ - + -- cgit v1.2.3-55-g6feb