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