123 references to IntrinsicFunctions
Microsoft.Build (115)
Evaluation\Expander.cs (114)
3463
if (_receiverType == typeof(Microsoft.Build.Evaluation.
IntrinsicFunctions
))
3541
if (_receiverType == typeof(
IntrinsicFunctions
))
3688
if (_receiverType == typeof(
IntrinsicFunctions
))
3690
if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.RegisterBuildCheck), StringComparison.OrdinalIgnoreCase))
3693
ErrorUtilities.VerifyThrow(_loggingContext != null, $"The logging context is missed. {nameof(
IntrinsicFunctions
.RegisterBuildCheck)} can not be invoked.");
3696
returnVal =
IntrinsicFunctions
.RegisterBuildCheck(projectPath, arg0, _loggingContext);
4010
else if (_receiverType == typeof(
IntrinsicFunctions
))
4012
if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.EnsureTrailingSlash), StringComparison.OrdinalIgnoreCase))
4016
returnVal =
IntrinsicFunctions
.EnsureTrailingSlash(arg0);
4020
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.ValueOrDefault), StringComparison.OrdinalIgnoreCase))
4024
returnVal =
IntrinsicFunctions
.ValueOrDefault(arg0, arg1);
4028
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.NormalizePath), StringComparison.OrdinalIgnoreCase))
4032
returnVal =
IntrinsicFunctions
.NormalizePath(Array.ConvertAll(args, o => (string)o));
4036
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetDirectoryNameOfFileAbove), StringComparison.OrdinalIgnoreCase))
4040
returnVal =
IntrinsicFunctions
.GetDirectoryNameOfFileAbove(arg0, arg1, _fileSystem);
4044
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetRegistryValueFromView), StringComparison.OrdinalIgnoreCase))
4049
returnVal =
IntrinsicFunctions
.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3));
4053
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.IsRunningFromVisualStudio), StringComparison.OrdinalIgnoreCase))
4057
returnVal =
IntrinsicFunctions
.IsRunningFromVisualStudio();
4061
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Escape), StringComparison.OrdinalIgnoreCase))
4065
returnVal =
IntrinsicFunctions
.Escape(arg0);
4069
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Unescape), StringComparison.OrdinalIgnoreCase))
4073
returnVal =
IntrinsicFunctions
.Unescape(arg0);
4077
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetPathOfFileAbove), StringComparison.OrdinalIgnoreCase))
4081
returnVal =
IntrinsicFunctions
.GetPathOfFileAbove(arg0, arg1, _fileSystem);
4085
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Add), StringComparison.OrdinalIgnoreCase))
4087
if (TryExecuteArithmeticOverload(args,
IntrinsicFunctions
.Add,
IntrinsicFunctions
.Add, out returnVal))
4092
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Subtract), StringComparison.OrdinalIgnoreCase))
4094
if (TryExecuteArithmeticOverload(args,
IntrinsicFunctions
.Subtract,
IntrinsicFunctions
.Subtract, out returnVal))
4099
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Multiply), StringComparison.OrdinalIgnoreCase))
4101
if (TryExecuteArithmeticOverload(args,
IntrinsicFunctions
.Multiply,
IntrinsicFunctions
.Multiply, out returnVal))
4106
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Divide), StringComparison.OrdinalIgnoreCase))
4108
if (TryExecuteArithmeticOverload(args,
IntrinsicFunctions
.Divide,
IntrinsicFunctions
.Divide, out returnVal))
4113
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.Modulo), StringComparison.OrdinalIgnoreCase))
4115
if (TryExecuteArithmeticOverload(args,
IntrinsicFunctions
.Modulo,
IntrinsicFunctions
.Modulo, out returnVal))
4120
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetCurrentToolsDirectory), StringComparison.OrdinalIgnoreCase))
4124
returnVal =
IntrinsicFunctions
.GetCurrentToolsDirectory();
4128
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetToolsDirectory32), StringComparison.OrdinalIgnoreCase))
4132
returnVal =
IntrinsicFunctions
.GetToolsDirectory32();
4136
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetToolsDirectory64), StringComparison.OrdinalIgnoreCase))
4140
returnVal =
IntrinsicFunctions
.GetToolsDirectory64();
4144
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetMSBuildSDKsPath), StringComparison.OrdinalIgnoreCase))
4148
returnVal =
IntrinsicFunctions
.GetMSBuildSDKsPath();
4152
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetVsInstallRoot), StringComparison.OrdinalIgnoreCase))
4156
returnVal =
IntrinsicFunctions
.GetVsInstallRoot();
4160
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetMSBuildExtensionsPath), StringComparison.OrdinalIgnoreCase))
4164
returnVal =
IntrinsicFunctions
.GetMSBuildExtensionsPath();
4168
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetProgramFiles32), StringComparison.OrdinalIgnoreCase))
4172
returnVal =
IntrinsicFunctions
.GetProgramFiles32();
4176
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionEquals), StringComparison.OrdinalIgnoreCase))
4180
returnVal =
IntrinsicFunctions
.VersionEquals(arg0, arg1);
4184
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionNotEquals), StringComparison.OrdinalIgnoreCase))
4188
returnVal =
IntrinsicFunctions
.VersionNotEquals(arg0, arg1);
4192
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionGreaterThan), StringComparison.OrdinalIgnoreCase))
4196
returnVal =
IntrinsicFunctions
.VersionGreaterThan(arg0, arg1);
4200
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionGreaterThanOrEquals), StringComparison.OrdinalIgnoreCase))
4204
returnVal =
IntrinsicFunctions
.VersionGreaterThanOrEquals(arg0, arg1);
4208
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionLessThan), StringComparison.OrdinalIgnoreCase))
4212
returnVal =
IntrinsicFunctions
.VersionLessThan(arg0, arg1);
4216
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.VersionLessThanOrEquals), StringComparison.OrdinalIgnoreCase))
4220
returnVal =
IntrinsicFunctions
.VersionLessThanOrEquals(arg0, arg1);
4224
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetTargetFrameworkIdentifier), StringComparison.OrdinalIgnoreCase))
4228
returnVal =
IntrinsicFunctions
.GetTargetFrameworkIdentifier(arg0);
4232
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetTargetFrameworkVersion), StringComparison.OrdinalIgnoreCase))
4236
returnVal =
IntrinsicFunctions
.GetTargetFrameworkVersion(arg0);
4241
returnVal =
IntrinsicFunctions
.GetTargetFrameworkVersion(arg1, arg2);
4245
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.IsTargetFrameworkCompatible), StringComparison.OrdinalIgnoreCase))
4249
returnVal =
IntrinsicFunctions
.IsTargetFrameworkCompatible(arg0, arg1);
4253
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetTargetPlatformIdentifier), StringComparison.OrdinalIgnoreCase))
4257
returnVal =
IntrinsicFunctions
.GetTargetPlatformIdentifier(arg0);
4261
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.GetTargetPlatformVersion), StringComparison.OrdinalIgnoreCase))
4265
returnVal =
IntrinsicFunctions
.GetTargetPlatformVersion(arg0);
4270
returnVal =
IntrinsicFunctions
.GetTargetPlatformVersion(arg1, arg2);
4274
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.ConvertToBase64), StringComparison.OrdinalIgnoreCase))
4278
returnVal =
IntrinsicFunctions
.ConvertToBase64(arg0);
4282
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.ConvertFromBase64), StringComparison.OrdinalIgnoreCase))
4286
returnVal =
IntrinsicFunctions
.ConvertFromBase64(arg0);
4290
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.StableStringHash), StringComparison.OrdinalIgnoreCase))
4296
?
IntrinsicFunctions
.StableStringHash(arg0)
4297
:
IntrinsicFunctions
.StableStringHashLegacy(arg0);
4300
else if (TryGetArgs(args, out string arg1, out string arg2) && Enum.TryParse<
IntrinsicFunctions
.StringHashingAlgorithm>(arg2, true, out var hashAlgorithm))
4302
returnVal =
IntrinsicFunctions
.StableStringHash(arg1, hashAlgorithm);
4306
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.AreFeaturesEnabled), StringComparison.OrdinalIgnoreCase))
4310
returnVal =
IntrinsicFunctions
.AreFeaturesEnabled(arg0);
4314
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.SubstringByAsciiChars), StringComparison.OrdinalIgnoreCase))
4318
returnVal =
IntrinsicFunctions
.SubstringByAsciiChars(arg0, arg1, arg2);
4322
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.CheckFeatureAvailability), StringComparison.OrdinalIgnoreCase))
4326
returnVal =
IntrinsicFunctions
.CheckFeatureAvailability(arg0);
4330
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.BitwiseOr), StringComparison.OrdinalIgnoreCase))
4334
returnVal =
IntrinsicFunctions
.BitwiseOr(arg0, arg1);
4338
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.BitwiseAnd), StringComparison.OrdinalIgnoreCase))
4342
returnVal =
IntrinsicFunctions
.BitwiseAnd(arg0, arg1);
4346
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.BitwiseXor), StringComparison.OrdinalIgnoreCase))
4350
returnVal =
IntrinsicFunctions
.BitwiseXor(arg0, arg1);
4354
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.BitwiseNot), StringComparison.OrdinalIgnoreCase))
4358
returnVal =
IntrinsicFunctions
.BitwiseNot(arg0);
4362
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.LeftShift), StringComparison.OrdinalIgnoreCase))
4366
returnVal =
IntrinsicFunctions
.LeftShift(arg0, arg1);
4370
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.RightShift), StringComparison.OrdinalIgnoreCase))
4374
returnVal =
IntrinsicFunctions
.RightShift(arg0, arg1);
4378
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.RightShiftUnsigned), StringComparison.OrdinalIgnoreCase))
4382
returnVal =
IntrinsicFunctions
.RightShiftUnsigned(arg0, arg1);
4386
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.NormalizeDirectory), StringComparison.OrdinalIgnoreCase))
4390
returnVal =
IntrinsicFunctions
.NormalizeDirectory(arg0);
4394
else if (string.Equals(_methodMethodName, nameof(
IntrinsicFunctions
.IsOSPlatform), StringComparison.OrdinalIgnoreCase))
4398
returnVal =
IntrinsicFunctions
.IsOSPlatform(arg0);
5455
if (_receiverType == typeof(Microsoft.Build.Evaluation.
IntrinsicFunctions
))
5488
if (receiverType == typeof(Microsoft.Build.Evaluation.
IntrinsicFunctions
))
5549
else if (_receiverType == typeof(
IntrinsicFunctions
) && IntrinsicFunctionOverload.IsKnownOverloadMethodName(_methodMethodName))
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()));