diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-08-11 01:03:57 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-08-11 01:03:57 -0700 |
| commit | 84cb6c26c945fe031bbe36c666d0bbd6275d843b (patch) | |
| tree | 43539235498b9d9ac61270039ef65445adbd9db5 /src | |
| parent | c60c36800f5e84e1aced6257aeee5f6139ef6af8 (diff) | |
| download | wix-84cb6c26c945fe031bbe36c666d0bbd6275d843b.tar.gz wix-84cb6c26c945fe031bbe36c666d0bbd6275d843b.tar.bz2 wix-84cb6c26c945fe031bbe36c666d0bbd6275d843b.zip | |
Add support for tracking files to simplify file transfers
Diffstat (limited to 'src')
7 files changed, 73 insertions, 25 deletions
diff --git a/src/WixToolset.Extensibility/Data/BindResult.cs b/src/WixToolset.Extensibility/Data/BindResult.cs index 0ccaa08b..e467d269 100644 --- a/src/WixToolset.Extensibility/Data/BindResult.cs +++ b/src/WixToolset.Extensibility/Data/BindResult.cs | |||
| @@ -8,6 +8,6 @@ namespace WixToolset.Extensibility.Data | |||
| 8 | { | 8 | { |
| 9 | public IEnumerable<IFileTransfer> FileTransfers { get; set; } | 9 | public IEnumerable<IFileTransfer> FileTransfers { get; set; } |
| 10 | 10 | ||
| 11 | public IEnumerable<string> ContentFilePaths { get; set; } | 11 | public IEnumerable<ITrackedFile> TrackedFiles { get; set; } |
| 12 | } | 12 | } |
| 13 | } | 13 | } |
diff --git a/src/WixToolset.Extensibility/Data/FileTransferType.cs b/src/WixToolset.Extensibility/Data/FileTransferType.cs deleted file mode 100644 index b00a00c4..00000000 --- a/src/WixToolset.Extensibility/Data/FileTransferType.cs +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Extensibility.Data | ||
| 4 | { | ||
| 5 | public enum FileTransferType | ||
| 6 | { | ||
| 7 | /// <summary> | ||
| 8 | /// Transfer of a file built during this build. | ||
| 9 | /// </summary> | ||
| 10 | Built, | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// Transfer of a file contained in the output. | ||
| 14 | /// </summary> | ||
| 15 | Content, | ||
| 16 | } | ||
| 17 | } | ||
diff --git a/src/WixToolset.Extensibility/Data/IFileTransfer.cs b/src/WixToolset.Extensibility/Data/IFileTransfer.cs index ca936219..6f521536 100644 --- a/src/WixToolset.Extensibility/Data/IFileTransfer.cs +++ b/src/WixToolset.Extensibility/Data/IFileTransfer.cs | |||
| @@ -23,8 +23,5 @@ namespace WixToolset.Extensibility.Data | |||
| 23 | 23 | ||
| 24 | /// <summary>Optional source line numbers where this file transfer orginated.</summary> | 24 | /// <summary>Optional source line numbers where this file transfer orginated.</summary> |
| 25 | SourceLineNumber SourceLineNumbers { get; set; } | 25 | SourceLineNumber SourceLineNumbers { get; set; } |
| 26 | |||
| 27 | /// <summary>Type of file this transfer is moving or copying.</summary> | ||
| 28 | FileTransferType Type { get; set; } | ||
| 29 | } | 26 | } |
| 30 | } | 27 | } |
diff --git a/src/WixToolset.Extensibility/Data/ILayoutContext.cs b/src/WixToolset.Extensibility/Data/ILayoutContext.cs index 7011fcf6..89aadc4d 100644 --- a/src/WixToolset.Extensibility/Data/ILayoutContext.cs +++ b/src/WixToolset.Extensibility/Data/ILayoutContext.cs | |||
| @@ -11,7 +11,7 @@ namespace WixToolset.Extensibility.Data | |||
| 11 | 11 | ||
| 12 | IEnumerable<ILayoutExtension> Extensions { get; set; } | 12 | IEnumerable<ILayoutExtension> Extensions { get; set; } |
| 13 | 13 | ||
| 14 | IEnumerable<string> ContentFilePaths { get; set; } | 14 | IEnumerable<ITrackedFile> TrackedFiles { get; set; } |
| 15 | 15 | ||
| 16 | IEnumerable<IFileTransfer> FileTransfers { get; set; } | 16 | IEnumerable<IFileTransfer> FileTransfers { get; set; } |
| 17 | 17 | ||
diff --git a/src/WixToolset.Extensibility/Data/ITrackedFile.cs b/src/WixToolset.Extensibility/Data/ITrackedFile.cs new file mode 100644 index 00000000..df36bd2b --- /dev/null +++ b/src/WixToolset.Extensibility/Data/ITrackedFile.cs | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Extensibility.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | |||
| 7 | /// <summary> | ||
| 8 | /// Interface used to track all files processed. | ||
| 9 | /// </summary> | ||
| 10 | public interface ITrackedFile | ||
| 11 | { | ||
| 12 | /// <summary> | ||
| 13 | /// Indicates whether the tracked file should be cleaned by the project. | ||
| 14 | /// </summary> | ||
| 15 | bool Clean { get; set; } | ||
| 16 | |||
| 17 | /// <summary> | ||
| 18 | /// Path to tracked file. | ||
| 19 | /// </summary> | ||
| 20 | string Path { get; set; } | ||
| 21 | |||
| 22 | /// <summary> | ||
| 23 | /// Optional source line numbers where the tracked file was created. | ||
| 24 | /// </summary> | ||
| 25 | SourceLineNumber SourceLineNumbers { get; set; } | ||
| 26 | |||
| 27 | /// <summary> | ||
| 28 | /// Type of tracked file. | ||
| 29 | /// </summary> | ||
| 30 | TrackedFileType Type { get; set; } | ||
| 31 | } | ||
| 32 | } | ||
diff --git a/src/WixToolset.Extensibility/Data/TrackedFileType.cs b/src/WixToolset.Extensibility/Data/TrackedFileType.cs new file mode 100644 index 00000000..195d5de9 --- /dev/null +++ b/src/WixToolset.Extensibility/Data/TrackedFileType.cs | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Extensibility.Data | ||
| 4 | { | ||
| 5 | public enum TrackedFileType | ||
| 6 | { | ||
| 7 | /// <summary> | ||
| 8 | /// File tracked as input (like content included in an .msi). | ||
| 9 | /// </summary> | ||
| 10 | Input, | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// Temporary file (like an .idt or any other temporary file). | ||
| 14 | /// These are to be deleted before the build completes. | ||
| 15 | /// </summary> | ||
| 16 | Temporary, | ||
| 17 | |||
| 18 | /// <summary> | ||
| 19 | /// Intermediate file (like a .cab in the cabcache). | ||
| 20 | /// These are left for subsequent builds. | ||
| 21 | /// </summary> | ||
| 22 | Intermediate, | ||
| 23 | |||
| 24 | /// <summary> | ||
| 25 | /// Final output (like a .msi, .cab or .wixpdb). | ||
| 26 | /// These are the whole point of the build process. | ||
| 27 | /// </summary> | ||
| 28 | Final, | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/IBackendHelper.cs b/src/WixToolset.Extensibility/Services/IBackendHelper.cs index 813b40ef..0622693d 100644 --- a/src/WixToolset.Extensibility/Services/IBackendHelper.cs +++ b/src/WixToolset.Extensibility/Services/IBackendHelper.cs | |||
| @@ -17,9 +17,7 @@ namespace WixToolset.Extensibility.Services | |||
| 17 | /// <param name="source">Source for the file transfer.</param> | 17 | /// <param name="source">Source for the file transfer.</param> |
| 18 | /// <param name="destination">Destiation for the file transfer.</param> | 18 | /// <param name="destination">Destiation for the file transfer.</param> |
| 19 | /// <param name="move">Indicates whether to move or copy the source file.</param> | 19 | /// <param name="move">Indicates whether to move or copy the source file.</param> |
| 20 | /// <param name="type">Type of file transfer to create.</param> | 20 | IFileTransfer CreateFileTransfer(string source, string destination, bool move, SourceLineNumber sourceLineNumbers = null); |
| 21 | /// <param name="sourceLineNumbers">Optional source line numbers that requested the file transfer.</param> | ||
| 22 | IFileTransfer CreateFileTransfer(string source, string destination, bool move, FileTransferType type, SourceLineNumber sourceLineNumbers = null); | ||
| 23 | 21 | ||
| 24 | /// <summary> | 22 | /// <summary> |
| 25 | /// Creates a version 3 name-based UUID. | 23 | /// Creates a version 3 name-based UUID. |
| @@ -28,5 +26,13 @@ namespace WixToolset.Extensibility.Services | |||
| 28 | /// <param name="value">The value.</param> | 26 | /// <param name="value">The value.</param> |
| 29 | /// <returns>The generated GUID for the given namespace and value.</returns> | 27 | /// <returns>The generated GUID for the given namespace and value.</returns> |
| 30 | string CreateGuid(Guid namespaceGuid, string value); | 28 | string CreateGuid(Guid namespaceGuid, string value); |
| 29 | |||
| 30 | /// <summary> | ||
| 31 | /// Creates a tracked file. | ||
| 32 | /// </summary> | ||
| 33 | /// <param name="path">Destination path for the build output.</param> | ||
| 34 | /// <param name="type">Type of tracked file to create.</param> | ||
| 35 | /// <param name="sourceLineNumbers">Optional source line numbers that requested the tracked file.</param> | ||
| 36 | ITrackedFile TrackFile(string path, TrackedFileType type, SourceLineNumber sourceLineNumbers = null); | ||
| 31 | } | 37 | } |
| 32 | } | 38 | } |
