diff options
Diffstat (limited to '')
-rw-r--r-- | src/WixToolset.Core/HarvesterCore.cs | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/WixToolset.Core/HarvesterCore.cs b/src/WixToolset.Core/HarvesterCore.cs deleted file mode 100644 index 70991979..00000000 --- a/src/WixToolset.Core/HarvesterCore.cs +++ /dev/null | |||
@@ -1,75 +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.Core | ||
4 | { | ||
5 | using System; | ||
6 | using System.Diagnostics.CodeAnalysis; | ||
7 | using System.IO; | ||
8 | using WixToolset.Extensibility.Services; | ||
9 | |||
10 | /// <summary> | ||
11 | /// The WiX Toolset harvester core. | ||
12 | /// </summary> | ||
13 | public class HarvesterCore : IHarvesterCore | ||
14 | { | ||
15 | public IMessaging Messaging { get; set; } | ||
16 | |||
17 | /// <summary> | ||
18 | /// Gets or sets the value of the extension argument passed to heat. | ||
19 | /// </summary> | ||
20 | /// <value>The extension argument.</value> | ||
21 | public string ExtensionArgument { get; set; } | ||
22 | |||
23 | /// <summary> | ||
24 | /// Gets or sets the value of the root directory that is being harvested. | ||
25 | /// </summary> | ||
26 | /// <value>The root directory being harvested.</value> | ||
27 | public string RootDirectory { get; set; } | ||
28 | |||
29 | /// <summary> | ||
30 | /// Create an identifier based on passed file name | ||
31 | /// </summary> | ||
32 | /// <param name="name">File name to generate identifer from</param> | ||
33 | /// <returns></returns> | ||
34 | public string CreateIdentifierFromFilename(string filename) | ||
35 | { | ||
36 | return Common.GetIdentifierFromName(filename); | ||
37 | } | ||
38 | |||
39 | /// <summary> | ||
40 | /// Generate an identifier by hashing data from the row. | ||
41 | /// </summary> | ||
42 | /// <param name="prefix">Three letter or less prefix for generated row identifier.</param> | ||
43 | /// <param name="args">Information to hash.</param> | ||
44 | /// <returns>The generated identifier.</returns> | ||
45 | [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] | ||
46 | public string GenerateIdentifier(string prefix, params string[] args) | ||
47 | { | ||
48 | return Common.GenerateIdentifier(prefix, args); | ||
49 | } | ||
50 | |||
51 | /// <summary> | ||
52 | /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". | ||
53 | /// </summary> | ||
54 | /// <param name="fileSource">The Wix.File.Source value with "SourceDir\".</param> | ||
55 | /// <returns>The full path of the file.</returns> | ||
56 | public string ResolveFilePath(string fileSource) | ||
57 | { | ||
58 | if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) | ||
59 | { | ||
60 | string file = Path.GetFullPath(this.RootDirectory); | ||
61 | if (File.Exists(file)) | ||
62 | { | ||
63 | return file; | ||
64 | } | ||
65 | else | ||
66 | { | ||
67 | fileSource = fileSource.Substring(10); | ||
68 | fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | return fileSource; | ||
73 | } | ||
74 | } | ||
75 | } | ||