/
Constants.cs
198 lines (173 loc) · 9.33 KB
/
Constants.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
namespace Microsoft.Build.Shared
{
/// <summary>
/// Constants that we want to be shareable across all our assemblies.
/// </summary>
internal static class MSBuildConstants
{
/// <summary>
/// The name of the property that indicates the tools path
/// </summary>
internal const string ToolsPath = "MSBuildToolsPath";
/// <summary>
/// Name of the property that indicates the X64 tools path
/// </summary>
internal const string ToolsPath64 = "MSBuildToolsPath64";
/// <summary>
/// Name of the property that indicates the root of the SDKs folder
/// </summary>
internal const string SdksPath = "MSBuildSDKsPath";
/// <summary>
/// Name of the property that indicates that all warnings should be treated as errors.
/// </summary>
internal const string TreatWarningsAsErrors = "MSBuildTreatWarningsAsErrors";
/// <summary>
/// Name of the property that indicates a list of warnings to treat as errors.
/// </summary>
internal const string WarningsAsErrors = "MSBuildWarningsAsErrors";
/// <summary>
/// Name of the property that indicates the list of warnings to treat as messages.
/// </summary>
internal const string WarningsAsMessages = "MSBuildWarningsAsMessages";
/// <summary>
/// The name of the environment variable that users can specify to override where NuGet assemblies are loaded from in the NuGetSdkResolver.
/// </summary>
internal const string NuGetAssemblyPathEnvironmentVariableName = "MSBUILD_NUGET_PATH";
/// <summary>
/// The name of the target to run when a user specifies the /restore command-line argument.
/// </summary>
internal const string RestoreTargetName = "Restore";
/// <summary>
/// The most current Visual Studio Version known to this version of MSBuild.
/// </summary>
internal const string CurrentVisualStudioVersion = "16.0";
/// <summary>
/// The most current ToolsVersion known to this version of MSBuild.
/// </summary>
internal const string CurrentToolsVersion = "Current";
internal const string MSBuildDummyGlobalPropertyHeader = "MSBuildProjectInstance";
/// <summary>
/// The most current VSGeneralAssemblyVersion known to this version of MSBuild.
/// </summary>
internal const string CurrentAssemblyVersion = "15.1.0.0";
/// <summary>
/// Current version of this MSBuild Engine assembly in the form, e.g, "12.0"
/// </summary>
internal const string CurrentProductVersion = "16.0";
/// <summary>
/// Symbol used in ProjectReferenceTarget items to represent default targets
/// </summary>
internal const string DefaultTargetsMarker = ".default";
/// <summary>
/// Symbol used in ProjectReferenceTarget items to represent targets specified on the ProjectReference item
/// with fallback to default targets if the ProjectReference item has no targets specified.
/// </summary>
internal const string ProjectReferenceTargetsOrDefaultTargetsMarker = ".projectReferenceTargetsOrDefaultTargets";
// One-time allocations to avoid implicit allocations for Split(), Trim().
internal static readonly char[] SemicolonChar = { ';' };
internal static readonly char[] SpaceChar = { ' ' };
internal static readonly char[] SingleQuoteChar = { '\'' };
internal static readonly char[] EqualsChar = { '=' };
internal static readonly char[] ColonChar = { ':' };
internal static readonly char[] BackslashChar = { '\\' };
internal static readonly char[] NewlineChar = { '\n' };
internal static readonly char[] CrLf = { '\r', '\n' };
internal static readonly char[] ForwardSlash = { '/' };
internal static readonly char[] ForwardSlashBackslash = { '/', '\\' };
internal static readonly char[] WildcardChars = { '*', '?' };
internal static readonly string[] CharactersForExpansion = { "*", "?", "$(", "@(", "%" };
internal static readonly char[] CommaChar = { ',' };
internal static readonly char[] HyphenChar = { '-' };
internal static readonly char[] DirectorySeparatorChar = { Path.DirectorySeparatorChar };
internal static readonly char[] DotChar = { '.' };
internal static readonly string[] EnvironmentNewLine = { Environment.NewLine };
internal static readonly char[] PipeChar = { '|' };
internal static readonly char[] PathSeparatorChar = { Path.PathSeparator };
}
internal static class PropertyNames
{
/// <summary>
/// Specifies whether the current evaluation / build is happening during a graph build
/// </summary>
internal const string IsGraphBuild = nameof(IsGraphBuild);
internal const string InnerBuildProperty = nameof(InnerBuildProperty);
internal const string InnerBuildPropertyValues = nameof(InnerBuildPropertyValues);
}
// TODO: Remove these when VS gets updated to setup project cache plugins.
internal static class DesignTimeProperties
{
internal const string DesignTimeBuild = nameof(DesignTimeBuild);
internal const string BuildingProject = nameof(BuildingProject);
}
internal static class ItemTypeNames
{
/// <summary>
/// References to other msbuild projects
/// </summary>
internal const string ProjectReference = nameof(ProjectReference);
/// <summary>
/// Statically specifies what targets a project calls on its references
/// </summary>
internal const string ProjectReferenceTargets = nameof(ProjectReferenceTargets);
internal const string GraphIsolationExemptReference = nameof(GraphIsolationExemptReference);
/// <summary>
/// Declares a project cache plugin and its configuration.
/// </summary>
internal const string ProjectCachePlugin = nameof(ProjectCachePlugin);
}
/// <summary>
/// Constants naming well-known item metadata.
/// </summary>
internal static class ItemMetadataNames
{
internal const string fusionName = "FusionName";
internal const string hintPath = "HintPath";
internal const string assemblyFolderKey = "AssemblyFolderKey";
internal const string alias = "Alias";
internal const string aliases = "Aliases";
internal const string parentFile = "ParentFile";
internal const string privateMetadata = "Private";
internal const string copyLocal = "CopyLocal";
internal const string isRedistRoot = "IsRedistRoot";
internal const string redist = "Redist";
internal const string resolvedFrom = "ResolvedFrom";
internal const string destinationSubDirectory = "DestinationSubDirectory";
internal const string destinationSubPath = "DestinationSubPath";
internal const string specificVersion = "SpecificVersion";
internal const string link = "Link";
internal const string subType = "SubType";
internal const string executableExtension = "ExecutableExtension";
internal const string embedInteropTypes = "EmbedInteropTypes";
/// <summary>
/// The output path for a given item.
/// </summary>
internal const string targetPath = "TargetPath";
internal const string dependentUpon = "DependentUpon";
internal const string msbuildSourceProjectFile = "MSBuildSourceProjectFile";
internal const string msbuildSourceTargetName = "MSBuildSourceTargetName";
internal const string isPrimary = "IsPrimary";
internal const string targetFramework = "RequiredTargetFramework";
internal const string frameworkDirectory = "FrameworkDirectory";
internal const string version = "Version";
internal const string imageRuntime = "ImageRuntime";
internal const string winMDFile = "WinMDFile";
internal const string winMDFileType = "WinMDFileType";
internal const string msbuildReferenceSourceTarget = "ReferenceSourceTarget";
internal const string msbuildReferenceGrouping = "ReferenceGrouping";
internal const string msbuildReferenceGroupingDisplayName = "ReferenceGroupingDisplayName";
internal const string msbuildReferenceFromSDK = "ReferenceFromSDK";
internal const string winmdImplmentationFile = "Implementation";
internal const string projectReferenceOriginalItemSpec = "ProjectReferenceOriginalItemSpec";
internal const string IgnoreVersionForFrameworkReference = "IgnoreVersionForFrameworkReference";
internal const string frameworkFile = "FrameworkFile";
internal const string ProjectReferenceTargetsMetadataName = "Targets";
internal const string PropertiesMetadataName = "Properties";
internal const string UndefinePropertiesMetadataName = "UndefineProperties";
internal const string AdditionalPropertiesMetadataName = "AdditionalProperties";
internal const string ProjectConfigurationDescription = "ProjectConfigurationDescription";
}
}