123 references to IntrinsicFunctions
Microsoft.Build (115)
Evaluation\Expander.cs (5)
3501if (_receiverType == typeof(IntrinsicFunctions)) 3579if (_receiverType == typeof(IntrinsicFunctions)) 4197if (_receiverType == typeof(IntrinsicFunctions)) 4230if (receiverType == typeof(IntrinsicFunctions)) 4291else if (_receiverType == typeof(IntrinsicFunctions) && IntrinsicFunctionOverload.IsKnownOverloadMethodName(_methodMethodName))
Evaluation\Expander\WellKnownFunctions.cs (109)
362if (string.Equals(methodName, nameof(IntrinsicFunctions.EnsureTrailingSlash), StringComparison.OrdinalIgnoreCase)) 366returnVal = IntrinsicFunctions.EnsureTrailingSlash(arg0); 370else if (string.Equals(methodName, nameof(IntrinsicFunctions.ValueOrDefault), StringComparison.OrdinalIgnoreCase)) 374returnVal = IntrinsicFunctions.ValueOrDefault(arg0, arg1); 378else if (string.Equals(methodName, nameof(IntrinsicFunctions.NormalizePath), StringComparison.OrdinalIgnoreCase)) 382returnVal = IntrinsicFunctions.NormalizePath(Array.ConvertAll(args, o => (string)o)); 386else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetDirectoryNameOfFileAbove), StringComparison.OrdinalIgnoreCase)) 390returnVal = IntrinsicFunctions.GetDirectoryNameOfFileAbove(arg0, arg1, fileSystem); 394else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetRegistryValueFromView), StringComparison.OrdinalIgnoreCase)) 399returnVal = IntrinsicFunctions.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3)); 403else if (string.Equals(methodName, nameof(IntrinsicFunctions.IsRunningFromVisualStudio), StringComparison.OrdinalIgnoreCase)) 407returnVal = IntrinsicFunctions.IsRunningFromVisualStudio(); 411else if (string.Equals(methodName, nameof(IntrinsicFunctions.Escape), StringComparison.OrdinalIgnoreCase)) 415returnVal = IntrinsicFunctions.Escape(arg0); 419else if (string.Equals(methodName, nameof(IntrinsicFunctions.Unescape), StringComparison.OrdinalIgnoreCase)) 423returnVal = IntrinsicFunctions.Unescape(arg0); 427else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetPathOfFileAbove), StringComparison.OrdinalIgnoreCase)) 431returnVal = IntrinsicFunctions.GetPathOfFileAbove(arg0, arg1, fileSystem); 435else if (string.Equals(methodName, nameof(IntrinsicFunctions.Add), StringComparison.OrdinalIgnoreCase)) 437if (ParseArgs.TryExecuteArithmeticOverload(args, IntrinsicFunctions.Add, IntrinsicFunctions.Add, out returnVal)) 442else if (string.Equals(methodName, nameof(IntrinsicFunctions.Subtract), StringComparison.OrdinalIgnoreCase)) 444if (ParseArgs.TryExecuteArithmeticOverload(args, IntrinsicFunctions.Subtract, IntrinsicFunctions.Subtract, out returnVal)) 449else if (string.Equals(methodName, nameof(IntrinsicFunctions.Multiply), StringComparison.OrdinalIgnoreCase)) 451if (ParseArgs.TryExecuteArithmeticOverload(args, IntrinsicFunctions.Multiply, IntrinsicFunctions.Multiply, out returnVal)) 456else if (string.Equals(methodName, nameof(IntrinsicFunctions.Divide), StringComparison.OrdinalIgnoreCase)) 458if (ParseArgs.TryExecuteArithmeticOverload(args, IntrinsicFunctions.Divide, IntrinsicFunctions.Divide, out returnVal)) 463else if (string.Equals(methodName, nameof(IntrinsicFunctions.Modulo), StringComparison.OrdinalIgnoreCase)) 465if (ParseArgs.TryExecuteArithmeticOverload(args, IntrinsicFunctions.Modulo, IntrinsicFunctions.Modulo, out returnVal)) 470else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetCurrentToolsDirectory), StringComparison.OrdinalIgnoreCase)) 474returnVal = IntrinsicFunctions.GetCurrentToolsDirectory(); 478else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetToolsDirectory32), StringComparison.OrdinalIgnoreCase)) 482returnVal = IntrinsicFunctions.GetToolsDirectory32(); 486else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetToolsDirectory64), StringComparison.OrdinalIgnoreCase)) 490returnVal = IntrinsicFunctions.GetToolsDirectory64(); 494else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetMSBuildSDKsPath), StringComparison.OrdinalIgnoreCase)) 498returnVal = IntrinsicFunctions.GetMSBuildSDKsPath(); 502else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetVsInstallRoot), StringComparison.OrdinalIgnoreCase)) 506returnVal = IntrinsicFunctions.GetVsInstallRoot(); 510else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetMSBuildExtensionsPath), StringComparison.OrdinalIgnoreCase)) 514returnVal = IntrinsicFunctions.GetMSBuildExtensionsPath(); 518else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetProgramFiles32), StringComparison.OrdinalIgnoreCase)) 522returnVal = IntrinsicFunctions.GetProgramFiles32(); 526else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionEquals), StringComparison.OrdinalIgnoreCase)) 530returnVal = IntrinsicFunctions.VersionEquals(arg0, arg1); 534else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionNotEquals), StringComparison.OrdinalIgnoreCase)) 538returnVal = IntrinsicFunctions.VersionNotEquals(arg0, arg1); 542else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionGreaterThan), StringComparison.OrdinalIgnoreCase)) 546returnVal = IntrinsicFunctions.VersionGreaterThan(arg0, arg1); 550else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionGreaterThanOrEquals), StringComparison.OrdinalIgnoreCase)) 554returnVal = IntrinsicFunctions.VersionGreaterThanOrEquals(arg0, arg1); 558else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionLessThan), StringComparison.OrdinalIgnoreCase)) 562returnVal = IntrinsicFunctions.VersionLessThan(arg0, arg1); 566else if (string.Equals(methodName, nameof(IntrinsicFunctions.VersionLessThanOrEquals), StringComparison.OrdinalIgnoreCase)) 570returnVal = IntrinsicFunctions.VersionLessThanOrEquals(arg0, arg1); 574else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetTargetFrameworkIdentifier), StringComparison.OrdinalIgnoreCase)) 578returnVal = IntrinsicFunctions.GetTargetFrameworkIdentifier(arg0); 582else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetTargetFrameworkVersion), StringComparison.OrdinalIgnoreCase)) 586returnVal = IntrinsicFunctions.GetTargetFrameworkVersion(arg0); 591returnVal = IntrinsicFunctions.GetTargetFrameworkVersion(arg1, arg2); 595else if (string.Equals(methodName, nameof(IntrinsicFunctions.IsTargetFrameworkCompatible), StringComparison.OrdinalIgnoreCase)) 599returnVal = IntrinsicFunctions.IsTargetFrameworkCompatible(arg0, arg1); 603else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetTargetPlatformIdentifier), StringComparison.OrdinalIgnoreCase)) 607returnVal = IntrinsicFunctions.GetTargetPlatformIdentifier(arg0); 611else if (string.Equals(methodName, nameof(IntrinsicFunctions.GetTargetPlatformVersion), StringComparison.OrdinalIgnoreCase)) 615returnVal = IntrinsicFunctions.GetTargetPlatformVersion(arg0); 620returnVal = IntrinsicFunctions.GetTargetPlatformVersion(arg1, arg2); 624else if (string.Equals(methodName, nameof(IntrinsicFunctions.ConvertToBase64), StringComparison.OrdinalIgnoreCase)) 628returnVal = IntrinsicFunctions.ConvertToBase64(arg0); 632else if (string.Equals(methodName, nameof(IntrinsicFunctions.ConvertFromBase64), StringComparison.OrdinalIgnoreCase)) 636returnVal = IntrinsicFunctions.ConvertFromBase64(arg0); 640else if (string.Equals(methodName, nameof(IntrinsicFunctions.StableStringHash), StringComparison.OrdinalIgnoreCase)) 646? IntrinsicFunctions.StableStringHash(arg0) 647: IntrinsicFunctions.StableStringHashLegacy(arg0); 650else if (ParseArgs.TryGetArgs(args, out string? arg1, out string? arg2) && Enum.TryParse<IntrinsicFunctions.StringHashingAlgorithm>(arg2, true, out var hashAlgorithm) && arg1 != null && arg2 != null) 652returnVal = IntrinsicFunctions.StableStringHash(arg1, hashAlgorithm); 656else if (string.Equals(methodName, nameof(IntrinsicFunctions.AreFeaturesEnabled), StringComparison.OrdinalIgnoreCase)) 660returnVal = IntrinsicFunctions.AreFeaturesEnabled(arg0); 664else if (string.Equals(methodName, nameof(IntrinsicFunctions.SubstringByAsciiChars), StringComparison.OrdinalIgnoreCase)) 668returnVal = IntrinsicFunctions.SubstringByAsciiChars(arg0, arg1, arg2); 672else if (string.Equals(methodName, nameof(IntrinsicFunctions.CheckFeatureAvailability), StringComparison.OrdinalIgnoreCase)) 676returnVal = IntrinsicFunctions.CheckFeatureAvailability(arg0); 680else if (string.Equals(methodName, nameof(IntrinsicFunctions.BitwiseOr), StringComparison.OrdinalIgnoreCase)) 684returnVal = IntrinsicFunctions.BitwiseOr(arg0, arg1); 688else if (string.Equals(methodName, nameof(IntrinsicFunctions.BitwiseAnd), StringComparison.OrdinalIgnoreCase)) 692returnVal = IntrinsicFunctions.BitwiseAnd(arg0, arg1); 696else if (string.Equals(methodName, nameof(IntrinsicFunctions.BitwiseXor), StringComparison.OrdinalIgnoreCase)) 700returnVal = IntrinsicFunctions.BitwiseXor(arg0, arg1); 704else if (string.Equals(methodName, nameof(IntrinsicFunctions.BitwiseNot), StringComparison.OrdinalIgnoreCase)) 708returnVal = IntrinsicFunctions.BitwiseNot(arg0); 712else if (string.Equals(methodName, nameof(IntrinsicFunctions.LeftShift), StringComparison.OrdinalIgnoreCase)) 716returnVal = IntrinsicFunctions.LeftShift(arg0, arg1); 720else if (string.Equals(methodName, nameof(IntrinsicFunctions.RightShift), StringComparison.OrdinalIgnoreCase)) 724returnVal = IntrinsicFunctions.RightShift(arg0, arg1); 728else if (string.Equals(methodName, nameof(IntrinsicFunctions.RightShiftUnsigned), StringComparison.OrdinalIgnoreCase)) 732returnVal = IntrinsicFunctions.RightShiftUnsigned(arg0, arg1); 736else if (string.Equals(methodName, nameof(IntrinsicFunctions.NormalizeDirectory), StringComparison.OrdinalIgnoreCase)) 740returnVal = IntrinsicFunctions.NormalizeDirectory(arg0); 744else if (string.Equals(methodName, nameof(IntrinsicFunctions.IsOSPlatform), StringComparison.OrdinalIgnoreCase)) 748returnVal = IntrinsicFunctions.IsOSPlatform(arg0); 837else if (receiverType == typeof(IntrinsicFunctions)) 906if (receiverType == typeof(IntrinsicFunctions)) 908if (string.Equals(methodName, nameof(IntrinsicFunctions.RegisterBuildCheck), StringComparison.OrdinalIgnoreCase)) 911ErrorUtilities.VerifyThrow(loggingContext != null, $"The logging context is missed. {nameof(IntrinsicFunctions.RegisterBuildCheck)} can not be invoked."); 914returnVal = IntrinsicFunctions.RegisterBuildCheck(projectPath, arg0, loggingContext);
Resources\Constants.cs (1)
339availableStaticMethods.TryAdd("MSBuild", new Tuple<string, Type>(null, typeof(IntrinsicFunctions)));
Microsoft.Build.Engine.UnitTests (8)
Evaluation\Expander_Tests.cs (8)
3950=> Enum.GetNames(typeof(IntrinsicFunctions.StringHashingAlgorithm)) 4456TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory())); 4462TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32())); 4468TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64())); 4474TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath())); 4480string vsInstallRoot = EscapingUtilities.Escape(IntrinsicFunctions.GetVsInstallRoot()); 4490TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath())); 4496TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32()));