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 --- .../Services/IBindContext.cs | 59 ++++++++++++++++++++++ .../Services/ICommandLine.cs | 9 ++++ .../Services/ICommandLineCommand.cs | 9 ++++ .../Services/ICommandLineContext.cs | 20 ++++++++ .../Services/IExtensionManager.cs | 16 ++++++ .../Services/ServiceProviderExtensions.cs | 14 +++++ 6 files changed, 127 insertions(+) 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/WixToolset.Extensibility/Services') 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