diff options
author | Rob Mensching <rob@firegiant.com> | 2018-07-19 00:58:00 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2018-07-21 07:36:59 -0700 |
commit | 2724cfee4c163f3297ee25edfd2372767cfd4945 (patch) | |
tree | 8cdda34c83bea014a586a491e3b4b187ad8f16da /src/WixToolset.BuildTasks/Common.cs | |
parent | 4d40bef9cf51b8cff7e1f6a73fdf68b9722eb8a0 (diff) | |
download | wix-2724cfee4c163f3297ee25edfd2372767cfd4945.tar.gz wix-2724cfee4c163f3297ee25edfd2372767cfd4945.tar.bz2 wix-2724cfee4c163f3297ee25edfd2372767cfd4945.zip |
Move tool projects to Tools repo
Diffstat (limited to 'src/WixToolset.BuildTasks/Common.cs')
-rw-r--r-- | src/WixToolset.BuildTasks/Common.cs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/WixToolset.BuildTasks/Common.cs b/src/WixToolset.BuildTasks/Common.cs deleted file mode 100644 index 803e9d14..00000000 --- a/src/WixToolset.BuildTasks/Common.cs +++ /dev/null | |||
@@ -1,41 +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 | ||
4 | { | ||
5 | using System; | ||
6 | using System.Globalization; | ||
7 | using System.Text; | ||
8 | using System.Text.RegularExpressions; | ||
9 | |||
10 | /// <summary> | ||
11 | /// Common WixTasks utility methods and types. | ||
12 | /// </summary> | ||
13 | internal static class Common | ||
14 | { | ||
15 | /// <summary>Metadata key name to turn off harvesting of project references.</summary> | ||
16 | public const string DoNotHarvest = "DoNotHarvest"; | ||
17 | |||
18 | private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); | ||
19 | private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters | ||
20 | |||
21 | /// <summary> | ||
22 | /// Return an identifier based on passed file/directory name | ||
23 | /// </summary> | ||
24 | /// <param name="name">File/directory name to generate identifer from</param> | ||
25 | /// <returns>A version of the name that is a legal identifier.</returns> | ||
26 | /// <remarks>This is duplicated from WiX's Common class.</remarks> | ||
27 | internal static string GetIdentifierFromName(string name) | ||
28 | { | ||
29 | string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". | ||
30 | |||
31 | // MSI identifiers must begin with an alphabetic character or an | ||
32 | // underscore. Prefix all other values with an underscore. | ||
33 | if (AddPrefix.IsMatch(name)) | ||
34 | { | ||
35 | result = String.Concat("_", result); | ||
36 | } | ||
37 | |||
38 | return result; | ||
39 | } | ||
40 | } | ||
41 | } | ||