649 references to XMakeAttributes
Microsoft.Build (401)
BackEnd\Client\MSBuildClient.cs (1)
525
architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture()));
BackEnd\Components\Communications\NodeEndpointOutOfProc.cs (1)
40
architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(),
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (2)
73
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(), nodeReuse: enableNodeReuse, lowPriority: enableLowPriority));
92
Handshake hostHandshake = new(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(), nodeReuse: ComponentHost.BuildParameters.EnableNodeReuse, lowPriority: ComponentHost.BuildParameters.LowPriority));
BackEnd\Components\RequestBuilder\TaskBuilder.cs (8)
566
msbuildArchitecture = msbuildArchitecture == string.Empty ?
XMakeAttributes
.MSBuildArchitectureValues.any : msbuildArchitecture.Trim();
567
msbuildRuntime = msbuildRuntime == string.Empty ?
XMakeAttributes
.MSBuildRuntimeValues.any : msbuildRuntime.Trim();
722
if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.errorAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase))
726
else if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.warnAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase))
730
else if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.errorAndStop, expandedValue, StringComparison.OrdinalIgnoreCase))
1133
XMakeAttributes
.itemName,
1151
XMakeAttributes
.propertyName,
1164
XMakeAttributes
.taskParameter,
BackEnd\Node\OutOfProcServerNode.cs (1)
97
CommunicationsUtilities.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture()));
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
954
returnClass.FactoryIdentityParameters.Runtime ??
XMakeAttributes
.MSBuildRuntimeValues.any,
955
returnClass.FactoryIdentityParameters.Architecture ??
XMakeAttributes
.MSBuildArchitectureValues.any,
956
taskIdentityParameters.Runtime ??
XMakeAttributes
.MSBuildRuntimeValues.any,
957
taskIdentityParameters.Architecture ??
XMakeAttributes
.MSBuildArchitectureValues.any);
1825
TaskHostParameters taskHostParameters = new(
XMakeAttributes
.GetCurrentMSBuildRuntime(),
XMakeAttributes
.GetCurrentMSBuildArchitecture());
CommunicationsUtilities.cs (6)
961
architectureFlagToSet =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
968
if (taskHostParameters.Runtime.Equals(
XMakeAttributes
.MSBuildRuntimeValues.clr2, StringComparison.OrdinalIgnoreCase))
972
else if (taskHostParameters.Runtime.Equals(
XMakeAttributes
.MSBuildRuntimeValues.clr4, StringComparison.OrdinalIgnoreCase))
976
else if (taskHostParameters.Runtime.Equals(
XMakeAttributes
.MSBuildRuntimeValues.net, StringComparison.OrdinalIgnoreCase))
991
if (architectureFlagToSet.Equals(
XMakeAttributes
.MSBuildArchitectureValues.x64, StringComparison.OrdinalIgnoreCase))
995
else if (architectureFlagToSet.Equals(
XMakeAttributes
.MSBuildArchitectureValues.arm64, StringComparison.OrdinalIgnoreCase))
Construction\ProjectElement.cs (6)
112
return GetAttributeValue(
XMakeAttributes
.condition, ref _condition);
118
SetOrRemoveAttribute(
XMakeAttributes
.condition, value, ref _condition, "Set condition {0}", value);
132
return GetAttributeValue(
XMakeAttributes
.label);
138
SetOrRemoveAttribute(
XMakeAttributes
.label, value, "Set label {0}", value);
279
public virtual ElementLocation ConditionLocation => GetAttributeLocation(
XMakeAttributes
.condition);
285
public ElementLocation LabelLocation => GetAttributeLocation(
XMakeAttributes
.label);
Construction\ProjectImportElement.cs (12)
55
get => FileUtilities.FixFilePath(GetAttributeValue(
XMakeAttributes
.project));
58
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.project);
60
SetOrRemoveAttribute(
XMakeAttributes
.project, value, "Set Import Project {0}", value);
67
public ElementLocation ProjectLocation => GetAttributeLocation(
XMakeAttributes
.project);
74
get => FileUtilities.FixFilePath(GetAttributeValue(
XMakeAttributes
.sdk));
77
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.sdk);
80
SetOrRemoveAttribute(
XMakeAttributes
.sdk, value, "Set Import Sdk {0}", value);
90
get => GetAttributeValue(
XMakeAttributes
.sdkVersion);
95
SetOrRemoveAttribute(
XMakeAttributes
.sdkVersion, value, "Set Import Version {0}", value);
105
get => GetAttributeValue(
XMakeAttributes
.sdkMinimumVersion);
110
SetOrRemoveAttribute(
XMakeAttributes
.sdkMinimumVersion, value, "Set Import Minimum Version {0}", value);
118
public ElementLocation SdkLocation => GetAttributeLocation(
XMakeAttributes
.sdk);
Construction\ProjectItemElement.cs (46)
100
return GetAttributeValue(
XMakeAttributes
.include, ref _include);
105
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName,
XMakeAttributes
.include,
XMakeAttributes
.remove,
XMakeAttributes
.update);
106
SetOrRemoveAttribute(
XMakeAttributes
.include, value, ref _include, "Set item Include {0}", value);
122
return GetAttributeValue(
XMakeAttributes
.exclude, ref _exclude);
127
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Remove.Length == 0, "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.exclude,
XMakeAttributes
.remove);
128
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Update.Length == 0, "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.exclude,
XMakeAttributes
.update);
129
SetOrRemoveAttribute(
XMakeAttributes
.exclude, value, ref _exclude, "Set item Exclude {0}", value);
144
return GetAttributeValue(
XMakeAttributes
.remove, ref _remove);
149
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Include.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName,
XMakeAttributes
.include,
XMakeAttributes
.remove,
XMakeAttributes
.update);
150
SetOrRemoveAttribute(
XMakeAttributes
.remove, value, ref _remove, "Set item Remove {0}", value);
163
return GetAttributeValue(
XMakeAttributes
.update, ref _update);
168
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Include.Length == 0), "OM_OneOfAttributeButNotMore", ElementName,
XMakeAttributes
.include,
XMakeAttributes
.remove,
XMakeAttributes
.update);
169
SetOrRemoveAttribute(
XMakeAttributes
.update, value, ref _update, "Set item Update {0}", value);
183
return GetAttributeValue(
XMakeAttributes
.matchOnMetadata, ref _matchOnMetadata);
191
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length != 0, "OM_MatchOnMetadataOnlyApplicableToRemoveItems", ElementName,
XMakeAttributes
.matchOnMetadata);
192
SetOrRemoveAttribute(
XMakeAttributes
.matchOnMetadata, value, ref _matchOnMetadata, "Set item MatchOnMetadata {0}", value);
206
return GetAttributeValue(
XMakeAttributes
.matchOnMetadataOptions);
211
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || MatchOnMetadata.Length != 0, "OM_MatchOnMetadataOptionsOnlyApplicableToItemsWithMatchOnMetadata", ElementName,
XMakeAttributes
.matchOnMetadataOptions);
212
SetOrRemoveAttribute(
XMakeAttributes
.matchOnMetadataOptions, value, "Set item MatchOnMetadataOptions {0}", value);
226
return GetAttributeValue(
XMakeAttributes
.keepMetadata);
232
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.removeMetadata,
XMakeAttributes
.keepMetadata);
233
SetOrRemoveAttribute(
XMakeAttributes
.keepMetadata, value, "Set item KeepMetadata {0}", value);
247
return GetAttributeValue(
XMakeAttributes
.removeMetadata);
253
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || KeepMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.keepMetadata,
XMakeAttributes
.removeMetadata);
254
SetOrRemoveAttribute(
XMakeAttributes
.removeMetadata, value, "Set item RemoveMetadata {0}", value);
268
return GetAttributeValue(
XMakeAttributes
.keepDuplicates);
274
SetOrRemoveAttribute(
XMakeAttributes
.keepDuplicates, value, "Set item KeepDuplicates {0}", value);
296
public ElementLocation IncludeLocation => GetAttributeLocation(
XMakeAttributes
.include);
301
public ElementLocation ExcludeLocation => GetAttributeLocation(
XMakeAttributes
.exclude);
306
public ElementLocation RemoveLocation => GetAttributeLocation(
XMakeAttributes
.remove);
311
public ElementLocation UpdateLocation => GetAttributeLocation(
XMakeAttributes
.update);
316
public ElementLocation MatchOnMetadataLocation => GetAttributeLocation(
XMakeAttributes
.matchOnMetadata);
321
public ElementLocation MatchOnMetadataOptionsLocation => GetAttributeLocation(
XMakeAttributes
.matchOnMetadataOptions);
326
public ElementLocation KeepMetadataLocation => GetAttributeLocation(
XMakeAttributes
.keepMetadata);
331
public ElementLocation RemoveMetadataLocation => GetAttributeLocation(
XMakeAttributes
.removeMetadata);
336
public ElementLocation KeepDuplicatesLocation => GetAttributeLocation(
XMakeAttributes
.keepDuplicates);
Construction\ProjectOnErrorElement.cs (4)
54
return GetAttributeValue(
XMakeAttributes
.executeTargets);
59
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.executeTargets);
60
SetOrRemoveAttribute(
XMakeAttributes
.executeTargets, value, "Set OnError ExecuteTargets {0}", value);
68
public ElementLocation ExecuteTargetsLocation => GetAttributeLocation(
XMakeAttributes
.executeTargets);
Construction\ProjectOutputElement.cs (15)
54
return GetAttributeValue(
XMakeAttributes
.taskParameter);
61
SetOrRemoveAttribute(
XMakeAttributes
.taskParameter, value, "Set Output TaskParameter {0}", value);
88
return GetAttributeValue(
XMakeAttributes
.itemName);
93
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(PropertyName), "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.itemName,
XMakeAttributes
.propertyName);
94
SetOrRemoveAttribute(
XMakeAttributes
.itemName, value, "Set Output ItemType {0}", value);
108
return GetAttributeValue(
XMakeAttributes
.propertyName);
113
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(ItemType), "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.itemName,
XMakeAttributes
.propertyName);
114
SetOrRemoveAttribute(
XMakeAttributes
.propertyName, value, "Set Output PropertyName {0}", value);
121
public ElementLocation TaskParameterLocation => GetAttributeLocation(
XMakeAttributes
.taskParameter);
126
public ElementLocation PropertyNameLocation => GetAttributeLocation(
XMakeAttributes
.propertyName);
131
public ElementLocation ItemTypeLocation => GetAttributeLocation(
XMakeAttributes
.itemName);
145
XMakeAttributes
.propertyName,
146
XMakeAttributes
.itemName);
Construction\ProjectRootElement.cs (15)
499
get => GetAttributeValue(
XMakeAttributes
.defaultTargets);
502
set => SetOrRemoveAttribute(
XMakeAttributes
.defaultTargets, value, "Set Project DefaultTargets to '{0}'", value);
512
get => GetAttributeValue(
XMakeAttributes
.initialTargets);
515
set => SetOrRemoveAttribute(
XMakeAttributes
.initialTargets, value, "Set project InitialTargets to '{0}'", value);
527
get => GetAttributeValue(
XMakeAttributes
.sdk);
530
set => SetOrRemoveAttribute(
XMakeAttributes
.sdk, value, "Set project Sdk to '{0}'", value);
540
get => GetAttributeValue(
XMakeAttributes
.treatAsLocalProperty);
543
set => SetOrRemoveAttribute(
XMakeAttributes
.treatAsLocalProperty, value, "Set project TreatAsLocalProperty to '{0}'", value);
553
get => GetAttributeValue(
XMakeAttributes
.toolsVersion);
556
set => SetOrRemoveAttribute(
XMakeAttributes
.toolsVersion, value, "Set project ToolsVersion {0}", value);
665
public ElementLocation ToolsVersionLocation => GetAttributeLocation(
XMakeAttributes
.toolsVersion);
670
public ElementLocation DefaultTargetsLocation => GetAttributeLocation(
XMakeAttributes
.defaultTargets);
675
public ElementLocation InitialTargetsLocation => GetAttributeLocation(
XMakeAttributes
.initialTargets);
680
public ElementLocation SdkLocation => GetAttributeLocation(
XMakeAttributes
.sdk);
685
public ElementLocation TreatAsLocalPropertyLocation => GetAttributeLocation(
XMakeAttributes
.treatAsLocalProperty);
Construction\ProjectSdkElement.cs (10)
46
get => GetAttributeValue(
XMakeAttributes
.sdkName);
49
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.sdkName);
50
SetOrRemoveAttribute(
XMakeAttributes
.sdkName, value, $"Set SDK Name to {value}",
XMakeAttributes
.sdkName);
59
get => GetAttributeValue(
XMakeAttributes
.sdkVersion);
62
SetOrRemoveAttribute(
XMakeAttributes
.sdkVersion, value, $"Set SDK Version to {value}",
XMakeAttributes
.sdkVersion);
71
get => GetAttributeValue(
XMakeAttributes
.sdkMinimumVersion);
74
SetOrRemoveAttribute(
XMakeAttributes
.sdkMinimumVersion, value, $"Set SDK MinimumVersion to {value}",
XMakeAttributes
.sdkMinimumVersion);
Construction\ProjectTargetElement.cs (30)
94
string unescapedValue = EscapingUtilities.UnescapeAll(GetAttributeValue(
XMakeAttributes
.name));
115
SetOrRemoveAttribute(
XMakeAttributes
.name, unescapedValue, "Set target Name {0}", value);
130
return GetAttributeValue(
XMakeAttributes
.inputs);
135
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.inputs);
136
SetOrRemoveAttribute(
XMakeAttributes
.inputs, value, "Set target Inputs {0}", value);
150
return GetAttributeValue(
XMakeAttributes
.outputs);
155
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.outputs);
156
SetOrRemoveAttribute(
XMakeAttributes
.outputs, value, "Set target Outputs {0}", value);
170
string value = GetAttributeValue(
XMakeAttributes
.keepDuplicateOutputs);
183
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.keepDuplicateOutputs);
184
SetOrRemoveAttribute(
XMakeAttributes
.keepDuplicateOutputs, value, "Set target KeepDuplicateOutputs {0}", value);
198
return GetAttributeValue(
XMakeAttributes
.dependsOnTargets);
203
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.dependsOnTargets);
204
SetOrRemoveAttribute(
XMakeAttributes
.dependsOnTargets, value, "Set target DependsOnTargets {0}", value);
218
return GetAttributeValue(
XMakeAttributes
.beforeTargets);
223
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.beforeTargets);
224
SetOrRemoveAttribute(
XMakeAttributes
.beforeTargets, value, "Set target BeforeTargets {0}", value);
238
return GetAttributeValue(
XMakeAttributes
.afterTargets);
243
ErrorUtilities.VerifyThrowArgumentNull(value,
XMakeAttributes
.afterTargets);
244
SetOrRemoveAttribute(
XMakeAttributes
.afterTargets, value, "Set target AfterTargets {0}", value);
259
return GetAttributeValue(
XMakeAttributes
.returns, true /* If the element is not there, return null */);
272
XMakeAttributes
.returns,
293
public ElementLocation NameLocation => GetAttributeLocation(
XMakeAttributes
.name);
298
public ElementLocation InputsLocation => GetAttributeLocation(
XMakeAttributes
.inputs);
303
public ElementLocation OutputsLocation => GetAttributeLocation(
XMakeAttributes
.outputs);
312
ElementLocation location = GetAttributeLocation(
XMakeAttributes
.keepDuplicateOutputs);
327
public ElementLocation DependsOnTargetsLocation => GetAttributeLocation(
XMakeAttributes
.dependsOnTargets);
332
public ElementLocation BeforeTargetsLocation => GetAttributeLocation(
XMakeAttributes
.beforeTargets);
337
public ElementLocation ReturnsLocation => GetAttributeLocation(
XMakeAttributes
.returns);
342
public ElementLocation AfterTargetsLocation => GetAttributeLocation(
XMakeAttributes
.afterTargets);
Construction\ProjectTaskElement.cs (12)
70
return GetAttributeValue(
XMakeAttributes
.continueOnError);
76
SetOrRemoveAttribute(
XMakeAttributes
.continueOnError, value, "Set task ContinueOnError {0}", value);
90
return GetAttributeValue(
XMakeAttributes
.msbuildRuntime);
96
SetOrRemoveAttribute(
XMakeAttributes
.msbuildRuntime, value, "Set task MSBuildRuntime {0}", value);
110
return GetAttributeValue(
XMakeAttributes
.msbuildArchitecture);
116
SetOrRemoveAttribute(
XMakeAttributes
.msbuildArchitecture, value, "Set task MSBuildArchitecture {0}", value);
194
public ElementLocation ContinueOnErrorLocation => GetAttributeLocation(
XMakeAttributes
.continueOnError);
200
public ElementLocation MSBuildRuntimeLocation => GetAttributeLocation(
XMakeAttributes
.msbuildRuntime);
206
public ElementLocation MSBuildArchitectureLocation => GetAttributeLocation(
XMakeAttributes
.msbuildArchitecture);
327
ErrorUtilities.VerifyThrowArgument(!
XMakeAttributes
.IsSpecialTaskAttribute(name), "CannotAccessKnownAttributes", name);
376
if (!
XMakeAttributes
.IsSpecialTaskAttribute(attribute.Name))
448
if (!
XMakeAttributes
.IsSpecialTaskAttribute(attribute.Name))
Construction\ProjectUsingTaskBodyElement.cs (3)
88
string evaluateAttribute = GetAttributeValue(
XMakeAttributes
.evaluate);
100
SetOrRemoveAttribute(
XMakeAttributes
.evaluate, value, "Set usingtask Evaluate {0}", value);
121
public ElementLocation EvaluateLocation => GetAttributeLocation(
XMakeAttributes
.evaluate) ?? Location;
Construction\ProjectUsingTaskElement.cs (30)
52
GetAttributeValue(
XMakeAttributes
.assemblyFile));
56
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.assemblyName);
57
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyName), "OM_EitherAttributeButNotBoth", ElementName,
XMakeAttributes
.assemblyFile,
XMakeAttributes
.assemblyName);
59
SetOrRemoveAttribute(
XMakeAttributes
.assemblyFile, value, "Set usingtask AssemblyFile {0}", value);
69
get => GetAttributeValue(
XMakeAttributes
.assemblyName);
73
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.assemblyName);
74
ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyFile), "OM_EitherAttributeButNotBoth", XMakeElements.usingTask,
XMakeAttributes
.assemblyFile,
XMakeAttributes
.assemblyName);
75
SetOrRemoveAttribute(
XMakeAttributes
.assemblyName, value, "Set usingtask AssemblyName {0}", value);
84
get => GetAttributeValue(
XMakeAttributes
.taskName);
88
ErrorUtilities.VerifyThrowArgumentLength(value,
XMakeAttributes
.taskName);
89
SetOrRemoveAttribute(
XMakeAttributes
.taskName, value, "Set usingtask TaskName {0}", value);
98
get => GetAttributeValue(
XMakeAttributes
.taskFactory);
102
SetOrRemoveAttribute(
XMakeAttributes
.taskFactory, value, "Set usingtask TaskFactory {0}", value);
111
get => GetAttributeValue(
XMakeAttributes
.runtime);
115
SetOrRemoveAttribute(
XMakeAttributes
.runtime, value, "Set usingtask Runtime {0}", value);
124
get => GetAttributeValue(
XMakeAttributes
.architecture);
128
SetOrRemoveAttribute(
XMakeAttributes
.architecture, value, "Set usingtask Architecture {0}", value);
137
get => GetAttributeValue(
XMakeAttributes
.overrideUsingTask);
141
SetOrRemoveAttribute(
XMakeAttributes
.overrideUsingTask, value, "Set usingtask Override {0}", value);
172
public ElementLocation TaskNameLocation => GetAttributeLocation(
XMakeAttributes
.taskName);
177
public ElementLocation AssemblyFileLocation => GetAttributeLocation(
XMakeAttributes
.assemblyFile);
182
public ElementLocation AssemblyNameLocation => GetAttributeLocation(
XMakeAttributes
.assemblyName);
187
public ElementLocation RuntimeLocation => GetAttributeLocation(
XMakeAttributes
.runtime);
192
public ElementLocation ArchitectureLocation => GetAttributeLocation(
XMakeAttributes
.architecture);
197
public ElementLocation TaskFactoryLocation => GetAttributeLocation(
XMakeAttributes
.taskFactory);
202
public ElementLocation OverrideLocation => GetAttributeLocation(
XMakeAttributes
.overrideUsingTask);
238
XMakeAttributes
.assemblyFile,
239
XMakeAttributes
.assemblyName);
Construction\ProjectUsingTaskParameterElement.cs (9)
90
string typeAttribute = GetAttributeValue(
XMakeAttributes
.parameterType);
97
SetOrRemoveAttribute(
XMakeAttributes
.parameterType, value, "Set usingtaskparameter ParameterType {0}", value);
108
string outputAttribute = GetAttributeValue(
XMakeAttributes
.output);
114
SetOrRemoveAttribute(
XMakeAttributes
.output, value, "Set usingtaskparameter Output {0}", value);
125
string requiredAttribute = GetAttributeValue(
XMakeAttributes
.required);
131
SetOrRemoveAttribute(
XMakeAttributes
.required, value, "Set usingtaskparameter Required {0}", value);
152
public ElementLocation ParameterTypeLocation => GetAttributeLocation(
XMakeAttributes
.parameterType) ?? Location;
159
public ElementLocation OutputLocation => GetAttributeLocation(
XMakeAttributes
.output) ?? Location;
166
public ElementLocation RequiredLocation => GetAttributeLocation(
XMakeAttributes
.required) ?? Location;
Construction\Solution\ProjectInSolution.cs (2)
20
using XMakeAttributes = Microsoft.Build.Shared.
XMakeAttributes
;
341
XMakeAttributes
.defaultXmlNamespace,
Evaluation\Evaluator.cs (4)
2053
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValue", string.Empty,
XMakeAttributes
.project, XMakeElements.import);
2083
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", EscapingUtilities.UnescapeAll(importExpressionEscapedItem),
XMakeAttributes
.project, XMakeElements.import, ex.Message);
2128
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", importFileUnescaped,
XMakeAttributes
.project, XMakeElements.import, ex.Message);
2545
ProjectErrorUtilities.ThrowInvalidProject(importElement.Location, "InvalidAttributeValueWithException", importExpandedWithDefaultPath,
XMakeAttributes
.project, XMakeElements.import, ex.Message);
Evaluation\IntrinsicFunctions.cs (12)
492
if (!
XMakeAttributes
.IsValidMSBuildRuntimeValue(runtime))
494
ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", runtime, "Runtime",
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildRuntimeValues.any);
497
if (!
XMakeAttributes
.IsValidMSBuildArchitectureValue(architecture))
499
ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", architecture, "Architecture",
XMakeAttributes
.MSBuildArchitectureValues.x86,
XMakeAttributes
.MSBuildArchitectureValues.x64,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
502
runtime =
XMakeAttributes
.GetExplicitMSBuildRuntime(runtime);
503
architecture =
XMakeAttributes
.GetExplicitMSBuildArchitecture(architecture);
Evaluation\Preprocessor.cs (15)
244
string outerInitialTargets = destinationDocument.DocumentElement.GetAttribute(
XMakeAttributes
.initialTargets).Trim();
245
string innerInitialTargets = ((XmlElement)child).GetAttribute(
XMakeAttributes
.initialTargets).Trim();
254
destinationDocument.DocumentElement.SetAttribute(
XMakeAttributes
.initialTargets, outerInitialTargets + innerInitialTargets);
258
string outerDefaultTargets = destinationDocument.DocumentElement.GetAttribute(
XMakeAttributes
.defaultTargets).Trim();
262
string innerDefaultTargets = ((XmlElement)child).GetAttribute(
XMakeAttributes
.defaultTargets).Trim();
266
destinationDocument.DocumentElement.SetAttribute(
XMakeAttributes
.defaultTargets, innerDefaultTargets);
281
string importCondition = ((XmlElement)child).GetAttribute(
XMakeAttributes
.condition);
283
string importProject = ((XmlElement)child).GetAttribute(
XMakeAttributes
.project).Replace("--", "__");
284
string importSdk = ((XmlElement)child).GetAttribute(
XMakeAttributes
.sdk);
285
string sdk = importSdk.Length > 0 ? $" {
XMakeAttributes
.sdk}=\"{importSdk}\"" : String.Empty;
288
string projectSdk = source.NodeType == XmlNodeType.Element && String.Equals(XMakeElements.project, source.Name, StringComparison.Ordinal) ? ((XmlElement)source).GetAttribute(
XMakeAttributes
.sdk) : String.Empty;
312
$"\r\n This import was added implicitly because the {XMakeElements.project} element's {
XMakeAttributes
.sdk} attribute specified \"{importSdk}\".";
339
string importGroupCondition = ((XmlElement)child).GetAttribute(
XMakeAttributes
.condition);
353
if (clone.NodeType == XmlNodeType.Element && String.Equals(XMakeElements.project, child.Name, StringComparison.Ordinal) && clone.Attributes?[
XMakeAttributes
.sdk] != null)
355
clone.Attributes.Remove(clone.Attributes[
XMakeAttributes
.sdk]);
Evaluation\ProjectParser.cs (96)
31
private static readonly HashSet<string> ValidAttributesOnlyConditionAndLabel = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label };
36
private static readonly HashSet<string> KnownAttributesOnItem = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.include,
XMakeAttributes
.exclude,
XMakeAttributes
.remove,
XMakeAttributes
.keepMetadata,
XMakeAttributes
.removeMetadata,
XMakeAttributes
.keepDuplicates,
XMakeAttributes
.update,
XMakeAttributes
.matchOnMetadata,
XMakeAttributes
.matchOnMetadataOptions };
46
private static readonly HashSet<string> ValidAttributesOnImport = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.project,
XMakeAttributes
.sdk,
XMakeAttributes
.sdkVersion,
XMakeAttributes
.sdkMinimumVersion };
51
private static readonly HashSet<string> ValidAttributesOnUsingTask = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.taskName,
XMakeAttributes
.assemblyFile,
XMakeAttributes
.assemblyName,
XMakeAttributes
.taskFactory,
XMakeAttributes
.architecture,
XMakeAttributes
.runtime,
XMakeAttributes
.requiredPlatform,
XMakeAttributes
.requiredRuntime,
XMakeAttributes
.overrideUsingTask };
56
private static readonly HashSet<string> ValidAttributesOnTarget = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.name,
XMakeAttributes
.inputs,
XMakeAttributes
.outputs,
XMakeAttributes
.keepDuplicateOutputs,
XMakeAttributes
.dependsOnTargets,
XMakeAttributes
.beforeTargets,
XMakeAttributes
.afterTargets,
XMakeAttributes
.returns };
61
private static readonly HashSet<string> ValidAttributesOnOnError = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.executeTargets };
66
private static readonly HashSet<string> ValidAttributesOnOutput = new HashSet<string> {
XMakeAttributes
.condition,
XMakeAttributes
.label,
XMakeAttributes
.taskParameter,
XMakeAttributes
.itemName,
XMakeAttributes
.propertyName };
71
private static readonly HashSet<string> ValidAttributesOnUsingTaskParameter = new HashSet<string> {
XMakeAttributes
.parameterType,
XMakeAttributes
.output,
XMakeAttributes
.required };
76
private static readonly HashSet<string> ValidAttributesOnUsingTaskBody = new HashSet<string> {
XMakeAttributes
.evaluate };
143
XMakeAttributes
.defaultXmlNamespace);
264
string include = element.GetAttribute(
XMakeAttributes
.include);
265
string exclude = element.GetAttribute(
XMakeAttributes
.exclude);
266
string remove = element.GetAttribute(
XMakeAttributes
.remove);
267
string update = element.GetAttribute(
XMakeAttributes
.update);
271
if (element.HasAttribute(
XMakeAttributes
.include))
274
exclusiveItemOperation =
XMakeAttributes
.include;
276
if (element.HasAttribute(
XMakeAttributes
.remove))
279
exclusiveItemOperation =
XMakeAttributes
.remove;
281
if (element.HasAttribute(
XMakeAttributes
.update))
284
exclusiveItemOperation =
XMakeAttributes
.update;
290
XmlAttributeWithLocation errorAttribute = remove.Length > 0 ? (XmlAttributeWithLocation)element.Attributes[
XMakeAttributes
.remove] : (XmlAttributeWithLocation)element.Attributes[
XMakeAttributes
.update];
298
ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(exclude.Length == 0 || include.Length > 0, (XmlAttributeWithLocation)element.Attributes[
XMakeAttributes
.exclude]);
301
ProjectErrorUtilities.VerifyThrowInvalidProject(include.Length > 0 || element.Attributes[
XMakeAttributes
.include] == null, element.Location, "MissingRequiredAttribute",
XMakeAttributes
.include, itemType);
304
ProjectErrorUtilities.VerifyThrowInvalidProject(remove.Length > 0 || element.Attributes[
XMakeAttributes
.remove] == null, element.Location, "MissingRequiredAttribute",
XMakeAttributes
.remove, itemType);
307
ProjectErrorUtilities.VerifyThrowInvalidProject(update.Length > 0 || element.Attributes[
XMakeAttributes
.update] == null, element.Location, "MissingRequiredAttribute",
XMakeAttributes
.update, itemType);
457
ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element,
XMakeAttributes
.project);
461
if (element.HasAttribute(
XMakeAttributes
.sdk))
464
ProjectXmlUtilities.GetAttributeValue(element,
XMakeAttributes
.sdk, nullIfNotExists: true),
465
ProjectXmlUtilities.GetAttributeValue(element,
XMakeAttributes
.sdkVersion, nullIfNotExists: true),
466
ProjectXmlUtilities.GetAttributeValue(element,
XMakeAttributes
.sdkMinimumVersion, nullIfNotExists: true));
511
ProjectErrorUtilities.VerifyThrowInvalidProject(element.GetAttribute(
XMakeAttributes
.taskName).Length > 0, element.Location, "ProjectTaskNameEmpty");
513
string assemblyName = element.GetAttribute(
XMakeAttributes
.assemblyName);
514
string assemblyFile = element.GetAttribute(
XMakeAttributes
.assemblyFile);
521
XMakeAttributes
.assemblyName,
522
XMakeAttributes
.assemblyFile);
524
ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element,
XMakeAttributes
.assemblyName);
525
ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element,
XMakeAttributes
.assemblyFile);
575
ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element,
XMakeAttributes
.name);
578
string targetName = EscapingUtilities.UnescapeAll(ProjectXmlUtilities.GetAttributeValue(element,
XMakeAttributes
.name));
583
ProjectErrorUtilities.ThrowInvalidProject(element.GetAttributeLocation(
XMakeAttributes
.name), "NameInvalid", targetName, targetName[indexOfSpecialCharacter]);
617
ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(childElement,
XMakeAttributes
.executeTargets);
656
!
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(attribute.Name),
684
ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element,
XMakeAttributes
.taskParameter);
687
XmlAttributeWithLocation itemNameAttribute = element.GetAttributeWithLocation(
XMakeAttributes
.itemName);
688
XmlAttributeWithLocation propertyNameAttribute = element.GetAttributeWithLocation(
XMakeAttributes
.propertyName);
696
ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, itemNameAttribute,
XMakeAttributes
.itemName);
697
ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, propertyNameAttribute,
XMakeAttributes
.propertyName);
817
ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element,
XMakeAttributes
.condition);
897
if (string.IsNullOrEmpty(element.GetAttribute(
XMakeAttributes
.sdkName)))
Instance\TaskFactories\AssemblyTaskFactory.cs (26)
447
??
XMakeAttributes
.GetCurrentMSBuildRuntime();
452
??
XMakeAttributes
.GetCurrentMSBuildArchitecture();
530
if (!
XMakeAttributes
.IsValidMSBuildRuntimeValue(identityParameters.Runtime))
538
XMakeAttributes
.MSBuildRuntimeValues.clr2,
539
XMakeAttributes
.MSBuildRuntimeValues.clr4,
540
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
541
XMakeAttributes
.MSBuildRuntimeValues.any);
547
if (!
XMakeAttributes
.IsValidMSBuildArchitectureValue(identityParameters.Architecture))
555
XMakeAttributes
.MSBuildArchitectureValues.x86,
556
XMakeAttributes
.MSBuildArchitectureValues.x64,
557
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture,
558
XMakeAttributes
.MSBuildArchitectureValues.any);
575
if (
XMakeAttributes
.RuntimeValuesMatch(taskIdentityParameters.Runtime, factoryIdentityParameters.Runtime))
577
if (
XMakeAttributes
.ArchitectureValuesMatch(taskIdentityParameters.Architecture, factoryIdentityParameters.Architecture))
603
string normalizedRuntime =
XMakeAttributes
.GetExplicitMSBuildRuntime(factoryIdentityParameters.Runtime);
604
string normalizedArch =
XMakeAttributes
.GetExplicitMSBuildArchitecture(factoryIdentityParameters.Architecture);
613
string normalizedRuntime =
XMakeAttributes
.GetExplicitMSBuildRuntime(taskIdentityParameters.Runtime);
614
string normalizedArch =
XMakeAttributes
.GetExplicitMSBuildArchitecture(taskIdentityParameters.Architecture);
621
if (!
XMakeAttributes
.TryMergeRuntimeValues(taskIdentityParameters.Runtime, factoryIdentityParameters.Runtime, out var mergedRuntime))
627
if (!
XMakeAttributes
.TryMergeArchitectureValues(taskIdentityParameters.Architecture, factoryIdentityParameters.Architecture, out var mergedArchitecture))
648
!currentParams.Runtime.Equals(
XMakeAttributes
.MSBuildRuntimeValues.net, StringComparison.OrdinalIgnoreCase))
694
string currentRuntime =
XMakeAttributes
.GetExplicitMSBuildRuntime(
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime);
696
if (!currentRuntime.Equals(
XMakeAttributes
.GetExplicitMSBuildRuntime(mergedParameters.Runtime), StringComparison.OrdinalIgnoreCase))
705
string currentArchitecture =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
707
if (!currentArchitecture.Equals(
XMakeAttributes
.GetExplicitMSBuildArchitecture(mergedParameters.Architecture), StringComparison.OrdinalIgnoreCase))
Instance\TaskRegistry.cs (15)
315
XMakeAttributes
.name,
340
XMakeAttributes
.assemblyFile,
349
XMakeAttributes
.assemblyName,
410
ProjectErrorUtilities.ThrowInvalidProject(projectUsingTaskXml.Location, "InvalidAttributeValueWithException", assemblyFile,
XMakeAttributes
.assemblyFile, XMakeElements.usingTask, ex.Message);
429
runtime == string.Empty ?
XMakeAttributes
.MSBuildRuntimeValues.any : runtime,
430
architecture == string.Empty ?
XMakeAttributes
.MSBuildArchitectureValues.any : architecture);
969
if (!
XMakeAttributes
.RuntimeValuesMatch(runtimeX, runtimeY))
974
if (!
XMakeAttributes
.ArchitectureValuesMatch(architectureX, architectureY))
1547
XMakeAttributes
.runtime,
1548
XMakeAttributes
.architecture,
1714
XMakeAttributes
.evaluate,
1755
XMakeAttributes
.parameterType,
1780
XMakeAttributes
.parameterType,
1793
XMakeAttributes
.output,
1819
XMakeAttributes
.required,
TypeLoader.cs (1)
15
using static Microsoft.Build.Shared.
XMakeAttributes
;
Utilities\EngineFileUtilities.cs (12)
404
XMakeAttributes
.exclude,
417
XMakeAttributes
.include,
433
XMakeAttributes
.include,
446
XMakeAttributes
.project,
455
XMakeAttributes
.include,
464
XMakeAttributes
.exclude,
482
XMakeAttributes
.include,
497
XMakeAttributes
.exclude,
509
XMakeAttributes
.include,
522
XMakeAttributes
.project,
532
XMakeAttributes
.include,
542
XMakeAttributes
.exclude,
Xml\ProjectXmlUtilities.cs (1)
94
else if (string.Equals(element.NamespaceURI,
XMakeAttributes
.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase))
Microsoft.Build.Engine.UnitTests (248)
BackEnd\AssemblyTaskFactory_Tests.cs (32)
183
TaskHostParameters factoryIdentityParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
186
TaskHostParameters taskIdentityParameters = new(
XMakeAttributes
.GetCurrentMSBuildRuntime(),
XMakeAttributes
.GetCurrentMSBuildArchitecture());
198
TaskHostParameters factoryIdentityParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
202
TaskHostParameters taskIdentityParameters = new(
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
283
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildArchitectureValues.any);
321
TaskHostParameters taskParameters = new (
XMakeAttributes
.GetCurrentMSBuildRuntime(),
XMakeAttributes
.GetCurrentMSBuildArchitecture());
359
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildArchitectureValues.any);
399
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.GetCurrentMSBuildArchitecture());
439
TaskHostParameters factoryParameters = new (
XMakeAttributes
.GetCurrentMSBuildRuntime());
443
TaskHostParameters taskParameters = new (architecture:
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
481
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildArchitectureValues.any);
521
TaskHostParameters taskParameters = new(
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildArchitectureValues.any);
559
TaskHostParameters factoryParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.clr2);
563
TaskHostParameters taskParameters = new(architecture:
XMakeAttributes
.MSBuildArchitectureValues.any);
639
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildArchitectureValues.any);
681
TaskHostParameters taskParameters = new (
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildArchitectureValues.any);
717
TaskHostParameters factoryParameters = new TaskHostParameters(
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildArchitectureValues.any);
752
TaskHostParameters taskParameters = new(
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
BackEnd\TaskRegistry_Tests.cs (84)
524
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
525
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
533
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
534
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
542
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
543
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
551
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
552
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
587
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
598
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
670
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
671
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
677
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
678
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
681
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
682
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
688
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
689
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
692
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
693
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
699
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
700
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
708
runtime:
XMakeAttributes
.MSBuildRuntimeValues.any,
709
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
712
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
713
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
743
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
744
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
750
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
751
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
759
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
760
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
763
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
764
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
800
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
801
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
807
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
808
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
811
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
812
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
818
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
819
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
822
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
823
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
829
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
830
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
833
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
834
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
840
runtime:
XMakeAttributes
.MSBuildRuntimeValues.any,
841
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
844
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
845
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
851
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
852
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
855
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
856
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
862
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
863
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
871
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
872
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
875
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
876
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
910
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
911
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
914
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
915
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
922
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
923
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
926
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
927
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
953
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
954
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
957
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
958
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
964
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
965
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
973
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
974
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
977
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
978
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
984
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
985
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
1947
parameters = new(runtime ??
XMakeAttributes
.MSBuildRuntimeValues.any, architecture ??
XMakeAttributes
.MSBuildArchitectureValues.any);
XmakeAttributes_Tests.cs (132)
19
Assert.False(
XMakeAttributes
.IsSpecialTaskAttribute("NotAnAttribute"));
20
Assert.True(
XMakeAttributes
.IsSpecialTaskAttribute(
XMakeAttributes
.xmlns));
21
Assert.True(
XMakeAttributes
.IsSpecialTaskAttribute(
XMakeAttributes
.continueOnError));
22
Assert.True(
XMakeAttributes
.IsSpecialTaskAttribute(
XMakeAttributes
.condition));
23
Assert.True(
XMakeAttributes
.IsSpecialTaskAttribute(
XMakeAttributes
.msbuildArchitecture));
24
Assert.True(
XMakeAttributes
.IsSpecialTaskAttribute(
XMakeAttributes
.msbuildRuntime));
30
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute("NotAnAttribute"));
31
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(
XMakeAttributes
.include));
32
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(
XMakeAttributes
.continueOnError));
33
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(
XMakeAttributes
.condition));
34
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(
XMakeAttributes
.msbuildArchitecture));
35
Assert.False(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute(
XMakeAttributes
.msbuildRuntime));
36
Assert.True(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute("continueOnError"));
37
Assert.True(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute("condition"));
38
Assert.True(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute("MsbuildRuntime"));
39
Assert.True(
XMakeAttributes
.IsBadlyCasedSpecialTaskAttribute("msbuildarchitecture"));
45
Assert.False(
XMakeAttributes
.IsNonBatchingTargetAttribute("NotAnAttribute"));
46
Assert.True(
XMakeAttributes
.IsNonBatchingTargetAttribute(
XMakeAttributes
.dependsOnTargets));
47
Assert.True(
XMakeAttributes
.IsNonBatchingTargetAttribute(
XMakeAttributes
.name));
48
Assert.True(
XMakeAttributes
.IsNonBatchingTargetAttribute(
XMakeAttributes
.condition));
54
Assert.True(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime));
55
Assert.True(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildRuntimeValues.net));
56
Assert.True(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildRuntimeValues.clr4));
57
Assert.True(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildRuntimeValues.any));
59
Assert.True(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildRuntimeValues.net));
65
Assert.False(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildRuntimeValues.clr2));
67
Assert.False(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.clr2));
68
Assert.False(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.net));
69
Assert.False(
XMakeAttributes
.RuntimeValuesMatch(
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildRuntimeValues.net));
73
[InlineData(
XMakeAttributes
.MSBuildRuntimeValues.any,
XMakeAttributes
.MSBuildRuntimeValues.clr4, true,
XMakeAttributes
.MSBuildRuntimeValues.clr4)]
74
[InlineData(
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.any, true,
XMakeAttributes
.MSBuildRuntimeValues.clr4)]
75
[InlineData(
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildRuntimeValues.any, true,
XMakeAttributes
.MSBuildRuntimeValues.clr2)]
76
[InlineData(
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildRuntimeValues.clr2, false, null)]
77
[InlineData(
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.clr2, false, null)]
80
XMakeAttributes
.TryMergeRuntimeValues(left, right, out string mergedRuntime)
89
XMakeAttributes
.TryMergeRuntimeValues(
XMakeAttributes
.MSBuildRuntimeValues.any,
90
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
94
mergedRuntime.ShouldBe(
XMakeAttributes
.GetCurrentMSBuildRuntime());
100
XMakeAttributes
.TryMergeRuntimeValues(
101
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
102
XMakeAttributes
.MSBuildRuntimeValues.clr4,
104
mergedRuntime.ShouldBe(
XMakeAttributes
.MSBuildRuntimeValues.clr4);
106
XMakeAttributes
.TryMergeRuntimeValues(
107
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
108
XMakeAttributes
.MSBuildRuntimeValues.net,
116
XMakeAttributes
.TryMergeRuntimeValues(
117
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
118
XMakeAttributes
.MSBuildRuntimeValues.net,
120
mergedRuntime.ShouldBe(
XMakeAttributes
.MSBuildRuntimeValues.net);
122
XMakeAttributes
.TryMergeRuntimeValues(
123
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
124
XMakeAttributes
.MSBuildRuntimeValues.clr4,
132
string currentArchitecture =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
133
string notCurrentArchitecture = Environment.Is64BitProcess ?
XMakeAttributes
.MSBuildArchitectureValues.x86 :
XMakeAttributes
.MSBuildArchitectureValues.x64;
135
Assert.True(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.any,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture));
136
Assert.True(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.any,
XMakeAttributes
.MSBuildArchitectureValues.x64));
137
Assert.True(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.x86,
XMakeAttributes
.MSBuildArchitectureValues.any));
138
Assert.True(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture, currentArchitecture));
140
Assert.False(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture, notCurrentArchitecture));
141
Assert.False(
XMakeAttributes
.ArchitectureValuesMatch(
XMakeAttributes
.MSBuildArchitectureValues.x64,
XMakeAttributes
.MSBuildArchitectureValues.x86));
147
string currentArchitecture =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
148
string notCurrentArchitecture = Environment.Is64BitProcess ?
XMakeAttributes
.MSBuildArchitectureValues.x86 :
XMakeAttributes
.MSBuildArchitectureValues.x64;
151
Assert.True(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.any,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture, out mergedArchitecture));
154
Assert.True(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.any,
XMakeAttributes
.MSBuildArchitectureValues.x64, out mergedArchitecture));
155
Assert.Equal(
XMakeAttributes
.MSBuildArchitectureValues.x64, mergedArchitecture);
157
Assert.True(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.x86,
XMakeAttributes
.MSBuildArchitectureValues.any, out mergedArchitecture));
158
Assert.Equal(
XMakeAttributes
.MSBuildArchitectureValues.x86, mergedArchitecture);
160
Assert.True(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture, currentArchitecture, out mergedArchitecture));
163
Assert.False(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture, notCurrentArchitecture, out mergedArchitecture));
164
Assert.False(
XMakeAttributes
.TryMergeArchitectureValues(
XMakeAttributes
.MSBuildArchitectureValues.x64,
XMakeAttributes
.MSBuildArchitectureValues.x86, out mergedArchitecture));