741 references to XMakeAttributes
Microsoft.Build (437)
BackEnd\Client\MSBuildClient.cs (1)
539
return new ServerNodeHandshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture()));
BackEnd\Components\Communications\NodeEndpointOutOfProc.cs (1)
38
architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(),
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (2)
73
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(), nodeReuse: enableNodeReuse, lowPriority: enableLowPriority));
101
Handshake hostHandshake = new(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture(), nodeReuse: ComponentHost.BuildParameters.EnableNodeReuse, lowPriority: ComponentHost.BuildParameters.LowPriority));
BackEnd\Components\RequestBuilder\TaskBuilder.cs (10)
535
msbuildArchitecture = msbuildArchitecture == String.Empty ?
XMakeAttributes
.MSBuildArchitectureValues.any : msbuildArchitecture.Trim();
536
msbuildRuntime = msbuildRuntime == String.Empty ?
XMakeAttributes
.MSBuildRuntimeValues.any : msbuildRuntime.Trim();
538
taskIdentityParameters.Add(
XMakeAttributes
.runtime, msbuildRuntime);
539
taskIdentityParameters.Add(
XMakeAttributes
.architecture, msbuildArchitecture);
695
if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.errorAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase))
699
else if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.warnAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase))
703
else if (String.Equals(
XMakeAttributes
.ContinueOnErrorValues.errorAndStop, expandedValue, StringComparison.OrdinalIgnoreCase))
1106
XMakeAttributes
.itemName,
1124
XMakeAttributes
.propertyName,
1137
XMakeAttributes
.taskParameter,
BackEnd\Node\OutOfProcServerNode.cs (1)
104
CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet:
XMakeAttributes
.GetCurrentMSBuildArchitecture()));
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (8)
893
returnClass.FactoryIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out usingTaskRuntime);
894
returnClass.FactoryIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out usingTaskArchitecture);
897
taskIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out string taskRuntime);
898
taskIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out string taskArchitecture);
904
usingTaskRuntime ??
XMakeAttributes
.MSBuildRuntimeValues.any,
905
usingTaskArchitecture ??
XMakeAttributes
.MSBuildArchitectureValues.any,
906
taskRuntime ??
XMakeAttributes
.MSBuildRuntimeValues.any,
907
taskArchitecture ??
XMakeAttributes
.MSBuildArchitectureValues.any);
CommunicationsUtilities.cs (8)
620
architectureFlagToSet =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
624
ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(
XMakeAttributes
.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method.");
625
ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(
XMakeAttributes
.architecture, out string architecture), "Should always have an explicit architecture when we call this method.");
627
if (runtimeVersion.Equals(
XMakeAttributes
.MSBuildRuntimeValues.clr2, StringComparison.OrdinalIgnoreCase))
631
else if (runtimeVersion.Equals(
XMakeAttributes
.MSBuildRuntimeValues.clr4, StringComparison.OrdinalIgnoreCase))
635
else if (runtimeVersion.Equals(
XMakeAttributes
.MSBuildRuntimeValues.net, StringComparison.OrdinalIgnoreCase))
650
if (architectureFlagToSet.Equals(
XMakeAttributes
.MSBuildArchitectureValues.x64, StringComparison.OrdinalIgnoreCase))
654
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);
291
public ElementLocation IncludeLocation => GetAttributeLocation(
XMakeAttributes
.include);
296
public ElementLocation ExcludeLocation => GetAttributeLocation(
XMakeAttributes
.exclude);
301
public ElementLocation RemoveLocation => GetAttributeLocation(
XMakeAttributes
.remove);
306
public ElementLocation UpdateLocation => GetAttributeLocation(
XMakeAttributes
.update);
311
public ElementLocation MatchOnMetadataLocation => GetAttributeLocation(
XMakeAttributes
.matchOnMetadata);
316
public ElementLocation MatchOnMetadataOptionsLocation => GetAttributeLocation(
XMakeAttributes
.matchOnMetadataOptions);
321
public ElementLocation KeepMetadataLocation => GetAttributeLocation(
XMakeAttributes
.keepMetadata);
326
public ElementLocation RemoveMetadataLocation => GetAttributeLocation(
XMakeAttributes
.removeMetadata);
331
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)
481
get => GetAttributeValue(
XMakeAttributes
.defaultTargets);
484
set => SetOrRemoveAttribute(
XMakeAttributes
.defaultTargets, value, "Set Project DefaultTargets to '{0}'", value);
494
get => GetAttributeValue(
XMakeAttributes
.initialTargets);
497
set => SetOrRemoveAttribute(
XMakeAttributes
.initialTargets, value, "Set project InitialTargets to '{0}'", value);
509
get => GetAttributeValue(
XMakeAttributes
.sdk);
512
set => SetOrRemoveAttribute(
XMakeAttributes
.sdk, value, "Set project Sdk to '{0}'", value);
522
get => GetAttributeValue(
XMakeAttributes
.treatAsLocalProperty);
525
set => SetOrRemoveAttribute(
XMakeAttributes
.treatAsLocalProperty, value, "Set project TreatAsLocalProperty to '{0}'", value);
535
get => GetAttributeValue(
XMakeAttributes
.toolsVersion);
538
set => SetOrRemoveAttribute(
XMakeAttributes
.toolsVersion, value, "Set project ToolsVersion {0}", value);
647
public ElementLocation ToolsVersionLocation => GetAttributeLocation(
XMakeAttributes
.toolsVersion);
652
public ElementLocation DefaultTargetsLocation => GetAttributeLocation(
XMakeAttributes
.defaultTargets);
657
public ElementLocation InitialTargetsLocation => GetAttributeLocation(
XMakeAttributes
.initialTargets);
662
public ElementLocation SdkLocation => GetAttributeLocation(
XMakeAttributes
.sdk);
667
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)
15
using XMakeAttributes = Microsoft.Build.Shared.
XMakeAttributes
;
331
XMakeAttributes
.defaultXmlNamespace,
Evaluation\Evaluator.cs (4)
2002
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValue", String.Empty,
XMakeAttributes
.project, XMakeElements.import);
2032
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", EscapingUtilities.UnescapeAll(importExpressionEscapedItem),
XMakeAttributes
.project, XMakeElements.import, ex.Message);
2077
ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", importFileUnescaped,
XMakeAttributes
.project, XMakeElements.import, ex.Message);
2494
ProjectErrorUtilities.ThrowInvalidProject(importElement.Location, "InvalidAttributeValueWithException", importExpandedWithDefaultPath,
XMakeAttributes
.project, XMakeElements.import, ex.Message);
Evaluation\IntrinsicFunctions.cs (14)
475
if (!
XMakeAttributes
.IsValidMSBuildRuntimeValue(runtime))
477
ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", runtime, "Runtime",
XMakeAttributes
.MSBuildRuntimeValues.clr2,
XMakeAttributes
.MSBuildRuntimeValues.clr4,
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
XMakeAttributes
.MSBuildRuntimeValues.any);
480
if (!
XMakeAttributes
.IsValidMSBuildArchitectureValue(architecture))
482
ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", architecture, "Architecture",
XMakeAttributes
.MSBuildArchitectureValues.x86,
XMakeAttributes
.MSBuildArchitectureValues.x64,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
485
runtime =
XMakeAttributes
.GetExplicitMSBuildRuntime(runtime);
486
architecture =
XMakeAttributes
.GetExplicitMSBuildArchitecture(architecture);
489
parameters.Add(
XMakeAttributes
.runtime, runtime);
490
parameters.Add(
XMakeAttributes
.architecture, architecture);
Evaluation\Preprocessor.cs (15)
241
string outerInitialTargets = destinationDocument.DocumentElement.GetAttribute(
XMakeAttributes
.initialTargets).Trim();
242
string innerInitialTargets = ((XmlElement)child).GetAttribute(
XMakeAttributes
.initialTargets).Trim();
251
destinationDocument.DocumentElement.SetAttribute(
XMakeAttributes
.initialTargets, outerInitialTargets + innerInitialTargets);
255
string outerDefaultTargets = destinationDocument.DocumentElement.GetAttribute(
XMakeAttributes
.defaultTargets).Trim();
259
string innerDefaultTargets = ((XmlElement)child).GetAttribute(
XMakeAttributes
.defaultTargets).Trim();
263
destinationDocument.DocumentElement.SetAttribute(
XMakeAttributes
.defaultTargets, innerDefaultTargets);
278
string importCondition = ((XmlElement)child).GetAttribute(
XMakeAttributes
.condition);
280
string importProject = ((XmlElement)child).GetAttribute(
XMakeAttributes
.project).Replace("--", "__");
281
string importSdk = ((XmlElement)child).GetAttribute(
XMakeAttributes
.sdk);
282
string sdk = importSdk.Length > 0 ? $" {
XMakeAttributes
.sdk}=\"{importSdk}\"" : String.Empty;
285
string projectSdk = source.NodeType == XmlNodeType.Element && String.Equals(XMakeElements.project, source.Name, StringComparison.Ordinal) ? ((XmlElement)source).GetAttribute(
XMakeAttributes
.sdk) : String.Empty;
309
$"\r\n This import was added implicitly because the {XMakeElements.project} element's {
XMakeAttributes
.sdk} attribute specified \"{importSdk}\".";
336
string importGroupCondition = ((XmlElement)child).GetAttribute(
XMakeAttributes
.condition);
350
if (clone.NodeType == XmlNodeType.Element && String.Equals(XMakeElements.project, child.Name, StringComparison.Ordinal) && clone.Attributes?[
XMakeAttributes
.sdk] != null)
352
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 (45)
351
if (!mergedParameters.ContainsKey(
XMakeAttributes
.runtime))
353
mergedParameters[
XMakeAttributes
.runtime] =
XMakeAttributes
.GetCurrentMSBuildRuntime();
356
if (!mergedParameters.ContainsKey(
XMakeAttributes
.architecture))
358
mergedParameters[
XMakeAttributes
.architecture] =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
477
if (identityParameters.TryGetValue(
XMakeAttributes
.runtime, out runtime))
479
if (!
XMakeAttributes
.IsValidMSBuildRuntimeValue(runtime))
487
XMakeAttributes
.MSBuildRuntimeValues.clr2,
488
XMakeAttributes
.MSBuildRuntimeValues.clr4,
489
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime,
490
XMakeAttributes
.MSBuildRuntimeValues.any);
495
if (identityParameters.TryGetValue(
XMakeAttributes
.architecture, out architecture))
497
if (!
XMakeAttributes
.IsValidMSBuildArchitectureValue(architecture))
505
XMakeAttributes
.MSBuildArchitectureValues.x86,
506
XMakeAttributes
.MSBuildArchitectureValues.x64,
507
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture,
508
XMakeAttributes
.MSBuildArchitectureValues.any);
528
taskIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out taskRuntime);
530
factoryIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out usingTaskRuntime);
532
if (
XMakeAttributes
.RuntimeValuesMatch(taskRuntime, usingTaskRuntime))
534
taskIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out taskArchitecture);
536
factoryIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out usingTaskArchitecture);
538
if (
XMakeAttributes
.ArchitectureValuesMatch(taskArchitecture, usingTaskArchitecture))
569
mergedParameters.TryGetValue(
XMakeAttributes
.runtime, out mergedRuntime);
570
mergedParameters.TryGetValue(
XMakeAttributes
.architecture, out mergedArchitecture);
572
mergedParameters[
XMakeAttributes
.runtime] =
XMakeAttributes
.GetExplicitMSBuildRuntime(mergedRuntime);
573
mergedParameters[
XMakeAttributes
.architecture] =
XMakeAttributes
.GetExplicitMSBuildArchitecture(mergedArchitecture);
579
taskIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out string taskRuntime);
580
factoryIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out string usingTaskRuntime);
582
if (!
XMakeAttributes
.TryMergeRuntimeValues(taskRuntime, usingTaskRuntime, out mergedRuntime))
588
mergedParameters.Add(
XMakeAttributes
.runtime, mergedRuntime);
591
taskIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out string taskArchitecture);
592
factoryIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out string usingTaskArchitecture);
594
if (!
XMakeAttributes
.TryMergeArchitectureValues(taskArchitecture, usingTaskArchitecture, out mergedArchitecture))
600
mergedParameters.Add(
XMakeAttributes
.architecture, mergedArchitecture);
620
if (mergedParameters.TryGetValue(
XMakeAttributes
.runtime, out runtime))
622
string currentRuntime =
XMakeAttributes
.GetExplicitMSBuildRuntime(
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime);
624
if (!currentRuntime.Equals(
XMakeAttributes
.GetExplicitMSBuildRuntime(runtime), StringComparison.OrdinalIgnoreCase))
632
if (mergedParameters.TryGetValue(
XMakeAttributes
.architecture, out architecture))
634
string currentArchitecture =
XMakeAttributes
.GetCurrentMSBuildArchitecture();
636
if (!currentArchitecture.Equals(
XMakeAttributes
.GetExplicitMSBuildArchitecture(architecture), StringComparison.OrdinalIgnoreCase))
Instance\TaskFactories\TaskHostTask.cs (2)
254
string runtime = _taskHostParameters[
XMakeAttributes
.runtime];
255
string architecture = _taskHostParameters[
XMakeAttributes
.architecture];
Instance\TaskRegistry.cs (23)
325
XMakeAttributes
.name,
350
XMakeAttributes
.assemblyFile,
359
XMakeAttributes
.assemblyName,
420
ProjectErrorUtilities.ThrowInvalidProject(projectUsingTaskXml.Location, "InvalidAttributeValueWithException", assemblyFile,
XMakeAttributes
.assemblyFile, XMakeElements.usingTask, ex.Message);
440
taskFactoryParameters.Add(
XMakeAttributes
.runtime, runtime == String.Empty ?
XMakeAttributes
.MSBuildRuntimeValues.any : runtime);
441
taskFactoryParameters.Add(
XMakeAttributes
.architecture, architecture == String.Empty ?
XMakeAttributes
.MSBuildArchitectureValues.any : architecture);
946
obj.TaskIdentityParameters.TryGetValue(
XMakeAttributes
.runtime, out runtime);
947
obj.TaskIdentityParameters.TryGetValue(
XMakeAttributes
.architecture, out architecture);
1023
x.TryGetValue(
XMakeAttributes
.runtime, out runtimeX);
1024
x.TryGetValue(
XMakeAttributes
.architecture, out architectureX);
1029
y.TryGetValue(
XMakeAttributes
.runtime, out runtimeY);
1030
y.TryGetValue(
XMakeAttributes
.architecture, out architectureY);
1034
if (!
XMakeAttributes
.RuntimeValuesMatch(runtimeX, runtimeY))
1039
if (!
XMakeAttributes
.ArchitectureValuesMatch(architectureX, architectureY))
1485
XMakeAttributes
.runtime,
1486
XMakeAttributes
.architecture,
1652
XMakeAttributes
.evaluate,
1693
XMakeAttributes
.parameterType,
1718
XMakeAttributes
.parameterType,
1731
XMakeAttributes
.output,
1757
XMakeAttributes
.required,
Utilities\EngineFileUtilities.cs (12)
376
XMakeAttributes
.exclude,
389
XMakeAttributes
.include,
405
XMakeAttributes
.include,
418
XMakeAttributes
.project,
427
XMakeAttributes
.include,
436
XMakeAttributes
.exclude,
454
XMakeAttributes
.include,
469
XMakeAttributes
.exclude,
481
XMakeAttributes
.include,
494
XMakeAttributes
.project,
504
XMakeAttributes
.include,
514
XMakeAttributes
.exclude,
Xml\ProjectXmlUtilities.cs (1)
95
else if (string.Equals(element.NamespaceURI,
XMakeAttributes
.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase))
Microsoft.Build.Engine.UnitTests (304)
BackEnd\AssemblyTaskFactory_Tests.cs (64)
176
factoryIdentityParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.currentRuntime);
177
factoryIdentityParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
182
taskIdentityParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.GetCurrentMSBuildRuntime());
183
taskIdentityParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.GetCurrentMSBuildArchitecture());
196
factoryIdentityParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr2);
197
factoryIdentityParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
202
taskIdentityParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr4);
203
taskIdentityParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
276
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
277
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
307
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.GetCurrentMSBuildRuntime());
308
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.GetCurrentMSBuildArchitecture());
338
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
339
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
371
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
372
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.GetCurrentMSBuildArchitecture());
404
factoryParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.GetCurrentMSBuildRuntime());
409
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
439
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr2);
440
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
472
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr2);
473
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
503
factoryParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr2);
508
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
567
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
568
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
602
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
603
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
631
factoryParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.any);
632
factoryParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.any);
659
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr2);
660
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.currentArchitecture);
BackEnd\TaskRegistry_Tests.cs (108)
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,
581
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr4);
582
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.x86);
632
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
643
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
715
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
716
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
722
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
723
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
726
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
727
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
733
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
734
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
737
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
738
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
744
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
745
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
753
runtime:
XMakeAttributes
.MSBuildRuntimeValues.any,
754
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
757
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
758
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
788
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
789
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
795
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
796
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
804
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
805
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
808
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
809
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
845
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
846
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
852
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
853
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
856
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
857
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
863
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
864
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
867
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
868
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
874
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
875
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
878
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
879
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
885
runtime:
XMakeAttributes
.MSBuildRuntimeValues.any,
886
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
889
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
890
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
896
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
897
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
900
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
901
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
907
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
908
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x86,
916
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr2,
917
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
920
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
921
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
955
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
956
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
959
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
960
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
967
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
968
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
971
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.any,
972
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x64);
998
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
999
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
1002
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1003
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
1009
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1010
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
1018
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1019
architecture:
XMakeAttributes
.MSBuildArchitectureValues.any,
1022
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1023
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
1029
runtime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1030
architecture:
XMakeAttributes
.MSBuildArchitectureValues.x64,
1058
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr4);
1059
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.x86);
1068
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1069
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
1078
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1079
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
1082
taskParameters.Add(
XMakeAttributes
.runtime,
XMakeAttributes
.MSBuildRuntimeValues.clr4);
1083
taskParameters.Add(
XMakeAttributes
.architecture,
XMakeAttributes
.MSBuildArchitectureValues.x86);
1095
expectedRuntime:
XMakeAttributes
.MSBuildRuntimeValues.clr4,
1096
expectedArchitecture:
XMakeAttributes
.MSBuildArchitectureValues.x86);
2019
Assert.Equal(expectedRuntime, record.TaskFactoryParameters[
XMakeAttributes
.runtime]);
2024
Assert.Equal(expectedArchitecture, record.TaskFactoryParameters[
XMakeAttributes
.architecture]);
2058
{
XMakeAttributes
.runtime, runtime ??
XMakeAttributes
.MSBuildRuntimeValues.any},
2059
{
XMakeAttributes
.architecture, architecture ??
XMakeAttributes
.MSBuildArchitectureValues.any}
2081
taskParameters.TryGetValue(
XMakeAttributes
.runtime, out expectedRuntime);
2082
taskParameters.TryGetValue(
XMakeAttributes
.architecture, out expectedArchitecture);
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 = EnvironmentUtilities.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 = EnvironmentUtilities.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));