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