741 references to XMakeAttributes
Microsoft.Build (437)
BackEnd\Client\MSBuildClient.cs (1)
539return new ServerNodeHandshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture()));
BackEnd\Components\Communications\NodeEndpointOutOfProc.cs (1)
38architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(),
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (2)
73return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: enableNodeReuse, lowPriority: enableLowPriority)); 101Handshake hostHandshake = new(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: ComponentHost.BuildParameters.EnableNodeReuse, lowPriority: ComponentHost.BuildParameters.LowPriority));
BackEnd\Components\RequestBuilder\TaskBuilder.cs (10)
535msbuildArchitecture = msbuildArchitecture == String.Empty ? XMakeAttributes.MSBuildArchitectureValues.any : msbuildArchitecture.Trim(); 536msbuildRuntime = msbuildRuntime == String.Empty ? XMakeAttributes.MSBuildRuntimeValues.any : msbuildRuntime.Trim(); 538taskIdentityParameters.Add(XMakeAttributes.runtime, msbuildRuntime); 539taskIdentityParameters.Add(XMakeAttributes.architecture, msbuildArchitecture); 695if (String.Equals(XMakeAttributes.ContinueOnErrorValues.errorAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase)) 699else if (String.Equals(XMakeAttributes.ContinueOnErrorValues.warnAndContinue, expandedValue, StringComparison.OrdinalIgnoreCase)) 703else if (String.Equals(XMakeAttributes.ContinueOnErrorValues.errorAndStop, expandedValue, StringComparison.OrdinalIgnoreCase)) 1106XMakeAttributes.itemName, 1124XMakeAttributes.propertyName, 1137XMakeAttributes.taskParameter,
BackEnd\Node\OutOfProcServerNode.cs (1)
104CommunicationsUtilities.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture()));
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (8)
893returnClass.FactoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out usingTaskRuntime); 894returnClass.FactoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out usingTaskArchitecture); 897taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string taskRuntime); 898taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string taskArchitecture); 904usingTaskRuntime ?? XMakeAttributes.MSBuildRuntimeValues.any, 905usingTaskArchitecture ?? XMakeAttributes.MSBuildArchitectureValues.any, 906taskRuntime ?? XMakeAttributes.MSBuildRuntimeValues.any, 907taskArchitecture ?? XMakeAttributes.MSBuildArchitectureValues.any);
CommunicationsUtilities.cs (8)
620architectureFlagToSet = XMakeAttributes.GetCurrentMSBuildArchitecture(); 624ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method."); 625ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method."); 627if (runtimeVersion.Equals(XMakeAttributes.MSBuildRuntimeValues.clr2, StringComparison.OrdinalIgnoreCase)) 631else if (runtimeVersion.Equals(XMakeAttributes.MSBuildRuntimeValues.clr4, StringComparison.OrdinalIgnoreCase)) 635else if (runtimeVersion.Equals(XMakeAttributes.MSBuildRuntimeValues.net, StringComparison.OrdinalIgnoreCase)) 650if (architectureFlagToSet.Equals(XMakeAttributes.MSBuildArchitectureValues.x64, StringComparison.OrdinalIgnoreCase)) 654else if (architectureFlagToSet.Equals(XMakeAttributes.MSBuildArchitectureValues.arm64, StringComparison.OrdinalIgnoreCase))
Construction\ProjectElement.cs (6)
112return GetAttributeValue(XMakeAttributes.condition, ref _condition); 118SetOrRemoveAttribute(XMakeAttributes.condition, value, ref _condition, "Set condition {0}", value); 132return GetAttributeValue(XMakeAttributes.label); 138SetOrRemoveAttribute(XMakeAttributes.label, value, "Set label {0}", value); 279public virtual ElementLocation ConditionLocation => GetAttributeLocation(XMakeAttributes.condition); 285public ElementLocation LabelLocation => GetAttributeLocation(XMakeAttributes.label);
Construction\ProjectImportElement.cs (12)
55get => FileUtilities.FixFilePath(GetAttributeValue(XMakeAttributes.project)); 58ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.project); 60SetOrRemoveAttribute(XMakeAttributes.project, value, "Set Import Project {0}", value); 67public ElementLocation ProjectLocation => GetAttributeLocation(XMakeAttributes.project); 74get => FileUtilities.FixFilePath(GetAttributeValue(XMakeAttributes.sdk)); 77ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.sdk); 80SetOrRemoveAttribute(XMakeAttributes.sdk, value, "Set Import Sdk {0}", value); 90get => GetAttributeValue(XMakeAttributes.sdkVersion); 95SetOrRemoveAttribute(XMakeAttributes.sdkVersion, value, "Set Import Version {0}", value); 105get => GetAttributeValue(XMakeAttributes.sdkMinimumVersion); 110SetOrRemoveAttribute(XMakeAttributes.sdkMinimumVersion, value, "Set Import Minimum Version {0}", value); 118public ElementLocation SdkLocation => GetAttributeLocation(XMakeAttributes.sdk);
Construction\ProjectItemElement.cs (46)
100return GetAttributeValue(XMakeAttributes.include, ref _include); 105ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update); 106SetOrRemoveAttribute(XMakeAttributes.include, value, ref _include, "Set item Include {0}", value); 122return GetAttributeValue(XMakeAttributes.exclude, ref _exclude); 127ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Remove.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.exclude, XMakeAttributes.remove); 128ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Update.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.exclude, XMakeAttributes.update); 129SetOrRemoveAttribute(XMakeAttributes.exclude, value, ref _exclude, "Set item Exclude {0}", value); 144return GetAttributeValue(XMakeAttributes.remove, ref _remove); 149ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Include.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update); 150SetOrRemoveAttribute(XMakeAttributes.remove, value, ref _remove, "Set item Remove {0}", value); 163return GetAttributeValue(XMakeAttributes.update, ref _update); 168ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Include.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update); 169SetOrRemoveAttribute(XMakeAttributes.update, value, ref _update, "Set item Update {0}", value); 183return GetAttributeValue(XMakeAttributes.matchOnMetadata, ref _matchOnMetadata); 191ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length != 0, "OM_MatchOnMetadataOnlyApplicableToRemoveItems", ElementName, XMakeAttributes.matchOnMetadata); 192SetOrRemoveAttribute(XMakeAttributes.matchOnMetadata, value, ref _matchOnMetadata, "Set item MatchOnMetadata {0}", value); 206return GetAttributeValue(XMakeAttributes.matchOnMetadataOptions); 211ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || MatchOnMetadata.Length != 0, "OM_MatchOnMetadataOptionsOnlyApplicableToItemsWithMatchOnMetadata", ElementName, XMakeAttributes.matchOnMetadataOptions); 212SetOrRemoveAttribute(XMakeAttributes.matchOnMetadataOptions, value, "Set item MatchOnMetadataOptions {0}", value); 226return GetAttributeValue(XMakeAttributes.keepMetadata); 232ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.removeMetadata, XMakeAttributes.keepMetadata); 233SetOrRemoveAttribute(XMakeAttributes.keepMetadata, value, "Set item KeepMetadata {0}", value); 247return GetAttributeValue(XMakeAttributes.removeMetadata); 253ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || KeepMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.keepMetadata, XMakeAttributes.removeMetadata); 254SetOrRemoveAttribute(XMakeAttributes.removeMetadata, value, "Set item RemoveMetadata {0}", value); 268return GetAttributeValue(XMakeAttributes.keepDuplicates); 274SetOrRemoveAttribute(XMakeAttributes.keepDuplicates, value, "Set item KeepDuplicates {0}", value); 291public ElementLocation IncludeLocation => GetAttributeLocation(XMakeAttributes.include); 296public ElementLocation ExcludeLocation => GetAttributeLocation(XMakeAttributes.exclude); 301public ElementLocation RemoveLocation => GetAttributeLocation(XMakeAttributes.remove); 306public ElementLocation UpdateLocation => GetAttributeLocation(XMakeAttributes.update); 311public ElementLocation MatchOnMetadataLocation => GetAttributeLocation(XMakeAttributes.matchOnMetadata); 316public ElementLocation MatchOnMetadataOptionsLocation => GetAttributeLocation(XMakeAttributes.matchOnMetadataOptions); 321public ElementLocation KeepMetadataLocation => GetAttributeLocation(XMakeAttributes.keepMetadata); 326public ElementLocation RemoveMetadataLocation => GetAttributeLocation(XMakeAttributes.removeMetadata); 331public ElementLocation KeepDuplicatesLocation => GetAttributeLocation(XMakeAttributes.keepDuplicates);
Construction\ProjectOnErrorElement.cs (4)
54return GetAttributeValue(XMakeAttributes.executeTargets); 59ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.executeTargets); 60SetOrRemoveAttribute(XMakeAttributes.executeTargets, value, "Set OnError ExecuteTargets {0}", value); 68public ElementLocation ExecuteTargetsLocation => GetAttributeLocation(XMakeAttributes.executeTargets);
Construction\ProjectOutputElement.cs (15)
54return GetAttributeValue(XMakeAttributes.taskParameter); 61SetOrRemoveAttribute(XMakeAttributes.taskParameter, value, "Set Output TaskParameter {0}", value); 88return GetAttributeValue(XMakeAttributes.itemName); 93ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(PropertyName), "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.itemName, XMakeAttributes.propertyName); 94SetOrRemoveAttribute(XMakeAttributes.itemName, value, "Set Output ItemType {0}", value); 108return GetAttributeValue(XMakeAttributes.propertyName); 113ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(ItemType), "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.itemName, XMakeAttributes.propertyName); 114SetOrRemoveAttribute(XMakeAttributes.propertyName, value, "Set Output PropertyName {0}", value); 121public ElementLocation TaskParameterLocation => GetAttributeLocation(XMakeAttributes.taskParameter); 126public ElementLocation PropertyNameLocation => GetAttributeLocation(XMakeAttributes.propertyName); 131public ElementLocation ItemTypeLocation => GetAttributeLocation(XMakeAttributes.itemName); 145XMakeAttributes.propertyName, 146XMakeAttributes.itemName);
Construction\ProjectRootElement.cs (15)
481get => GetAttributeValue(XMakeAttributes.defaultTargets); 484set => SetOrRemoveAttribute(XMakeAttributes.defaultTargets, value, "Set Project DefaultTargets to '{0}'", value); 494get => GetAttributeValue(XMakeAttributes.initialTargets); 497set => SetOrRemoveAttribute(XMakeAttributes.initialTargets, value, "Set project InitialTargets to '{0}'", value); 509get => GetAttributeValue(XMakeAttributes.sdk); 512set => SetOrRemoveAttribute(XMakeAttributes.sdk, value, "Set project Sdk to '{0}'", value); 522get => GetAttributeValue(XMakeAttributes.treatAsLocalProperty); 525set => SetOrRemoveAttribute(XMakeAttributes.treatAsLocalProperty, value, "Set project TreatAsLocalProperty to '{0}'", value); 535get => GetAttributeValue(XMakeAttributes.toolsVersion); 538set => SetOrRemoveAttribute(XMakeAttributes.toolsVersion, value, "Set project ToolsVersion {0}", value); 647public ElementLocation ToolsVersionLocation => GetAttributeLocation(XMakeAttributes.toolsVersion); 652public ElementLocation DefaultTargetsLocation => GetAttributeLocation(XMakeAttributes.defaultTargets); 657public ElementLocation InitialTargetsLocation => GetAttributeLocation(XMakeAttributes.initialTargets); 662public ElementLocation SdkLocation => GetAttributeLocation(XMakeAttributes.sdk); 667public ElementLocation TreatAsLocalPropertyLocation => GetAttributeLocation(XMakeAttributes.treatAsLocalProperty);
Construction\ProjectSdkElement.cs (10)
46get => GetAttributeValue(XMakeAttributes.sdkName); 49ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.sdkName); 50SetOrRemoveAttribute(XMakeAttributes.sdkName, value, $"Set SDK Name to {value}", XMakeAttributes.sdkName); 59get => GetAttributeValue(XMakeAttributes.sdkVersion); 62SetOrRemoveAttribute(XMakeAttributes.sdkVersion, value, $"Set SDK Version to {value}", XMakeAttributes.sdkVersion); 71get => GetAttributeValue(XMakeAttributes.sdkMinimumVersion); 74SetOrRemoveAttribute(XMakeAttributes.sdkMinimumVersion, value, $"Set SDK MinimumVersion to {value}", XMakeAttributes.sdkMinimumVersion);
Construction\ProjectTargetElement.cs (30)
94string unescapedValue = EscapingUtilities.UnescapeAll(GetAttributeValue(XMakeAttributes.name)); 115SetOrRemoveAttribute(XMakeAttributes.name, unescapedValue, "Set target Name {0}", value); 130return GetAttributeValue(XMakeAttributes.inputs); 135ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.inputs); 136SetOrRemoveAttribute(XMakeAttributes.inputs, value, "Set target Inputs {0}", value); 150return GetAttributeValue(XMakeAttributes.outputs); 155ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.outputs); 156SetOrRemoveAttribute(XMakeAttributes.outputs, value, "Set target Outputs {0}", value); 170string value = GetAttributeValue(XMakeAttributes.keepDuplicateOutputs); 183ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.keepDuplicateOutputs); 184SetOrRemoveAttribute(XMakeAttributes.keepDuplicateOutputs, value, "Set target KeepDuplicateOutputs {0}", value); 198return GetAttributeValue(XMakeAttributes.dependsOnTargets); 203ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.dependsOnTargets); 204SetOrRemoveAttribute(XMakeAttributes.dependsOnTargets, value, "Set target DependsOnTargets {0}", value); 218return GetAttributeValue(XMakeAttributes.beforeTargets); 223ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.beforeTargets); 224SetOrRemoveAttribute(XMakeAttributes.beforeTargets, value, "Set target BeforeTargets {0}", value); 238return GetAttributeValue(XMakeAttributes.afterTargets); 243ErrorUtilities.VerifyThrowArgumentNull(value, XMakeAttributes.afterTargets); 244SetOrRemoveAttribute(XMakeAttributes.afterTargets, value, "Set target AfterTargets {0}", value); 259return GetAttributeValue(XMakeAttributes.returns, true /* If the element is not there, return null */); 272XMakeAttributes.returns, 293public ElementLocation NameLocation => GetAttributeLocation(XMakeAttributes.name); 298public ElementLocation InputsLocation => GetAttributeLocation(XMakeAttributes.inputs); 303public ElementLocation OutputsLocation => GetAttributeLocation(XMakeAttributes.outputs); 312ElementLocation location = GetAttributeLocation(XMakeAttributes.keepDuplicateOutputs); 327public ElementLocation DependsOnTargetsLocation => GetAttributeLocation(XMakeAttributes.dependsOnTargets); 332public ElementLocation BeforeTargetsLocation => GetAttributeLocation(XMakeAttributes.beforeTargets); 337public ElementLocation ReturnsLocation => GetAttributeLocation(XMakeAttributes.returns); 342public ElementLocation AfterTargetsLocation => GetAttributeLocation(XMakeAttributes.afterTargets);
Construction\ProjectTaskElement.cs (12)
70return GetAttributeValue(XMakeAttributes.continueOnError); 76SetOrRemoveAttribute(XMakeAttributes.continueOnError, value, "Set task ContinueOnError {0}", value); 90return GetAttributeValue(XMakeAttributes.msbuildRuntime); 96SetOrRemoveAttribute(XMakeAttributes.msbuildRuntime, value, "Set task MSBuildRuntime {0}", value); 110return GetAttributeValue(XMakeAttributes.msbuildArchitecture); 116SetOrRemoveAttribute(XMakeAttributes.msbuildArchitecture, value, "Set task MSBuildArchitecture {0}", value); 194public ElementLocation ContinueOnErrorLocation => GetAttributeLocation(XMakeAttributes.continueOnError); 200public ElementLocation MSBuildRuntimeLocation => GetAttributeLocation(XMakeAttributes.msbuildRuntime); 206public ElementLocation MSBuildArchitectureLocation => GetAttributeLocation(XMakeAttributes.msbuildArchitecture); 327ErrorUtilities.VerifyThrowArgument(!XMakeAttributes.IsSpecialTaskAttribute(name), "CannotAccessKnownAttributes", name); 376if (!XMakeAttributes.IsSpecialTaskAttribute(attribute.Name)) 448if (!XMakeAttributes.IsSpecialTaskAttribute(attribute.Name))
Construction\ProjectUsingTaskBodyElement.cs (3)
88string evaluateAttribute = GetAttributeValue(XMakeAttributes.evaluate); 100SetOrRemoveAttribute(XMakeAttributes.evaluate, value, "Set usingtask Evaluate {0}", value); 121public ElementLocation EvaluateLocation => GetAttributeLocation(XMakeAttributes.evaluate) ?? Location;
Construction\ProjectUsingTaskElement.cs (30)
52GetAttributeValue(XMakeAttributes.assemblyFile)); 56ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.assemblyName); 57ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyName), "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName); 59SetOrRemoveAttribute(XMakeAttributes.assemblyFile, value, "Set usingtask AssemblyFile {0}", value); 69get => GetAttributeValue(XMakeAttributes.assemblyName); 73ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.assemblyName); 74ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyFile), "OM_EitherAttributeButNotBoth", XMakeElements.usingTask, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName); 75SetOrRemoveAttribute(XMakeAttributes.assemblyName, value, "Set usingtask AssemblyName {0}", value); 84get => GetAttributeValue(XMakeAttributes.taskName); 88ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.taskName); 89SetOrRemoveAttribute(XMakeAttributes.taskName, value, "Set usingtask TaskName {0}", value); 98get => GetAttributeValue(XMakeAttributes.taskFactory); 102SetOrRemoveAttribute(XMakeAttributes.taskFactory, value, "Set usingtask TaskFactory {0}", value); 111get => GetAttributeValue(XMakeAttributes.runtime); 115SetOrRemoveAttribute(XMakeAttributes.runtime, value, "Set usingtask Runtime {0}", value); 124get => GetAttributeValue(XMakeAttributes.architecture); 128SetOrRemoveAttribute(XMakeAttributes.architecture, value, "Set usingtask Architecture {0}", value); 137get => GetAttributeValue(XMakeAttributes.overrideUsingTask); 141SetOrRemoveAttribute(XMakeAttributes.overrideUsingTask, value, "Set usingtask Override {0}", value); 172public ElementLocation TaskNameLocation => GetAttributeLocation(XMakeAttributes.taskName); 177public ElementLocation AssemblyFileLocation => GetAttributeLocation(XMakeAttributes.assemblyFile); 182public ElementLocation AssemblyNameLocation => GetAttributeLocation(XMakeAttributes.assemblyName); 187public ElementLocation RuntimeLocation => GetAttributeLocation(XMakeAttributes.runtime); 192public ElementLocation ArchitectureLocation => GetAttributeLocation(XMakeAttributes.architecture); 197public ElementLocation TaskFactoryLocation => GetAttributeLocation(XMakeAttributes.taskFactory); 202public ElementLocation OverrideLocation => GetAttributeLocation(XMakeAttributes.overrideUsingTask); 238XMakeAttributes.assemblyFile, 239XMakeAttributes.assemblyName);
Construction\ProjectUsingTaskParameterElement.cs (9)
90string typeAttribute = GetAttributeValue(XMakeAttributes.parameterType); 97SetOrRemoveAttribute(XMakeAttributes.parameterType, value, "Set usingtaskparameter ParameterType {0}", value); 108string outputAttribute = GetAttributeValue(XMakeAttributes.output); 114SetOrRemoveAttribute(XMakeAttributes.output, value, "Set usingtaskparameter Output {0}", value); 125string requiredAttribute = GetAttributeValue(XMakeAttributes.required); 131SetOrRemoveAttribute(XMakeAttributes.required, value, "Set usingtaskparameter Required {0}", value); 152public ElementLocation ParameterTypeLocation => GetAttributeLocation(XMakeAttributes.parameterType) ?? Location; 159public ElementLocation OutputLocation => GetAttributeLocation(XMakeAttributes.output) ?? Location; 166public ElementLocation RequiredLocation => GetAttributeLocation(XMakeAttributes.required) ?? Location;
Construction\Solution\ProjectInSolution.cs (2)
15using XMakeAttributes = Microsoft.Build.Shared.XMakeAttributes; 331XMakeAttributes.defaultXmlNamespace,
Evaluation\Evaluator.cs (4)
2002ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValue", String.Empty, XMakeAttributes.project, XMakeElements.import); 2032ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", EscapingUtilities.UnescapeAll(importExpressionEscapedItem), XMakeAttributes.project, XMakeElements.import, ex.Message); 2077ProjectErrorUtilities.ThrowInvalidProject(importLocationInProject, "InvalidAttributeValueWithException", importFileUnescaped, XMakeAttributes.project, XMakeElements.import, ex.Message); 2494ProjectErrorUtilities.ThrowInvalidProject(importElement.Location, "InvalidAttributeValueWithException", importExpandedWithDefaultPath, XMakeAttributes.project, XMakeElements.import, ex.Message);
Evaluation\IntrinsicFunctions.cs (14)
475if (!XMakeAttributes.IsValidMSBuildRuntimeValue(runtime)) 477ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", runtime, "Runtime", XMakeAttributes.MSBuildRuntimeValues.clr2, XMakeAttributes.MSBuildRuntimeValues.clr4, XMakeAttributes.MSBuildRuntimeValues.currentRuntime, XMakeAttributes.MSBuildRuntimeValues.any); 480if (!XMakeAttributes.IsValidMSBuildArchitectureValue(architecture)) 482ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", architecture, "Architecture", XMakeAttributes.MSBuildArchitectureValues.x86, XMakeAttributes.MSBuildArchitectureValues.x64, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, XMakeAttributes.MSBuildArchitectureValues.any); 485runtime = XMakeAttributes.GetExplicitMSBuildRuntime(runtime); 486architecture = XMakeAttributes.GetExplicitMSBuildArchitecture(architecture); 489parameters.Add(XMakeAttributes.runtime, runtime); 490parameters.Add(XMakeAttributes.architecture, architecture);
Evaluation\Preprocessor.cs (15)
241string outerInitialTargets = destinationDocument.DocumentElement.GetAttribute(XMakeAttributes.initialTargets).Trim(); 242string innerInitialTargets = ((XmlElement)child).GetAttribute(XMakeAttributes.initialTargets).Trim(); 251destinationDocument.DocumentElement.SetAttribute(XMakeAttributes.initialTargets, outerInitialTargets + innerInitialTargets); 255string outerDefaultTargets = destinationDocument.DocumentElement.GetAttribute(XMakeAttributes.defaultTargets).Trim(); 259string innerDefaultTargets = ((XmlElement)child).GetAttribute(XMakeAttributes.defaultTargets).Trim(); 263destinationDocument.DocumentElement.SetAttribute(XMakeAttributes.defaultTargets, innerDefaultTargets); 278string importCondition = ((XmlElement)child).GetAttribute(XMakeAttributes.condition); 280string importProject = ((XmlElement)child).GetAttribute(XMakeAttributes.project).Replace("--", "__"); 281string importSdk = ((XmlElement)child).GetAttribute(XMakeAttributes.sdk); 282string sdk = importSdk.Length > 0 ? $" {XMakeAttributes.sdk}=\"{importSdk}\"" : String.Empty; 285string 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}\"."; 336string importGroupCondition = ((XmlElement)child).GetAttribute(XMakeAttributes.condition); 350if (clone.NodeType == XmlNodeType.Element && String.Equals(XMakeElements.project, child.Name, StringComparison.Ordinal) && clone.Attributes?[XMakeAttributes.sdk] != null) 352clone.Attributes.Remove(clone.Attributes[XMakeAttributes.sdk]);
Evaluation\ProjectParser.cs (96)
31private static readonly HashSet<string> ValidAttributesOnlyConditionAndLabel = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label }; 36private 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 }; 46private static readonly HashSet<string> ValidAttributesOnImport = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.project, XMakeAttributes.sdk, XMakeAttributes.sdkVersion, XMakeAttributes.sdkMinimumVersion }; 51private 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 }; 56private 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 }; 61private static readonly HashSet<string> ValidAttributesOnOnError = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.executeTargets }; 66private static readonly HashSet<string> ValidAttributesOnOutput = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.taskParameter, XMakeAttributes.itemName, XMakeAttributes.propertyName }; 71private static readonly HashSet<string> ValidAttributesOnUsingTaskParameter = new HashSet<string> { XMakeAttributes.parameterType, XMakeAttributes.output, XMakeAttributes.required }; 76private static readonly HashSet<string> ValidAttributesOnUsingTaskBody = new HashSet<string> { XMakeAttributes.evaluate }; 143XMakeAttributes.defaultXmlNamespace); 264string include = element.GetAttribute(XMakeAttributes.include); 265string exclude = element.GetAttribute(XMakeAttributes.exclude); 266string remove = element.GetAttribute(XMakeAttributes.remove); 267string update = element.GetAttribute(XMakeAttributes.update); 271if (element.HasAttribute(XMakeAttributes.include)) 274exclusiveItemOperation = XMakeAttributes.include; 276if (element.HasAttribute(XMakeAttributes.remove)) 279exclusiveItemOperation = XMakeAttributes.remove; 281if (element.HasAttribute(XMakeAttributes.update)) 284exclusiveItemOperation = XMakeAttributes.update; 290XmlAttributeWithLocation errorAttribute = remove.Length > 0 ? (XmlAttributeWithLocation)element.Attributes[XMakeAttributes.remove] : (XmlAttributeWithLocation)element.Attributes[XMakeAttributes.update]; 298ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(exclude.Length == 0 || include.Length > 0, (XmlAttributeWithLocation)element.Attributes[XMakeAttributes.exclude]); 301ProjectErrorUtilities.VerifyThrowInvalidProject(include.Length > 0 || element.Attributes[XMakeAttributes.include] == null, element.Location, "MissingRequiredAttribute", XMakeAttributes.include, itemType); 304ProjectErrorUtilities.VerifyThrowInvalidProject(remove.Length > 0 || element.Attributes[XMakeAttributes.remove] == null, element.Location, "MissingRequiredAttribute", XMakeAttributes.remove, itemType); 307ProjectErrorUtilities.VerifyThrowInvalidProject(update.Length > 0 || element.Attributes[XMakeAttributes.update] == null, element.Location, "MissingRequiredAttribute", XMakeAttributes.update, itemType); 457ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element, XMakeAttributes.project); 461if (element.HasAttribute(XMakeAttributes.sdk)) 464ProjectXmlUtilities.GetAttributeValue(element, XMakeAttributes.sdk, nullIfNotExists: true), 465ProjectXmlUtilities.GetAttributeValue(element, XMakeAttributes.sdkVersion, nullIfNotExists: true), 466ProjectXmlUtilities.GetAttributeValue(element, XMakeAttributes.sdkMinimumVersion, nullIfNotExists: true)); 511ProjectErrorUtilities.VerifyThrowInvalidProject(element.GetAttribute(XMakeAttributes.taskName).Length > 0, element.Location, "ProjectTaskNameEmpty"); 513string assemblyName = element.GetAttribute(XMakeAttributes.assemblyName); 514string assemblyFile = element.GetAttribute(XMakeAttributes.assemblyFile); 521XMakeAttributes.assemblyName, 522XMakeAttributes.assemblyFile); 524ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, XMakeAttributes.assemblyName); 525ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, XMakeAttributes.assemblyFile); 575ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element, XMakeAttributes.name); 578string targetName = EscapingUtilities.UnescapeAll(ProjectXmlUtilities.GetAttributeValue(element, XMakeAttributes.name)); 583ProjectErrorUtilities.ThrowInvalidProject(element.GetAttributeLocation(XMakeAttributes.name), "NameInvalid", targetName, targetName[indexOfSpecialCharacter]); 617ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(childElement, XMakeAttributes.executeTargets); 656!XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(attribute.Name), 684ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element, XMakeAttributes.taskParameter); 687XmlAttributeWithLocation itemNameAttribute = element.GetAttributeWithLocation(XMakeAttributes.itemName); 688XmlAttributeWithLocation propertyNameAttribute = element.GetAttributeWithLocation(XMakeAttributes.propertyName); 696ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, itemNameAttribute, XMakeAttributes.itemName); 697ProjectXmlUtilities.VerifyThrowProjectAttributeEitherMissingOrNotEmpty(element, propertyNameAttribute, XMakeAttributes.propertyName); 817ProjectXmlUtilities.VerifyThrowProjectRequiredAttribute(element, XMakeAttributes.condition); 897if (string.IsNullOrEmpty(element.GetAttribute(XMakeAttributes.sdkName)))
Instance\TaskFactories\AssemblyTaskFactory.cs (45)
351if (!mergedParameters.ContainsKey(XMakeAttributes.runtime)) 353mergedParameters[XMakeAttributes.runtime] = XMakeAttributes.GetCurrentMSBuildRuntime(); 356if (!mergedParameters.ContainsKey(XMakeAttributes.architecture)) 358mergedParameters[XMakeAttributes.architecture] = XMakeAttributes.GetCurrentMSBuildArchitecture(); 477if (identityParameters.TryGetValue(XMakeAttributes.runtime, out runtime)) 479if (!XMakeAttributes.IsValidMSBuildRuntimeValue(runtime)) 487XMakeAttributes.MSBuildRuntimeValues.clr2, 488XMakeAttributes.MSBuildRuntimeValues.clr4, 489XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 490XMakeAttributes.MSBuildRuntimeValues.any); 495if (identityParameters.TryGetValue(XMakeAttributes.architecture, out architecture)) 497if (!XMakeAttributes.IsValidMSBuildArchitectureValue(architecture)) 505XMakeAttributes.MSBuildArchitectureValues.x86, 506XMakeAttributes.MSBuildArchitectureValues.x64, 507XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, 508XMakeAttributes.MSBuildArchitectureValues.any); 528taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out taskRuntime); 530factoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out usingTaskRuntime); 532if (XMakeAttributes.RuntimeValuesMatch(taskRuntime, usingTaskRuntime)) 534taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out taskArchitecture); 536factoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out usingTaskArchitecture); 538if (XMakeAttributes.ArchitectureValuesMatch(taskArchitecture, usingTaskArchitecture)) 569mergedParameters.TryGetValue(XMakeAttributes.runtime, out mergedRuntime); 570mergedParameters.TryGetValue(XMakeAttributes.architecture, out mergedArchitecture); 572mergedParameters[XMakeAttributes.runtime] = XMakeAttributes.GetExplicitMSBuildRuntime(mergedRuntime); 573mergedParameters[XMakeAttributes.architecture] = XMakeAttributes.GetExplicitMSBuildArchitecture(mergedArchitecture); 579taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string taskRuntime); 580factoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string usingTaskRuntime); 582if (!XMakeAttributes.TryMergeRuntimeValues(taskRuntime, usingTaskRuntime, out mergedRuntime)) 588mergedParameters.Add(XMakeAttributes.runtime, mergedRuntime); 591taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string taskArchitecture); 592factoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string usingTaskArchitecture); 594if (!XMakeAttributes.TryMergeArchitectureValues(taskArchitecture, usingTaskArchitecture, out mergedArchitecture)) 600mergedParameters.Add(XMakeAttributes.architecture, mergedArchitecture); 620if (mergedParameters.TryGetValue(XMakeAttributes.runtime, out runtime)) 622string currentRuntime = XMakeAttributes.GetExplicitMSBuildRuntime(XMakeAttributes.MSBuildRuntimeValues.currentRuntime); 624if (!currentRuntime.Equals(XMakeAttributes.GetExplicitMSBuildRuntime(runtime), StringComparison.OrdinalIgnoreCase)) 632if (mergedParameters.TryGetValue(XMakeAttributes.architecture, out architecture)) 634string currentArchitecture = XMakeAttributes.GetCurrentMSBuildArchitecture(); 636if (!currentArchitecture.Equals(XMakeAttributes.GetExplicitMSBuildArchitecture(architecture), StringComparison.OrdinalIgnoreCase))
Instance\TaskFactories\TaskHostTask.cs (2)
254string runtime = _taskHostParameters[XMakeAttributes.runtime]; 255string architecture = _taskHostParameters[XMakeAttributes.architecture];
Instance\TaskRegistry.cs (23)
325XMakeAttributes.name, 350XMakeAttributes.assemblyFile, 359XMakeAttributes.assemblyName, 420ProjectErrorUtilities.ThrowInvalidProject(projectUsingTaskXml.Location, "InvalidAttributeValueWithException", assemblyFile, XMakeAttributes.assemblyFile, XMakeElements.usingTask, ex.Message); 440taskFactoryParameters.Add(XMakeAttributes.runtime, runtime == String.Empty ? XMakeAttributes.MSBuildRuntimeValues.any : runtime); 441taskFactoryParameters.Add(XMakeAttributes.architecture, architecture == String.Empty ? XMakeAttributes.MSBuildArchitectureValues.any : architecture); 946obj.TaskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out runtime); 947obj.TaskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out architecture); 1023x.TryGetValue(XMakeAttributes.runtime, out runtimeX); 1024x.TryGetValue(XMakeAttributes.architecture, out architectureX); 1029y.TryGetValue(XMakeAttributes.runtime, out runtimeY); 1030y.TryGetValue(XMakeAttributes.architecture, out architectureY); 1034if (!XMakeAttributes.RuntimeValuesMatch(runtimeX, runtimeY)) 1039if (!XMakeAttributes.ArchitectureValuesMatch(architectureX, architectureY)) 1485XMakeAttributes.runtime, 1486XMakeAttributes.architecture, 1652XMakeAttributes.evaluate, 1693XMakeAttributes.parameterType, 1718XMakeAttributes.parameterType, 1731XMakeAttributes.output, 1757XMakeAttributes.required,
Utilities\EngineFileUtilities.cs (12)
376XMakeAttributes.exclude, 389XMakeAttributes.include, 405XMakeAttributes.include, 418XMakeAttributes.project, 427XMakeAttributes.include, 436XMakeAttributes.exclude, 454XMakeAttributes.include, 469XMakeAttributes.exclude, 481XMakeAttributes.include, 494XMakeAttributes.project, 504XMakeAttributes.include, 514XMakeAttributes.exclude,
Xml\ProjectXmlUtilities.cs (1)
95else if (string.Equals(element.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase))
Microsoft.Build.Engine.UnitTests (304)
BackEnd\AssemblyTaskFactory_Tests.cs (64)
176factoryIdentityParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.currentRuntime); 177factoryIdentityParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture); 182taskIdentityParameters.Add(XMakeAttributes.runtime, XMakeAttributes.GetCurrentMSBuildRuntime()); 183taskIdentityParameters.Add(XMakeAttributes.architecture, XMakeAttributes.GetCurrentMSBuildArchitecture()); 196factoryIdentityParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr2); 197factoryIdentityParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture); 202taskIdentityParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr4); 203taskIdentityParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture); 276taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 277taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 307taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.GetCurrentMSBuildRuntime()); 308taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.GetCurrentMSBuildArchitecture()); 338taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 339taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 371taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 372taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.GetCurrentMSBuildArchitecture()); 404factoryParameters.Add(XMakeAttributes.runtime, XMakeAttributes.GetCurrentMSBuildRuntime()); 409taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture); 439taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr2); 440taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 472taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr2); 473taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 503factoryParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr2); 508taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 567taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 568taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 602taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 603taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 631factoryParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.any); 632factoryParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.any); 659taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr2); 660taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture);
BackEnd\TaskRegistry_Tests.cs (108)
524runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 525architecture: XMakeAttributes.MSBuildArchitectureValues.any, 533runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 534architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 542runtime: XMakeAttributes.MSBuildRuntimeValues.clr2, 543architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 551runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 552architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 581taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr4); 582taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.x86); 632expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 643expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 715expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 716expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 722runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 723architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 726expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 727expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 733runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 734architecture: XMakeAttributes.MSBuildArchitectureValues.any, 737expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 738expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 744runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 745architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 753runtime: XMakeAttributes.MSBuildRuntimeValues.any, 754architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 757expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 758expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 788expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 789expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 795runtime: XMakeAttributes.MSBuildRuntimeValues.clr2, 796architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 804runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 805architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 808expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 809expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 845expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 846expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 852runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 853architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 856expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 857expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 863runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 864architecture: XMakeAttributes.MSBuildArchitectureValues.any, 867expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 868expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 874runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 875architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 878expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 879expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x64); 885runtime: XMakeAttributes.MSBuildRuntimeValues.any, 886architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 889expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 890expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 896runtime: XMakeAttributes.MSBuildRuntimeValues.clr2, 897architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 900expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 901expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x64); 907runtime: XMakeAttributes.MSBuildRuntimeValues.clr2, 908architecture: XMakeAttributes.MSBuildArchitectureValues.x86, 916runtime: XMakeAttributes.MSBuildRuntimeValues.clr2, 917architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 920expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 921expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x64); 955runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 956architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 959expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 960expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x64); 967runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 968architecture: XMakeAttributes.MSBuildArchitectureValues.any, 971expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.any, 972expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x64); 998runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 999architecture: XMakeAttributes.MSBuildArchitectureValues.any, 1002expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1003expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 1009runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1010architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 1018runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1019architecture: XMakeAttributes.MSBuildArchitectureValues.any, 1022expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1023expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 1029runtime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1030architecture: XMakeAttributes.MSBuildArchitectureValues.x64, 1058taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr4); 1059taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.x86); 1068expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1069expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 1078expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1079expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 1082taskParameters.Add(XMakeAttributes.runtime, XMakeAttributes.MSBuildRuntimeValues.clr4); 1083taskParameters.Add(XMakeAttributes.architecture, XMakeAttributes.MSBuildArchitectureValues.x86); 1095expectedRuntime: XMakeAttributes.MSBuildRuntimeValues.clr4, 1096expectedArchitecture: XMakeAttributes.MSBuildArchitectureValues.x86); 2019Assert.Equal(expectedRuntime, record.TaskFactoryParameters[XMakeAttributes.runtime]); 2024Assert.Equal(expectedArchitecture, record.TaskFactoryParameters[XMakeAttributes.architecture]); 2058{XMakeAttributes.runtime, runtime ?? XMakeAttributes.MSBuildRuntimeValues.any}, 2059{XMakeAttributes.architecture, architecture ?? XMakeAttributes.MSBuildArchitectureValues.any} 2081taskParameters.TryGetValue(XMakeAttributes.runtime, out expectedRuntime); 2082taskParameters.TryGetValue(XMakeAttributes.architecture, out expectedArchitecture);
XmakeAttributes_Tests.cs (132)
19Assert.False(XMakeAttributes.IsSpecialTaskAttribute("NotAnAttribute")); 20Assert.True(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.xmlns)); 21Assert.True(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.continueOnError)); 22Assert.True(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.condition)); 23Assert.True(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.msbuildArchitecture)); 24Assert.True(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.msbuildRuntime)); 30Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("NotAnAttribute")); 31Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.include)); 32Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.continueOnError)); 33Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.condition)); 34Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.msbuildArchitecture)); 35Assert.False(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.msbuildRuntime)); 36Assert.True(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("continueOnError")); 37Assert.True(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("condition")); 38Assert.True(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("MsbuildRuntime")); 39Assert.True(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("msbuildarchitecture")); 45Assert.False(XMakeAttributes.IsNonBatchingTargetAttribute("NotAnAttribute")); 46Assert.True(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.dependsOnTargets)); 47Assert.True(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.name)); 48Assert.True(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.condition)); 54Assert.True(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.any, XMakeAttributes.MSBuildRuntimeValues.currentRuntime)); 55Assert.True(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.any, XMakeAttributes.MSBuildRuntimeValues.net)); 56Assert.True(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.any, XMakeAttributes.MSBuildRuntimeValues.clr4)); 57Assert.True(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.clr2, XMakeAttributes.MSBuildRuntimeValues.any)); 59Assert.True(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.currentRuntime, XMakeAttributes.MSBuildRuntimeValues.net)); 65Assert.False(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.currentRuntime, XMakeAttributes.MSBuildRuntimeValues.clr2)); 67Assert.False(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.clr4, XMakeAttributes.MSBuildRuntimeValues.clr2)); 68Assert.False(XMakeAttributes.RuntimeValuesMatch(XMakeAttributes.MSBuildRuntimeValues.clr4, XMakeAttributes.MSBuildRuntimeValues.net)); 69Assert.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)] 80XMakeAttributes.TryMergeRuntimeValues(left, right, out string mergedRuntime) 89XMakeAttributes.TryMergeRuntimeValues(XMakeAttributes.MSBuildRuntimeValues.any, 90XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 94mergedRuntime.ShouldBe(XMakeAttributes.GetCurrentMSBuildRuntime()); 100XMakeAttributes.TryMergeRuntimeValues( 101XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 102XMakeAttributes.MSBuildRuntimeValues.clr4, 104mergedRuntime.ShouldBe(XMakeAttributes.MSBuildRuntimeValues.clr4); 106XMakeAttributes.TryMergeRuntimeValues( 107XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 108XMakeAttributes.MSBuildRuntimeValues.net, 116XMakeAttributes.TryMergeRuntimeValues( 117XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 118XMakeAttributes.MSBuildRuntimeValues.net, 120mergedRuntime.ShouldBe(XMakeAttributes.MSBuildRuntimeValues.net); 122XMakeAttributes.TryMergeRuntimeValues( 123XMakeAttributes.MSBuildRuntimeValues.currentRuntime, 124XMakeAttributes.MSBuildRuntimeValues.clr4, 132string currentArchitecture = XMakeAttributes.GetCurrentMSBuildArchitecture(); 133string notCurrentArchitecture = EnvironmentUtilities.Is64BitProcess ? XMakeAttributes.MSBuildArchitectureValues.x86 : XMakeAttributes.MSBuildArchitectureValues.x64; 135Assert.True(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.any, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture)); 136Assert.True(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.any, XMakeAttributes.MSBuildArchitectureValues.x64)); 137Assert.True(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.x86, XMakeAttributes.MSBuildArchitectureValues.any)); 138Assert.True(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, currentArchitecture)); 140Assert.False(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, notCurrentArchitecture)); 141Assert.False(XMakeAttributes.ArchitectureValuesMatch(XMakeAttributes.MSBuildArchitectureValues.x64, XMakeAttributes.MSBuildArchitectureValues.x86)); 147string currentArchitecture = XMakeAttributes.GetCurrentMSBuildArchitecture(); 148string notCurrentArchitecture = EnvironmentUtilities.Is64BitProcess ? XMakeAttributes.MSBuildArchitectureValues.x86 : XMakeAttributes.MSBuildArchitectureValues.x64; 151Assert.True(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.any, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, out mergedArchitecture)); 154Assert.True(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.any, XMakeAttributes.MSBuildArchitectureValues.x64, out mergedArchitecture)); 155Assert.Equal(XMakeAttributes.MSBuildArchitectureValues.x64, mergedArchitecture); 157Assert.True(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.x86, XMakeAttributes.MSBuildArchitectureValues.any, out mergedArchitecture)); 158Assert.Equal(XMakeAttributes.MSBuildArchitectureValues.x86, mergedArchitecture); 160Assert.True(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, currentArchitecture, out mergedArchitecture)); 163Assert.False(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, notCurrentArchitecture, out mergedArchitecture)); 164Assert.False(XMakeAttributes.TryMergeArchitectureValues(XMakeAttributes.MSBuildArchitectureValues.x64, XMakeAttributes.MSBuildArchitectureValues.x86, out mergedArchitecture));