382 references to IsWindows
Microsoft.Build (20)
BackEnd\BuildManager\BuildManager.cs (1)
506if (NativeMethodsShared.IsWindows || parameters.LowPriority)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
888if (!NativeMethodsShared.IsWindows || BuildEnvironmentHelper.Instance.RunningInVisualStudio)
BackEnd\Components\Communications\NodeLauncher.cs (1)
65return NativeMethodsShared.IsWindows
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
56if (NativeMethodsShared.IsWindows)
BackEnd\Node\OutOfProcNode.cs (1)
884if (!lowPriority || NativeMethodsShared.IsWindows)
BackEnd\Node\OutOfProcServerNode.cs (1)
409if (NativeMethodsShared.IsWindows && command.ConsoleConfiguration.BufferWidth > 0)
Evaluation\Evaluator.cs (1)
1159if (!NativeMethodsShared.IsWindows)
Evaluation\Expander.cs (2)
1746if (!NativeMethodsShared.IsWindows) 1786if (!NativeMethodsShared.IsWindows && !registryKeyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Evaluation\IntrinsicFunctions.cs (5)
206if (!NativeMethodsShared.IsWindows) 222if (!NativeMethodsShared.IsWindows) 235if (!NativeMethodsShared.IsWindows) 257if (!NativeMethodsShared.IsWindows) 288if (!NativeMethodsShared.IsWindows && !keyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Instance\HostServices.cs (1)
89if (NativeMethodsShared.IsWindows)
Instance\RunningObjectTable.cs (2)
27if (!NativeMethodsShared.IsWindows) 95if (NativeMethodsShared.IsWindows && Ole32.GetErrorInfo(0, out IErrorInfo errorInfo) == 0 && errorInfo != null)
Logging\BaseConsoleLogger.cs (1)
265runningWithCharacterFileType = NativeMethodsShared.IsWindows && ConsoleConfiguration.OutputIsScreen;
Logging\InProcessConsoleConfiguration.cs (2)
27if (NativeMethodsShared.IsWindows && !Console.IsOutputRedirected) 78if (NativeMethodsShared.IsWindows)
Microsoft.Build.BuildCheck.UnitTests (8)
DoubleWritesAnalyzer_Tests.cs (1)
28string projectFile = Framework.NativeMethods.IsWindows ? @"C:\fake\project.proj" : "/fake/project.proj";
ExecCliBuildCheck_Tests.cs (1)
94string projectFile = Framework.NativeMethods.IsWindows ? @"C:\fake\project.proj" : "/fake/project.proj";
SharedOutputPathCheck_Tests.cs (6)
41string projectFile1 = Framework.NativeMethods.IsWindows ? "C:\\fake1\\project1.proj" : "/fake1/project1.proj"; 51string projectFile2 = Framework.NativeMethods.IsWindows ? "C:\\fake2\\project2.proj" : "/fake2/project2.proj"; 68string projectFile1 = Framework.NativeMethods.IsWindows ? "C:\\fake\\project1.proj" : "/fake/project1.proj"; 69string projectFile2 = Framework.NativeMethods.IsWindows ? "C:\\fake\\project2.proj" : "/fake/project2.proj"; 93string wrongPathSeparator = Framework.NativeMethods.IsWindows ? "/" : "\\"; 108string projectFolder = Framework.NativeMethods.IsWindows ? "C:\\fake\\" : "/fake/";
Microsoft.Build.CommandLine.UnitTests (10)
XMake_Tests.cs (10)
1244NativeMethodsShared.IsWindows ? @"c:\bin\msbuild.exe" : "/msbuild.exe", 1271private readonly string _pathToArbitraryBogusFile = NativeMethodsShared.IsWindows // OK on 64 bit as well 1281var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1287output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1296var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1302if (NativeMethodsShared.IsWindows) 1310output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1326var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1336output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 2259fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + (NativeMethodsShared.IsWindows ? "c:\\temp\\cat.log" : "/tmp/cat.log") };
Microsoft.Build.Engine.OM.UnitTests (36)
Construction\SolutionFile_Tests.cs (1)
735return usesNewParser && !NativeMethodsShared.IsWindows ? path.Replace('\\', '/') : path;
Construction\WhiteSpacePreservation_Tests.cs (1)
450if (NativeMethodsShared.IsWindows)
Definition\DefinitionEditing_Tests.cs (9)
329NativeMethodsShared.IsWindows 522NativeMethodsShared.IsWindows ? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x"); 528NativeMethodsShared.IsWindows ? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[ 532NativeMethodsShared.IsWindows ? 1522xml.AddImport(NativeMethodsShared.IsWindows ? 2252NativeMethodsShared.IsWindows ? @"c:\" + Guid.NewGuid().ToString() + @"\**\i1" : "/" + Guid.NewGuid().ToString() + "/**/i1"); 2442NativeMethodsShared.IsWindows ? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x"); 2446NativeMethodsShared.IsWindows ? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[0].Xml; 2449NativeMethodsShared.IsWindows ?
Definition\Project_Tests.cs (2)
43private readonly int RootPrefixLength = NativeMethodsShared.IsWindows ? 3 : 1; 682if (NativeMethodsShared.IsWindows)
Definition\ProjectCollection_Tests.cs (1)
409string projectDirectory = NativeMethodsShared.IsWindows ? "c:\\1" : "/l";
Definition\ProjectItem_Tests.cs (12)
284NativeMethodsShared.IsWindows ? @"<i Include='c:\foo\bar.baz'/>" : @"<i Include='/foo/bar.baz'/>"); 298NativeMethodsShared.IsWindows ? @"c:\foo\bar.baz" : "/foo/bar.baz", 300Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", item.GetMetadataValue("RootDir")); 303Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\foo\" : "/foo/", item.GetMetadataValue("RelativeDir")); 304Assert.Equal(NativeMethodsShared.IsWindows ? @"foo\" : "foo/", item.GetMetadataValue("Directory")); 307NativeMethodsShared.IsWindows ? @"c:\foo\bar.baz" : "/foo/bar.baz", 369"<i Include='" + directory + (NativeMethodsShared.IsWindows ? @"\**\*'/>" : "/**/*'/>")); 371Assert.Equal(NativeMethodsShared.IsWindows ? @"b\" : "b/", item.GetMetadataValue("RecursiveDir")); 414IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='i0;" + directory + (NativeMethodsShared.IsWindows ? @"\**\*;i2'/>" : "/**/*;i2'/>")); 418Assert.Equal(NativeMethodsShared.IsWindows ? @"b\" : "b/", items[1].GetMetadataValue("RecursiveDir")); 751if (NativeMethodsShared.IsWindows) 1650<i Include='i1.cpp;" + (NativeMethodsShared.IsWindows ? @"c:\bar\i2.cpp" : "/bar/i2.cpp") + @"'>
Definition\ProjectItemDefinition_Tests.cs (4)
240<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 267<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 294<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 323<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'>
Definition\ProjectProperty_Tests.cs (2)
154string varName = NativeMethodsShared.IsWindows ? "username" : "USER"; 177string varName = NativeMethodsShared.IsWindows ? "username" : "USER";
Instance\ProjectInstance_Tests.cs (3)
893instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 918instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 940instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue =
Instance\ProjectItemInstance_Tests.cs (1)
751<i Include='i1.cpp;" + (NativeMethodsShared.IsWindows ? @"c:\bar\i2.cpp" : "/bar/i2.cpp") + @"'>
Microsoft.Build.Engine.UnitTests (59)
BackEnd\AppHostSupport_Tests.cs (1)
27private readonly string _dotnetHostPath = NativeMethodsShared.IsWindows
BackEnd\BuildRequestConfiguration_Tests.cs (1)
540if (!NativeMethodsShared.IsWindows)
Construction\SolutionFile_NewParser_Tests.cs (1)
156return !NativeMethodsShared.IsWindows ? path.Replace('\\', '/') : path;
Construction\SolutionFile_OldParser_Tests.cs (7)
36p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 58p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 75p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 94p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 150p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 611string expectedPath3 = NativeMethodsShared.IsWindows ? @"ETPProjUpgradeTest\someproj3.etp" : "ETPProjUpgradeTest/someproj3.etp"; 715p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln";
Definition\Toolset_Tests.cs (1)
54if (NativeMethodsShared.IsWindows)
Definition\ToolsetConfigurationReader_Tests.cs (1)
566if (NativeMethodsShared.IsWindows)
Definition\ToolsVersion_Tests.cs (18)
33string dir = NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2"; 34string overrideDir = NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks"; 159NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2", 240string dir = NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2"; 241string overrideDir = NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks"; 926NativeMethodsShared.IsWindows ? "c:\\inline" : "/inline", 993new DefaultTasksFile(NativeMethodsShared.IsWindows 1002new DefaultTasksFile(NativeMethodsShared.IsWindows 1008new DefaultTasksFile(NativeMethodsShared.IsWindows 1014new DefaultTasksFile(NativeMethodsShared.IsWindows 1020new DefaultTasksFile(NativeMethodsShared.IsWindows 1026new DefaultTasksFile(NativeMethodsShared.IsWindows 1032new DefaultTasksFile(NativeMethodsShared.IsWindows 1040new DefaultTasksFile(NativeMethodsShared.IsWindows 1048new DefaultTasksFile(NativeMethodsShared.IsWindows 1054new DefaultTasksFile(NativeMethodsShared.IsWindows 1067new DefaultTasksFile(NativeMethodsShared.IsWindows 1076new DefaultTasksFile(NativeMethodsShared.IsWindows
Evaluation\Evaluator_Tests.cs (12)
174string fooPath = NativeMethodsShared.IsWindows ? @"c:\temp\foo.import" : "/temp/foo.import"; 175string barPath = NativeMethodsShared.IsWindows ? @"c:\temp\bar.import" : "/temp/bar.import"; 1363string targets1FileName = NativeMethodsShared.IsWindows ? @"c:\a\t1.targets" : "/a/t1.targets"; 1364string aDirName = NativeMethodsShared.IsWindows ? @"c:\a\" : "/a/"; 1365string targets2FileName = NativeMethodsShared.IsWindows ? @"c:\a\b\t2.targets" : "/a/b/t2.targets"; 1366string bDirName = NativeMethodsShared.IsWindows ? @"c:\a\b\" : "/a/b/"; 1367string targets3FileName = NativeMethodsShared.IsWindows ? @"c:\t3.targets" : "/t3.targets"; 1368string rootDirName = NativeMethodsShared.IsWindows ? @"c:\" : "/"; 1369string aProjName = NativeMethodsShared.IsWindows ? @"c:\a\p.proj" : "/a/p.proj"; 2799string file = NativeMethodsShared.IsWindows ? @"c:\foo\bar.csproj" : "/foo/bar.csproj"; 2818string file = NativeMethodsShared.IsWindows ? @"c:\bar.csproj" : "/bar.csproj"; 2819string dir = NativeMethodsShared.IsWindows ? @"c:\" : "/";
Evaluation\Expander_Tests.cs (10)
43private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 1415NativeMethodsShared.IsWindows ? @"subdir1\engine.dll" : "subdir1/engine.dll", project.FullPath); 1419NativeMethodsShared.IsWindows ? @"subdir2\tasks.dll" : "subdir2/tasks.dll", project.FullPath); 1905string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3879string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3903string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3927string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3951string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 4350if (NativeMethodsShared.IsWindows) 4355if (!NativeMethodsShared.IsWindows)
Evaluation\ItemEvaluation_Tests.cs (1)
607if (!NativeMethodsShared.IsWindows)
Evaluation\ItemSpec_Tests.cs (1)
44var absoluteRootPath = NativeMethodsShared.IsWindows
Globbing\MSBuildGlob_Tests.cs (5)
40var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 116var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 137var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 157var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 360return NativeMethodsShared.IsWindows ? normalizedPath.Replace("\\\\", "\\") : normalizedPath;
Microsoft.Build.Framework (54)
BackEnd\CommunicationsUtilities.cs (1)
272if (NativeMethods.IsWindows)
BackEnd\Handshake.cs (1)
90if (includeSessionId && NativeMethods.IsWindows)
BuildEnvironmentHelper.cs (3)
133if (!NativeMethods.IsWindows) 165if (NativeMethods.IsWindows && 239if (NativeMethods.IsWindows &&
Constants.cs (2)
31internal static readonly string DotnetProcessName = NativeMethods.IsWindows ? "dotnet.exe" : "dotnet"; 46internal static readonly string MSBuildExecutableName = NativeMethods.IsWindows ? $"{MSBuildAppName}.exe" : MSBuildAppName;
EncodingUtilities.cs (2)
58if (NativeMethods.IsWindows) 224if (!NativeMethods.IsWindows)
FileSystem\FileSystems.cs (1)
17if (NativeMethods.IsWindows)
FileSystem\ManagedFileSystem.cs (1)
28return NativeMethods.IsWindows;
FileUtilities.cs (7)
246=> NativeMethods.IsWindows && path.IndexOf(UnixDirectorySeparator) >= 0; 686if (NativeMethods.IsWindows) 711if (!NativeMethods.IsWindows || !path.StartsWith(@"\\", StringComparison.Ordinal)) 772if (NativeMethods.IsWindows || string.IsNullOrEmpty(value) 793if (NativeMethods.IsWindows || value.IsEmpty) 874if (NativeMethods.IsWindows) 1002if (NativeMethods.IsWindows && !EndsWithSlash(fullPath))
ItemSpecModifiers.cs (1)
547if (NativeMethods.IsWindows)
NativeMethods.cs (17)
441if (IsWindows) 486if (IsWindows) 612if (!IsWindows) 669if (IsWindows) 818get { return IsWindows ? "Windows_NT" : "Unix"; } 993if (IsWindows) 1033if (!IsWindows) 1110if (IsWindows) 1128if (IsWindows) 1188if (IsWindows) 1502if (IsWindows) 1588if (IsWindows) 1635if (IsWindows && originalConsoleMode is not null) 1718if (IsWindows) 1825return IsWindows 1840return IsWindows 1855return IsWindows
Utilities\FileMatcher.cs (2)
1257bool isUncPath = NativeMethods.IsWindows && fixedDir.Length > 1 2273if (NativeMethods.IsWindows &&
Utilities\FrameworkLocationHelper.cs (15)
93internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethods.IsWindows ? "v1.1" : "1.1"; // v1.1 is for Everett. 98internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethods.IsWindows ? "v2.0" : "2.0"; // v2.0 is for Whidbey. 102internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethods.IsWindows ? "v3.0" : "3.0"; // v3.0 is for WinFx. 116internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethods.IsWindows ? "v3.5" : "3.5"; // v3.5 is for Orcas. 122internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethods.IsWindows ? "v4.0" : "4.0"; 123internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethods.IsWindows ? "v4.5" : "4.5"; 538if (!NativeMethods.IsWindows) 588if (NativeMethods.IsWindows) 635if (NativeMethods.IsWindows) 796if (NativeMethods.IsWindows) 829if (!NativeMethods.IsWindows) 986combinedPath = NativeMethods.IsWindows 1196dotNetFrameworkVersionFolderPrefix: NativeMethods.IsWindows ? "v4.0" : "v4.5", 1430if (NativeMethods.IsWindows && !CheckForFrameworkInstallation( 1572if (NativeMethods.IsWindows)
Utilities\ProcessExtensions.cs (1)
25if (NativeMethods.IsWindows)
Microsoft.Build.Framework.UnitTests (33)
FileClassifier_Tests.cs (3)
31var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr"; 45var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr"; 63var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr";
FileMatcher_Tests.cs (17)
1002if (NativeMethodsShared.IsWindows) 1016NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1017NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1470string[] strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1471strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1474strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1475strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1476Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "directory\\1.file" : "directory/1.file"); 1478strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1479strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1482strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1483strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1484Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file"); 1486strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file" }; 1487strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1488Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file"); 1490if (NativeMethodsShared.IsWindows)
FileUtilities_Tests.cs (13)
52string itemSpec = NativeMethodsShared.IsWindows ? @"c:\foo.txt" : "/foo.txt"; 53string itemSpecDir = NativeMethodsShared.IsWindows ? @"c:\" : "/"; 73string projectPath = NativeMethodsShared.IsWindows ? @"c:\abc\goo.proj" : @"/abc/goo.proj"; 74string projectPathDir = NativeMethodsShared.IsWindows ? @"c:\abc\" : @"/abc/"; 91if (NativeMethodsShared.IsWindows) 246Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\" : "/")); 247Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\foo" : "/foo")); 248Assert.Equal(NativeMethodsShared.IsWindows ? @"c:" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:" : "/")); 531var isWindows = NativeMethodsShared.IsWindows; 997string root = NativeMethodsShared.IsWindows ? @"c:\" : "/";
Microsoft.Build.Tasks.Core (26)
AssemblyDependency\AssemblyInformation.cs (1)
245if (!NativeMethodsShared.IsWindows)
AssemblyDependency\AssemblyMetadata.cs (1)
30ScatterFiles = NativeMethodsShared.IsWindows ? import.Files : null;
AssemblyDependency\Reference.cs (1)
514else if (NativeMethodsShared.IsWindows)
AssemblyFoldersEx.cs (1)
80if (!NativeMethodsShared.IsWindows)
Copy.cs (1)
357if (!NativeMethodsShared.IsWindows)
Exec.cs (3)
501if (NativeMethodsShared.IsWindows) 593if (NativeMethodsShared.IsWindows) 654protected override string ToolName => NativeMethodsShared.IsWindows ? "cmd.exe" : "sh";
FileState.cs (3)
91if (NativeMethodsShared.IsWindows) 104if (NativeMethodsShared.IsWindows) 178if (NativeMethodsShared.IsWindows)
GenerateApplicationManifest.cs (1)
115if (!NativeMethodsShared.IsWindows)
GenerateDeploymentManifest.cs (1)
157if (!NativeMethodsShared.IsWindows)
GenerateLauncher.cs (1)
45if (!NativeMethodsShared.IsWindows)
GenerateManifestBase.cs (1)
275if (!NativeMethodsShared.IsWindows)
GetInstalledSDKLocations.cs (1)
131if (!NativeMethodsShared.IsWindows)
GetSDKReferenceFiles.cs (1)
230if (!NativeMethodsShared.IsWindows)
ManifestUtil\SecurityUtil.cs (1)
869if (NativeMethodsShared.IsWindows && (toolPath == null || !FileSystems.Default.FileExists(toolPath)))
NativeMethods.cs (5)
808if (NativeMethodsShared.IsWindows) 841if (NativeMethodsShared.IsWindows) 992if (NativeMethodsShared.IsWindows) 1292if (NativeMethodsShared.IsWindows) 1352if (NativeMethodsShared.IsWindows)
NodePipeClient.cs (1)
18private static readonly bool s_useHandhakeTimeout = !NativeMethodsShared.IsWindows;
ResolveSDKReference.cs (1)
272if (!NativeMethodsShared.IsWindows)
SignFile.cs (1)
47if (!NativeMethodsShared.IsWindows)
Microsoft.Build.Tasks.UnitTests (69)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (1)
188protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString();
AssignTargetPath_Tests.cs (12)
24{ new TaskItem(NativeMethodsShared.IsWindows ? @"c:\bin2\abc.efg" : "/bin2/abc.efg") }; 25t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\bin" : "/bin"; 29t.AssignedFiles[0].ItemSpec.ShouldBe(NativeMethodsShared.IsWindows ? @"c:\bin2\abc.efg" : "/bin2/abc.efg"); 40{ new TaskItem(NativeMethodsShared.IsWindows ? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt") }; 41t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2"; 57NativeMethodsShared.IsWindows ? @"d:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt") 63t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1" : "/x1"; 79NativeMethodsShared.IsWindows ? @"c:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt") 81t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2"; 85t.AssignedFiles[0].GetMetadata("TargetPath").ShouldBe(NativeMethodsShared.IsWindows ? @"f3\f4\file.txt" : "f3/f4/file.txt"); 105itemSpec: NativeMethodsShared.IsWindows ? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt", 108t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2";
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
71projectDirectoryPath = NativeMethodsShared.IsWindows ? projectDirectoryPath.Replace(":\\", "\\") : projectDirectoryPath.Replace("/", "\\"); 123projectDirectory = NativeMethodsShared.IsWindows ? projectDirectory.Replace(":\\", "\\") : projectDirectory.Replace("/", "\\");
CombinePath_Tests.cs (11)
47string path1 = NativeMethodsShared.IsWindows ? @"c:\ghi.txt" : "/ghi.txt"; 48string path2 = NativeMethodsShared.IsWindows ? @"d:\jkl\mno.txt" : "/jkl/mno.txt"; 50string pathsToMatch = string.Format(NativeMethodsShared.IsWindows ? @" 59t.Paths = NativeMethodsShared.IsWindows 76t.BasePath = NativeMethodsShared.IsWindows ? @"c:\abc\def" : "/abc/def"; 96t.BasePath = NativeMethodsShared.IsWindows ? @"\\fileserver\public" : "/rootdir/public"; 97string path1 = NativeMethodsShared.IsWindows ? @"c:\ghi.txt" : "/ghi.txt"; 98string path2 = NativeMethodsShared.IsWindows ? @"d:\jkl\mno.txt" : "/jkl/mno.txt"; 100string pathsToMatch = string.Format(NativeMethodsShared.IsWindows ? @" 108t.Paths = NativeMethodsShared.IsWindows 126if (NativeMethodsShared.IsWindows)
Copy_Tests.cs (1)
1406if (NativeMethodsShared.IsWindows)
Exec_Tests.cs (22)
146Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "xcopy thisisanonexistentfile" : "cp thisisanonexistentfile thatisanonexistentfile"); 150Assert.Equal(NativeMethodsShared.IsWindows ? 4 : 1, exec.ExitCode); 152if (!NativeMethodsShared.IsWindows) 162int expectedExitCode = NativeMethodsShared.IsWindows ? -1 : 137; 164Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 194Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 208exec.ExitCode.ShouldBe(NativeMethodsShared.IsWindows ? -1 : 137); 237var cmdLine = NativeMethodsShared.IsWindows 265var cmdLine = NativeMethodsShared.IsWindows 289Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 290string working = !NativeMethodsShared.IsWindows ? "/usr/lib" : 322Directory.SetCurrentDirectory(NativeMethodsShared.IsWindows ? 325Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 599if (!NativeMethodsShared.IsWindows) 660if (NativeMethodsShared.IsWindows) 683if (NativeMethodsShared.IsWindows) 714if (NativeMethodsShared.IsWindows) 746var cmdLine = NativeMethodsShared.IsWindows 762var cmdLine = NativeMethodsShared.IsWindows 812var cmdLine = NativeMethodsShared.IsWindows 908exec.Command = NativeMethodsShared.IsWindows ? "echo [%MYENVVAR%]" : "echo [$myenvvar]"; 1061Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? $"type {textFilePath}" : $"cat {textFilePath}");
FindUnderPath_Tests.cs (3)
106new TaskItem(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt") }; 140Assert.Equal(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt", 163Assert.Equal(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
MakeDir_Tests.cs (2)
92if (NativeMethodsShared.IsWindows) 116if (!NativeMethodsShared.IsWindows)
ResolveSDKReference_Tests.cs (2)
25private readonly string _sdkPath = NativeMethodsShared.IsWindows 1519string goodSDKLocation = NativeMethodsShared.IsWindows ? "C:\\GoodSDKLocation\\" : "/GoodSDKLocation/";
ResourceHandling\GenerateResource_Tests.cs (7)
430NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap, 698NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap); 744if (!NativeMethodsShared.IsWindows) 954if (!NativeMethodsShared.IsWindows) 3107t.StronglyTypedFileName = NativeMethodsShared.IsWindows ? "||" : "\0"; 4364NativeMethodsShared.IsWindows 4454NativeMethodsShared.IsWindows ? smallestBitmapFile.ToUpperInvariant() : smallestBitmapFile,
Touch_Tests.cs (4)
26internal static string myexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch\myexisting.txt" : @"/touch/myexisting.txt"; 27internal static string mynonexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch\mynonexisting.txt" : @"/touch/mynonexisting.txt"; 28internal static string nonexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch-nonexistent\file.txt" : @"/touch-nonexistent/file.txt"; 29internal static string myreadonly_txt = NativeMethodsShared.IsWindows ? @"c:\touch\myreadonly.txt" : @"/touch/myreadonly.txt";
Unzip_Tests.cs (1)
161if (NativeMethodsShared.IsWindows)
WriteCodeFragment_Tests.cs (1)
610public static string EscapedLineSeparator => NativeMethodsShared.IsWindows ? "\\r\\n" : "\\n";
Microsoft.Build.UnitTests.Shared (7)
DummyMappedDrive.cs (2)
24if (!NativeMethodsShared.IsWindows) 60if (_mapped && NativeMethodsShared.IsWindows)
DummyMappedDriveUtils.cs (1)
25return NativeMethods.IsWindows ? new DummyMappedDrive() : default;
ObjectModelHelpers.cs (2)
2009NativeMethodsShared.IsWindows 2020NativeMethodsShared.IsWindows
RequiresSymbolicLinksFactAttribute.cs (1)
22if (s_runningInAzurePipeline || !NativeMethodsShared.IsWindows)
RunnerUtilities.cs (1)
100if (NativeMethodsShared.IsWindows)
Microsoft.Build.Utilities.Core (10)
AssemblyFoldersEx.cs (1)
80if (!NativeMethodsShared.IsWindows)
LockCheck.cs (1)
259if (NativeMethodsShared.IsWindows)
ToolLocationHelper.cs (4)
1826if (NativeMethodsShared.IsWindows && platformTarget != null) 2444string registryRoot = NativeMethodsShared.IsWindows ? GetTargetPlatformMonikerRegistryRoots(registrySearchLocation) : string.Empty; 2469if (NativeMethodsShared.IsWindows) 2895if (NativeMethodsShared.IsWindows)
ToolTask.cs (4)
673if (NativeMethodsShared.IsWindows) 808if (NativeMethodsShared.IsWindows) 1507bool runningOnWindows = NativeMethodsShared.IsWindows; 1740if (NativeMethodsShared.IsWindows)
Microsoft.Build.Utilities.UnitTests (49)
ProcessExtensions_Tests.cs (4)
25var psi = NativeMethodsShared.IsWindows 36NativeMethodsShared.IsWindows ? 64if (NativeMethodsShared.IsWindows) 94if (NativeMethodsShared.IsWindows)
TaskItem_Tests.cs (2)
226from.ItemSpec = NativeMethodsShared.IsWindows ? @"c:\subdir\Monkey.txt" : "/subdir/Monkey.txt"; 227from.GetMetadata(ItemSpecModifiers.Directory).ShouldBe(NativeMethodsShared.IsWindows ? @"subdir\" : "subdir/");
ToolLocationHelper_Tests.cs (11)
372NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll"); 384NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll", 1260string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1281string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1303string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1324string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1347string targetFrameworkRootPath = NativeMethodsShared.IsWindows 3068string tooLongPath = NativeMethodsShared.IsWindows 3103string normalDirectory = NativeMethodsShared.IsWindows ? "c:\\SDKPath" : "/SDKPath"; 3124string frameworkPathPattern = NativeMethodsShared.IsWindows ? @"Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MyFramework" : "Microsoft SDKs/Windows/v8.0/ExtensionSDKs/MyFramework"; 3125string frameworkPathPattern2 = NativeMethodsShared.IsWindows ? @"ExtensionSDKs\MyFramework" : "ExtensionSDKs/MyFramework";
ToolTask_Tests.cs (32)
114if (!NativeMethodsShared.IsWindows && string.IsNullOrEmpty(responseFileCommands) && string.IsNullOrEmpty(commandLineCommands)) 121StartInfo = GetProcessStartInfo(GenerateFullPathToTool(), NativeMethodsShared.IsWindows ? "/x" : string.Empty, null); 133t.ToolPath = NativeMethodsShared.IsWindows ? @"C:\MyAlternatePath" : "/MyAlternatePath"; 149t.ToolPath = NativeMethodsShared.IsWindows ? @"C:\MyAlternatePath" : "/MyAlternatePath"; 169t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.IsWindows ? "attrib.exe" : "ps"); 191t.MockCommandLineCommands = NativeMethodsShared.IsWindows ? "/C garbagegarbagegarbagegarbage.exe" : "-c garbagegarbagegarbagegarbage.exe"; 194t.ExitCode.ShouldBe(NativeMethodsShared.IsWindows ? 1 : 127); // cmd.exe error code is 1, sh error code is 127 216t.MockCommandLineCommands = NativeMethodsShared.IsWindows 243t.MockCommandLineCommands = NativeMethodsShared.IsWindows 275string singleQuote = NativeMethodsShared.IsWindows ? "'" : string.Empty; 292t.MockCommandLineCommands = NativeMethodsShared.IsWindows 316t.MockCommandLineCommands = NativeMethodsShared.IsWindows 343t.MockCommandLineCommands = NativeMethodsShared.IsWindows 373t.MockCommandLineCommands = NativeMethodsShared.IsWindows 402t.FullToolName = NativeMethodsShared.IsWindows ? "c:\\baz\\foo.exe" : "/baz/foo.exe"; 417string shellName = NativeMethodsShared.IsWindows ? "cmd.exe" : "sh"; 418string copyName = NativeMethodsShared.IsWindows ? "xcopy.exe" : "cp"; 470string toolName = NativeMethodsShared.IsWindows ? "cmd.exe" : "sh"; 498t.FullToolName = NativeMethodsShared.IsWindows ? "findstr.exe" : "grep"; 526t.FullToolName = NativeMethodsShared.IsWindows ? "findstr.exe" : "grep"; 548string toolName = NativeMethodsShared.IsWindows ? "cmd.exe" : "sh"; 587t.MockCommandLineCommands = NativeMethodsShared.IsWindows 614string userVarName = NativeMethodsShared.IsWindows ? "username" : "user"; 628if (NativeMethodsShared.IsWindows) 720string toolName = NativeMethodsShared.IsWindows ? "cmd" : "sh"; 762if (NativeMethodsShared.IsWindows) 801t.MockCommandLineCommands = NativeMethodsShared.IsWindows 834t.MockCommandLineCommands = NativeMethodsShared.IsWindows 1071t.MockCommandLineCommands = NativeMethodsShared.IsWindows 1103t.MockCommandLineCommands = NativeMethodsShared.IsWindows ? 1458string toolName = NativeMethodsShared.IsWindows ? "mytesttool.exe" : "mytesttool"; 1561string toolName = NativeMethodsShared.IsWindows ? "mytool.exe" : "mytool";
MSBuild (1)
XMake.cs (1)
1921if (NativeMethodsShared.IsWindows &&