From 770bf982da4a81e56ba4be2b6a7a3afa3868a535 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 2 Jan 2022 08:00:17 -0800 Subject: Extract tracking and creating file transfers to ILayoutServices This refactoring will allow more parts of the pipeline to add files to be transferred during layout and tracked to participate in MSBuild up to date checks and cleaning. --- .../Services/IBackendHelper.cs | 19 +------------- .../Services/ILayoutServices.cs | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 src/api/wix/WixToolset.Extensibility/Services/ILayoutServices.cs (limited to 'src/api') diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs index 5c4d9a68..29b8f8e6 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs @@ -12,7 +12,7 @@ namespace WixToolset.Extensibility.Services /// /// Interface provided to help backend extensions. /// - public interface IBackendHelper + public interface IBackendHelper : ILayoutServices { /// /// Creates a file facade from a FileSymbol and possible AssemblySymbol. @@ -36,15 +36,6 @@ namespace WixToolset.Extensibility.Services /// New IFileFacade. IFileFacade CreateFileFacadeFromMergeModule(FileSymbol fileSymbol); - /// - /// Creates a file transfer and marks it redundant if the source and destination are identical. - /// - /// Source for the file transfer. - /// Destination for the file transfer. - /// Indicates whether to move or copy the source file. - /// Optional source line numbers that requested the file transfer. - IFileTransfer CreateFileTransfer(string source, string destination, bool move, SourceLineNumber sourceLineNumbers = null); - /// /// Creates a MSI compatible GUID. /// @@ -171,13 +162,5 @@ namespace WixToolset.Extensibility.Services /// Thus the returned array will always be of length 4. /// string[] SplitMsiFileName(string value); - - /// - /// Creates a tracked file. - /// - /// Destination path for the build output. - /// Type of tracked file to create. - /// Optional source line numbers that requested the tracked file. - ITrackedFile TrackFile(string path, TrackedFileType type, SourceLineNumber sourceLineNumbers = null); } } diff --git a/src/api/wix/WixToolset.Extensibility/Services/ILayoutServices.cs b/src/api/wix/WixToolset.Extensibility/Services/ILayoutServices.cs new file mode 100644 index 00000000..79f89d29 --- /dev/null +++ b/src/api/wix/WixToolset.Extensibility/Services/ILayoutServices.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.Services +{ + using WixToolset.Data; + using WixToolset.Extensibility.Data; + + /// + /// Interface provided to track files for use by layout later. + /// + public interface ILayoutServices + { + /// + /// Creates a file transfer and marks it redundant if the source and destination are identical. + /// + /// Source for the file transfer. + /// Destination for the file transfer. + /// Indicates whether to move or copy the source file. + /// Optional source line numbers that requested the file transfer. + IFileTransfer CreateFileTransfer(string source, string destination, bool move, SourceLineNumber sourceLineNumbers = null); + + /// + /// Creates a tracked file. + /// + /// Destination path for the build output. + /// Type of tracked file to create. + /// Optional source line numbers that requested the tracked file. + ITrackedFile TrackFile(string path, TrackedFileType type, SourceLineNumber sourceLineNumbers = null); + } +} -- cgit v1.2.3-55-g6feb