388 references to IsWindows
Microsoft.Build (22)
BackEnd\BuildManager\BuildManager.cs (1)
506if (NativeMethodsShared.IsWindows || parameters.LowPriority)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
884if (!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)
CommunicationsUtilities.cs (2)
287if (includeSessionId && NativeMethodsShared.IsWindows) 583if (!NativeMethodsShared.IsWindows)
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)
1246NativeMethodsShared.IsWindows ? @"c:\bin\msbuild.exe" : "/msbuild.exe", 1273private readonly string _pathToArbitraryBogusFile = NativeMethodsShared.IsWindows // OK on 64 bit as well 1283var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1289output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1298var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1304if (NativeMethodsShared.IsWindows) 1312output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1328var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1338output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 2261fileLoggerParameters = 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)
44private readonly int RootPrefixLength = NativeMethodsShared.IsWindows ? 3 : 1; 683if (NativeMethodsShared.IsWindows)
Definition\ProjectCollection_Tests.cs (1)
410string 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)
894instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 919instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 941instance.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)
28private readonly string _dotnetHostPath = NativeMethodsShared.IsWindows
BackEnd\BuildRequestConfiguration_Tests.cs (1)
541if (!NativeMethodsShared.IsWindows)
Construction\SolutionFile_NewParser_Tests.cs (1)
157return !NativeMethodsShared.IsWindows ? path.Replace('\\', '/') : path;
Construction\SolutionFile_OldParser_Tests.cs (7)
37p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 59p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 76p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 95p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 151p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 612string expectedPath3 = NativeMethodsShared.IsWindows ? @"ETPProjUpgradeTest\someproj3.etp" : "ETPProjUpgradeTest/someproj3.etp"; 716p.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)
44private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 1416NativeMethodsShared.IsWindows ? @"subdir1\engine.dll" : "subdir1/engine.dll", project.FullPath); 1420NativeMethodsShared.IsWindows ? @"subdir2\tasks.dll" : "subdir2/tasks.dll", project.FullPath); 1906string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3880string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3904string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3928string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3952string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 4351if (NativeMethodsShared.IsWindows) 4356if (!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 (55)
BuildEnvironmentHelper.cs (3)
133if (!NativeMethods.IsWindows) 165if (NativeMethods.IsWindows && 239if (NativeMethods.IsWindows &&
CommunicationsUtilities.cs (1)
218if (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)
566if (NativeMethods.IsWindows)
NativeMethods.cs (17)
441if (IsWindows) 486if (IsWindows) 612if (!IsWindows) 669if (IsWindows) 806get { return IsWindows ? "Windows_NT" : "Unix"; } 981if (IsWindows) 1021if (!IsWindows) 1098if (IsWindows) 1116if (IsWindows) 1176if (IsWindows) 1490if (IsWindows) 1576if (IsWindows) 1623if (IsWindows && originalConsoleMode is not null) 1706if (IsWindows) 1813return IsWindows 1828return IsWindows 1843return IsWindows
PathHelpers\AbsolutePath.cs (2)
164bool needsSeparatorNormalization = NativeMethods.IsWindows && Value.IndexOf(Path.AltDirectorySeparatorChar) >= 0; 170if (NativeMethods.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)
1003if (NativeMethodsShared.IsWindows) 1017NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1018NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1471string[] strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1472strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1475strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1476strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1477Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "directory\\1.file" : "directory/1.file"); 1479strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1480strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1483strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1484strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1485Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file"); 1487strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file" }; 1488strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1489Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file"); 1491if (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; 974string root = NativeMethodsShared.IsWindows ? @"c:\" : "/";
Microsoft.Build.Tasks.Core (27)
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)
CommunicationsUtilities.cs (1)
287if (includeSessionId && 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)
127if (!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)
189protected 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)
1407if (NativeMethodsShared.IsWindows)
Exec_Tests.cs (22)
147Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "xcopy thisisanonexistentfile" : "cp thisisanonexistentfile thatisanonexistentfile"); 151Assert.Equal(NativeMethodsShared.IsWindows ? 4 : 1, exec.ExitCode); 153if (!NativeMethodsShared.IsWindows) 163int expectedExitCode = NativeMethodsShared.IsWindows ? -1 : 137; 165Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 195Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 209exec.ExitCode.ShouldBe(NativeMethodsShared.IsWindows ? -1 : 137); 238var cmdLine = NativeMethodsShared.IsWindows 266var cmdLine = NativeMethodsShared.IsWindows 290Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 291string working = !NativeMethodsShared.IsWindows ? "/usr/lib" : 323Directory.SetCurrentDirectory(NativeMethodsShared.IsWindows ? 326Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 600if (!NativeMethodsShared.IsWindows) 661if (NativeMethodsShared.IsWindows) 684if (NativeMethodsShared.IsWindows) 715if (NativeMethodsShared.IsWindows) 747var cmdLine = NativeMethodsShared.IsWindows 763var cmdLine = NativeMethodsShared.IsWindows 813var cmdLine = NativeMethodsShared.IsWindows 909exec.Command = NativeMethodsShared.IsWindows ? "echo [%MYENVVAR%]" : "echo [$myenvvar]"; 1062Exec 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)
431NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap, 699NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap); 745if (!NativeMethodsShared.IsWindows) 955if (!NativeMethodsShared.IsWindows) 3108t.StronglyTypedFileName = NativeMethodsShared.IsWindows ? "||" : "\0"; 4365NativeMethodsShared.IsWindows 4455NativeMethodsShared.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)
2010NativeMethodsShared.IsWindows 2021NativeMethodsShared.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)
26var psi = NativeMethodsShared.IsWindows 37NativeMethodsShared.IsWindows ? 65if (NativeMethodsShared.IsWindows) 95if (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)
373NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll"); 385NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll", 1261string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1282string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1304string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1325string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1348string targetFrameworkRootPath = NativeMethodsShared.IsWindows 3069string tooLongPath = NativeMethodsShared.IsWindows 3104string normalDirectory = NativeMethodsShared.IsWindows ? "c:\\SDKPath" : "/SDKPath"; 3125string frameworkPathPattern = NativeMethodsShared.IsWindows ? @"Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MyFramework" : "Microsoft SDKs/Windows/v8.0/ExtensionSDKs/MyFramework"; 3126string 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 1060t.MockCommandLineCommands = NativeMethodsShared.IsWindows 1092t.MockCommandLineCommands = NativeMethodsShared.IsWindows ? 1447string toolName = NativeMethodsShared.IsWindows ? "mytesttool.exe" : "mytesttool"; 1550string toolName = NativeMethodsShared.IsWindows ? "mytool.exe" : "mytool";
MSBuild (3)
CommunicationsUtilities.cs (2)
287if (includeSessionId && NativeMethodsShared.IsWindows) 583if (!NativeMethodsShared.IsWindows)
XMake.cs (1)
1921if (NativeMethodsShared.IsWindows &&