388 references to IsWindows
Microsoft.Build (22)
BackEnd\BuildManager\BuildManager.cs (1)
506
if (NativeMethodsShared.
IsWindows
|| parameters.LowPriority)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
884
if (!NativeMethodsShared.
IsWindows
|| BuildEnvironmentHelper.Instance.RunningInVisualStudio)
BackEnd\Components\Communications\NodeLauncher.cs (1)
65
return NativeMethodsShared.
IsWindows
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
56
if (NativeMethodsShared.
IsWindows
)
BackEnd\Node\OutOfProcNode.cs (1)
884
if (!lowPriority || NativeMethodsShared.
IsWindows
)
BackEnd\Node\OutOfProcServerNode.cs (1)
409
if (NativeMethodsShared.
IsWindows
&& command.ConsoleConfiguration.BufferWidth > 0)
CommunicationsUtilities.cs (2)
287
if (includeSessionId && NativeMethodsShared.
IsWindows
)
583
if (!NativeMethodsShared.
IsWindows
)
Evaluation\Evaluator.cs (1)
1159
if (!NativeMethodsShared.
IsWindows
)
Evaluation\Expander.cs (2)
1746
if (!NativeMethodsShared.
IsWindows
)
1786
if (!NativeMethodsShared.
IsWindows
&& !registryKeyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Evaluation\IntrinsicFunctions.cs (5)
206
if (!NativeMethodsShared.
IsWindows
)
222
if (!NativeMethodsShared.
IsWindows
)
235
if (!NativeMethodsShared.
IsWindows
)
257
if (!NativeMethodsShared.
IsWindows
)
288
if (!NativeMethodsShared.
IsWindows
&& !keyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Instance\HostServices.cs (1)
89
if (NativeMethodsShared.
IsWindows
)
Instance\RunningObjectTable.cs (2)
27
if (!NativeMethodsShared.
IsWindows
)
95
if (NativeMethodsShared.
IsWindows
&& Ole32.GetErrorInfo(0, out IErrorInfo errorInfo) == 0 && errorInfo != null)
Logging\BaseConsoleLogger.cs (1)
265
runningWithCharacterFileType = NativeMethodsShared.
IsWindows
&& ConsoleConfiguration.OutputIsScreen;
Logging\InProcessConsoleConfiguration.cs (2)
27
if (NativeMethodsShared.
IsWindows
&& !Console.IsOutputRedirected)
78
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.BuildCheck.UnitTests (8)
DoubleWritesAnalyzer_Tests.cs (1)
28
string projectFile = Framework.NativeMethods.
IsWindows
? @"C:\fake\project.proj" : "/fake/project.proj";
ExecCliBuildCheck_Tests.cs (1)
94
string projectFile = Framework.NativeMethods.
IsWindows
? @"C:\fake\project.proj" : "/fake/project.proj";
SharedOutputPathCheck_Tests.cs (6)
41
string projectFile1 = Framework.NativeMethods.
IsWindows
? "C:\\fake1\\project1.proj" : "/fake1/project1.proj";
51
string projectFile2 = Framework.NativeMethods.
IsWindows
? "C:\\fake2\\project2.proj" : "/fake2/project2.proj";
68
string projectFile1 = Framework.NativeMethods.
IsWindows
? "C:\\fake\\project1.proj" : "/fake/project1.proj";
69
string projectFile2 = Framework.NativeMethods.
IsWindows
? "C:\\fake\\project2.proj" : "/fake/project2.proj";
93
string wrongPathSeparator = Framework.NativeMethods.
IsWindows
? "/" : "\\";
108
string projectFolder = Framework.NativeMethods.
IsWindows
? "C:\\fake\\" : "/fake/";
Microsoft.Build.CommandLine.UnitTests (10)
XMake_Tests.cs (10)
1246
NativeMethodsShared.
IsWindows
? @"c:\bin\msbuild.exe" : "/msbuild.exe",
1273
private readonly string _pathToArbitraryBogusFile = NativeMethodsShared.
IsWindows
// OK on 64 bit as well
1283
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1289
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
1298
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1304
if (NativeMethodsShared.
IsWindows
)
1312
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
1328
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1338
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
2261
fileLoggerParameters = 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)
735
return usesNewParser && !NativeMethodsShared.
IsWindows
? path.Replace('\\', '/') : path;
Construction\WhiteSpacePreservation_Tests.cs (1)
450
if (NativeMethodsShared.
IsWindows
)
Definition\DefinitionEditing_Tests.cs (9)
329
NativeMethodsShared.
IsWindows
522
NativeMethodsShared.
IsWindows
? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x");
528
NativeMethodsShared.
IsWindows
? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[
532
NativeMethodsShared.
IsWindows
?
1522
xml.AddImport(NativeMethodsShared.
IsWindows
?
2252
NativeMethodsShared.
IsWindows
? @"c:\" + Guid.NewGuid().ToString() + @"\**\i1" : "/" + Guid.NewGuid().ToString() + "/**/i1");
2442
NativeMethodsShared.
IsWindows
? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x");
2446
NativeMethodsShared.
IsWindows
? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[0].Xml;
2449
NativeMethodsShared.
IsWindows
?
Definition\Project_Tests.cs (2)
44
private readonly int RootPrefixLength = NativeMethodsShared.
IsWindows
? 3 : 1;
683
if (NativeMethodsShared.
IsWindows
)
Definition\ProjectCollection_Tests.cs (1)
410
string projectDirectory = NativeMethodsShared.
IsWindows
? "c:\\1" : "/l";
Definition\ProjectItem_Tests.cs (12)
284
NativeMethodsShared.
IsWindows
? @"<i Include='c:\foo\bar.baz'/>" : @"<i Include='/foo/bar.baz'/>");
298
NativeMethodsShared.
IsWindows
? @"c:\foo\bar.baz" : "/foo/bar.baz",
300
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\" : "/", item.GetMetadataValue("RootDir"));
303
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\foo\" : "/foo/", item.GetMetadataValue("RelativeDir"));
304
Assert.Equal(NativeMethodsShared.
IsWindows
? @"foo\" : "foo/", item.GetMetadataValue("Directory"));
307
NativeMethodsShared.
IsWindows
? @"c:\foo\bar.baz" : "/foo/bar.baz",
369
"<i Include='" + directory + (NativeMethodsShared.
IsWindows
? @"\**\*'/>" : "/**/*'/>"));
371
Assert.Equal(NativeMethodsShared.
IsWindows
? @"b\" : "b/", item.GetMetadataValue("RecursiveDir"));
414
IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='i0;" + directory + (NativeMethodsShared.
IsWindows
? @"\**\*;i2'/>" : "/**/*;i2'/>"));
418
Assert.Equal(NativeMethodsShared.
IsWindows
? @"b\" : "b/", items[1].GetMetadataValue("RecursiveDir"));
751
if (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)
154
string varName = NativeMethodsShared.
IsWindows
? "username" : "USER";
177
string varName = NativeMethodsShared.
IsWindows
? "username" : "USER";
Instance\ProjectInstance_Tests.cs (3)
894
instance.GetProperty(NativeMethodsShared.
IsWindows
? "username" : "USER").EvaluatedValue =
919
instance.GetProperty(NativeMethodsShared.
IsWindows
? "username" : "USER").EvaluatedValue =
941
instance.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)
28
private readonly string _dotnetHostPath = NativeMethodsShared.
IsWindows
BackEnd\BuildRequestConfiguration_Tests.cs (1)
541
if (!NativeMethodsShared.
IsWindows
)
Construction\SolutionFile_NewParser_Tests.cs (1)
157
return !NativeMethodsShared.
IsWindows
? path.Replace('\\', '/') : path;
Construction\SolutionFile_OldParser_Tests.cs (7)
37
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
59
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
76
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
95
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
151
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
612
string expectedPath3 = NativeMethodsShared.
IsWindows
? @"ETPProjUpgradeTest\someproj3.etp" : "ETPProjUpgradeTest/someproj3.etp";
716
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
Definition\Toolset_Tests.cs (1)
54
if (NativeMethodsShared.
IsWindows
)
Definition\ToolsetConfigurationReader_Tests.cs (1)
566
if (NativeMethodsShared.
IsWindows
)
Definition\ToolsVersion_Tests.cs (18)
33
string dir = NativeMethodsShared.
IsWindows
? "c:\\directory1\\directory2" : "/directory1/directory2";
34
string overrideDir = NativeMethodsShared.
IsWindows
? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks";
159
NativeMethodsShared.
IsWindows
? "c:\\directory1\\directory2" : "/directory1/directory2",
240
string dir = NativeMethodsShared.
IsWindows
? "c:\\directory1\\directory2" : "/directory1/directory2";
241
string overrideDir = NativeMethodsShared.
IsWindows
? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks";
926
NativeMethodsShared.
IsWindows
? "c:\\inline" : "/inline",
993
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1002
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1008
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1014
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1020
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1026
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1032
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1040
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1048
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1054
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1067
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1076
new DefaultTasksFile(NativeMethodsShared.
IsWindows
Evaluation\Evaluator_Tests.cs (12)
174
string fooPath = NativeMethodsShared.
IsWindows
? @"c:\temp\foo.import" : "/temp/foo.import";
175
string barPath = NativeMethodsShared.
IsWindows
? @"c:\temp\bar.import" : "/temp/bar.import";
1363
string targets1FileName = NativeMethodsShared.
IsWindows
? @"c:\a\t1.targets" : "/a/t1.targets";
1364
string aDirName = NativeMethodsShared.
IsWindows
? @"c:\a\" : "/a/";
1365
string targets2FileName = NativeMethodsShared.
IsWindows
? @"c:\a\b\t2.targets" : "/a/b/t2.targets";
1366
string bDirName = NativeMethodsShared.
IsWindows
? @"c:\a\b\" : "/a/b/";
1367
string targets3FileName = NativeMethodsShared.
IsWindows
? @"c:\t3.targets" : "/t3.targets";
1368
string rootDirName = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
1369
string aProjName = NativeMethodsShared.
IsWindows
? @"c:\a\p.proj" : "/a/p.proj";
2799
string file = NativeMethodsShared.
IsWindows
? @"c:\foo\bar.csproj" : "/foo/bar.csproj";
2818
string file = NativeMethodsShared.
IsWindows
? @"c:\bar.csproj" : "/bar.csproj";
2819
string dir = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
Evaluation\Expander_Tests.cs (10)
44
private static readonly string s_rootPathPrefix = NativeMethodsShared.
IsWindows
? "C:\\" : Path.VolumeSeparatorChar.ToString();
1416
NativeMethodsShared.
IsWindows
? @"subdir1\engine.dll" : "subdir1/engine.dll", project.FullPath);
1420
NativeMethodsShared.
IsWindows
? @"subdir2\tasks.dll" : "subdir2/tasks.dll", project.FullPath);
1906
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3880
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3904
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3928
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3952
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
4351
if (NativeMethodsShared.
IsWindows
)
4356
if (!NativeMethodsShared.
IsWindows
)
Evaluation\ItemEvaluation_Tests.cs (1)
607
if (!NativeMethodsShared.
IsWindows
)
Evaluation\ItemSpec_Tests.cs (1)
44
var absoluteRootPath = NativeMethodsShared.
IsWindows
Globbing\MSBuildGlob_Tests.cs (5)
40
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
116
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
137
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
157
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
360
return NativeMethodsShared.
IsWindows
? normalizedPath.Replace("\\\\", "\\") : normalizedPath;
Microsoft.Build.Framework (55)
BuildEnvironmentHelper.cs (3)
133
if (!NativeMethods.
IsWindows
)
165
if (NativeMethods.
IsWindows
&&
239
if (NativeMethods.
IsWindows
&&
CommunicationsUtilities.cs (1)
218
if (NativeMethods.
IsWindows
)
Constants.cs (2)
31
internal static readonly string DotnetProcessName = NativeMethods.
IsWindows
? "dotnet.exe" : "dotnet";
46
internal static readonly string MSBuildExecutableName = NativeMethods.
IsWindows
? $"{MSBuildAppName}.exe" : MSBuildAppName;
EncodingUtilities.cs (2)
58
if (NativeMethods.
IsWindows
)
224
if (!NativeMethods.
IsWindows
)
FileSystem\FileSystems.cs (1)
17
if (NativeMethods.
IsWindows
)
FileSystem\ManagedFileSystem.cs (1)
28
return NativeMethods.
IsWindows
;
FileUtilities.cs (7)
246
=> NativeMethods.
IsWindows
&& path.IndexOf(UnixDirectorySeparator) >= 0;
686
if (NativeMethods.
IsWindows
)
711
if (!NativeMethods.
IsWindows
|| !path.StartsWith(@"\\", StringComparison.Ordinal))
772
if (NativeMethods.
IsWindows
|| string.IsNullOrEmpty(value)
793
if (NativeMethods.
IsWindows
|| value.IsEmpty)
874
if (NativeMethods.
IsWindows
)
1002
if (NativeMethods.
IsWindows
&& !EndsWithSlash(fullPath))
ItemSpecModifiers.cs (1)
566
if (NativeMethods.
IsWindows
)
NativeMethods.cs (17)
441
if (
IsWindows
)
486
if (
IsWindows
)
612
if (!
IsWindows
)
669
if (
IsWindows
)
806
get { return
IsWindows
? "Windows_NT" : "Unix"; }
981
if (
IsWindows
)
1021
if (!
IsWindows
)
1098
if (
IsWindows
)
1116
if (
IsWindows
)
1176
if (
IsWindows
)
1490
if (
IsWindows
)
1576
if (
IsWindows
)
1623
if (
IsWindows
&& originalConsoleMode is not null)
1706
if (
IsWindows
)
1813
return
IsWindows
1828
return
IsWindows
1843
return
IsWindows
PathHelpers\AbsolutePath.cs (2)
164
bool needsSeparatorNormalization = NativeMethods.
IsWindows
&& Value.IndexOf(Path.AltDirectorySeparatorChar) >= 0;
170
if (NativeMethods.
IsWindows
)
Utilities\FileMatcher.cs (2)
1257
bool isUncPath = NativeMethods.
IsWindows
&& fixedDir.Length > 1
2273
if (NativeMethods.
IsWindows
&&
Utilities\FrameworkLocationHelper.cs (15)
93
internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethods.
IsWindows
? "v1.1" : "1.1"; // v1.1 is for Everett.
98
internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethods.
IsWindows
? "v2.0" : "2.0"; // v2.0 is for Whidbey.
102
internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethods.
IsWindows
? "v3.0" : "3.0"; // v3.0 is for WinFx.
116
internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethods.
IsWindows
? "v3.5" : "3.5"; // v3.5 is for Orcas.
122
internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethods.
IsWindows
? "v4.0" : "4.0";
123
internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethods.
IsWindows
? "v4.5" : "4.5";
538
if (!NativeMethods.
IsWindows
)
588
if (NativeMethods.
IsWindows
)
635
if (NativeMethods.
IsWindows
)
796
if (NativeMethods.
IsWindows
)
829
if (!NativeMethods.
IsWindows
)
986
combinedPath = NativeMethods.
IsWindows
1196
dotNetFrameworkVersionFolderPrefix: NativeMethods.
IsWindows
? "v4.0" : "v4.5",
1430
if (NativeMethods.
IsWindows
&& !CheckForFrameworkInstallation(
1572
if (NativeMethods.
IsWindows
)
Utilities\ProcessExtensions.cs (1)
25
if (NativeMethods.
IsWindows
)
Microsoft.Build.Framework.UnitTests (33)
FileClassifier_Tests.cs (3)
31
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
45
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
63
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
FileMatcher_Tests.cs (17)
1003
if (NativeMethodsShared.
IsWindows
)
1017
NativeMethodsShared.
IsWindows
? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt",
1018
NativeMethodsShared.
IsWindows
? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt",
1471
string[] strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file" };
1472
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\" : "/").ToArray();
1475
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directory\\1.file" : "/directory/1.file" };
1476
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\" : "/").ToArray();
1477
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "directory\\1.file" : "directory/1.file");
1479
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directory\\1.file" : "/directory/1.file" };
1480
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1483
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file" };
1484
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1485
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file");
1487
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file" };
1488
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1489
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file");
1491
if (NativeMethodsShared.
IsWindows
)
FileUtilities_Tests.cs (13)
52
string itemSpec = NativeMethodsShared.
IsWindows
? @"c:\foo.txt" : "/foo.txt";
53
string itemSpecDir = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
73
string projectPath = NativeMethodsShared.
IsWindows
? @"c:\abc\goo.proj" : @"/abc/goo.proj";
74
string projectPathDir = NativeMethodsShared.
IsWindows
? @"c:\abc\" : @"/abc/";
91
if (NativeMethodsShared.
IsWindows
)
246
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.
IsWindows
? @"c:\" : "/"));
247
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.
IsWindows
? @"c:\foo" : "/foo"));
248
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:" : "/", FileUtilities.GetDirectory(NativeMethodsShared.
IsWindows
? @"c:" : "/"));
531
var isWindows = NativeMethodsShared.
IsWindows
;
974
string root = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
Microsoft.Build.Tasks.Core (27)
AssemblyDependency\AssemblyInformation.cs (1)
245
if (!NativeMethodsShared.
IsWindows
)
AssemblyDependency\AssemblyMetadata.cs (1)
30
ScatterFiles = NativeMethodsShared.
IsWindows
? import.Files : null;
AssemblyDependency\Reference.cs (1)
514
else if (NativeMethodsShared.
IsWindows
)
AssemblyFoldersEx.cs (1)
80
if (!NativeMethodsShared.
IsWindows
)
CommunicationsUtilities.cs (1)
287
if (includeSessionId && NativeMethodsShared.
IsWindows
)
Copy.cs (1)
357
if (!NativeMethodsShared.
IsWindows
)
Exec.cs (3)
501
if (NativeMethodsShared.
IsWindows
)
593
if (NativeMethodsShared.
IsWindows
)
654
protected override string ToolName => NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
FileState.cs (3)
91
if (NativeMethodsShared.
IsWindows
)
104
if (NativeMethodsShared.
IsWindows
)
178
if (NativeMethodsShared.
IsWindows
)
GenerateApplicationManifest.cs (1)
115
if (!NativeMethodsShared.
IsWindows
)
GenerateDeploymentManifest.cs (1)
157
if (!NativeMethodsShared.
IsWindows
)
GenerateLauncher.cs (1)
45
if (!NativeMethodsShared.
IsWindows
)
GenerateManifestBase.cs (1)
275
if (!NativeMethodsShared.
IsWindows
)
GetInstalledSDKLocations.cs (1)
127
if (!NativeMethodsShared.
IsWindows
)
GetSDKReferenceFiles.cs (1)
230
if (!NativeMethodsShared.
IsWindows
)
ManifestUtil\SecurityUtil.cs (1)
869
if (NativeMethodsShared.
IsWindows
&& (toolPath == null || !FileSystems.Default.FileExists(toolPath)))
NativeMethods.cs (5)
808
if (NativeMethodsShared.
IsWindows
)
841
if (NativeMethodsShared.
IsWindows
)
992
if (NativeMethodsShared.
IsWindows
)
1292
if (NativeMethodsShared.
IsWindows
)
1352
if (NativeMethodsShared.
IsWindows
)
NodePipeClient.cs (1)
18
private static readonly bool s_useHandhakeTimeout = !NativeMethodsShared.
IsWindows
;
ResolveSDKReference.cs (1)
272
if (!NativeMethodsShared.
IsWindows
)
SignFile.cs (1)
47
if (!NativeMethodsShared.
IsWindows
)
Microsoft.Build.Tasks.UnitTests (69)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (1)
189
protected 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") };
25
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\bin" : "/bin";
29
t.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") };
41
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
57
NativeMethodsShared.
IsWindows
? @"d:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt")
63
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1" : "/x1";
79
NativeMethodsShared.
IsWindows
? @"c:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt")
81
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
85
t.AssignedFiles[0].GetMetadata("TargetPath").ShouldBe(NativeMethodsShared.
IsWindows
? @"f3\f4\file.txt" : "f3/f4/file.txt");
105
itemSpec: NativeMethodsShared.
IsWindows
? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt",
108
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
71
projectDirectoryPath = NativeMethodsShared.
IsWindows
? projectDirectoryPath.Replace(":\\", "\\") : projectDirectoryPath.Replace("/", "\\");
123
projectDirectory = NativeMethodsShared.
IsWindows
? projectDirectory.Replace(":\\", "\\") : projectDirectory.Replace("/", "\\");
CombinePath_Tests.cs (11)
47
string path1 = NativeMethodsShared.
IsWindows
? @"c:\ghi.txt" : "/ghi.txt";
48
string path2 = NativeMethodsShared.
IsWindows
? @"d:\jkl\mno.txt" : "/jkl/mno.txt";
50
string pathsToMatch = string.Format(NativeMethodsShared.
IsWindows
? @"
59
t.Paths = NativeMethodsShared.
IsWindows
76
t.BasePath = NativeMethodsShared.
IsWindows
? @"c:\abc\def" : "/abc/def";
96
t.BasePath = NativeMethodsShared.
IsWindows
? @"\\fileserver\public" : "/rootdir/public";
97
string path1 = NativeMethodsShared.
IsWindows
? @"c:\ghi.txt" : "/ghi.txt";
98
string path2 = NativeMethodsShared.
IsWindows
? @"d:\jkl\mno.txt" : "/jkl/mno.txt";
100
string pathsToMatch = string.Format(NativeMethodsShared.
IsWindows
? @"
108
t.Paths = NativeMethodsShared.
IsWindows
126
if (NativeMethodsShared.
IsWindows
)
Copy_Tests.cs (1)
1407
if (NativeMethodsShared.
IsWindows
)
Exec_Tests.cs (22)
147
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "xcopy thisisanonexistentfile" : "cp thisisanonexistentfile thatisanonexistentfile");
151
Assert.Equal(NativeMethodsShared.
IsWindows
? 4 : 1, exec.ExitCode);
153
if (!NativeMethodsShared.
IsWindows
)
163
int expectedExitCode = NativeMethodsShared.
IsWindows
? -1 : 137;
165
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? ":foo \n goto foo" : "while true; do sleep 1; done");
195
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? ":foo \n goto foo" : "while true; do sleep 1; done");
209
exec.ExitCode.ShouldBe(NativeMethodsShared.
IsWindows
? -1 : 137);
238
var cmdLine = NativeMethodsShared.
IsWindows
266
var cmdLine = NativeMethodsShared.
IsWindows
290
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "echo [%cd%]" : "echo [$PWD]");
291
string working = !NativeMethodsShared.
IsWindows
? "/usr/lib" :
323
Directory.SetCurrentDirectory(NativeMethodsShared.
IsWindows
?
326
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "echo [%cd%]" : "echo [$PWD]");
600
if (!NativeMethodsShared.
IsWindows
)
661
if (NativeMethodsShared.
IsWindows
)
684
if (NativeMethodsShared.
IsWindows
)
715
if (NativeMethodsShared.
IsWindows
)
747
var cmdLine = NativeMethodsShared.
IsWindows
763
var cmdLine = NativeMethodsShared.
IsWindows
813
var cmdLine = NativeMethodsShared.
IsWindows
909
exec.Command = NativeMethodsShared.
IsWindows
? "echo [%MYENVVAR%]" : "echo [$myenvvar]";
1062
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? $"type {textFilePath}" : $"cat {textFilePath}");
FindUnderPath_Tests.cs (3)
106
new TaskItem(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt") };
140
Assert.Equal(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
163
Assert.Equal(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
MakeDir_Tests.cs (2)
92
if (NativeMethodsShared.
IsWindows
)
116
if (!NativeMethodsShared.
IsWindows
)
ResolveSDKReference_Tests.cs (2)
25
private readonly string _sdkPath = NativeMethodsShared.
IsWindows
1519
string goodSDKLocation = NativeMethodsShared.
IsWindows
? "C:\\GoodSDKLocation\\" : "/GoodSDKLocation/";
ResourceHandling\GenerateResource_Tests.cs (7)
431
NativeMethodsShared.
IsWindows
? bitmap.ToUpper() : bitmap,
699
NativeMethodsShared.
IsWindows
? bitmap.ToUpper() : bitmap);
745
if (!NativeMethodsShared.
IsWindows
)
955
if (!NativeMethodsShared.
IsWindows
)
3108
t.StronglyTypedFileName = NativeMethodsShared.
IsWindows
? "||" : "\0";
4365
NativeMethodsShared.
IsWindows
4455
NativeMethodsShared.
IsWindows
? smallestBitmapFile.ToUpperInvariant() : smallestBitmapFile,
Touch_Tests.cs (4)
26
internal static string myexisting_txt = NativeMethodsShared.
IsWindows
? @"c:\touch\myexisting.txt" : @"/touch/myexisting.txt";
27
internal static string mynonexisting_txt = NativeMethodsShared.
IsWindows
? @"c:\touch\mynonexisting.txt" : @"/touch/mynonexisting.txt";
28
internal static string nonexisting_txt = NativeMethodsShared.
IsWindows
? @"c:\touch-nonexistent\file.txt" : @"/touch-nonexistent/file.txt";
29
internal static string myreadonly_txt = NativeMethodsShared.
IsWindows
? @"c:\touch\myreadonly.txt" : @"/touch/myreadonly.txt";
Unzip_Tests.cs (1)
161
if (NativeMethodsShared.
IsWindows
)
WriteCodeFragment_Tests.cs (1)
610
public static string EscapedLineSeparator => NativeMethodsShared.
IsWindows
? "\\r\\n" : "\\n";
Microsoft.Build.UnitTests.Shared (7)
DummyMappedDrive.cs (2)
24
if (!NativeMethodsShared.
IsWindows
)
60
if (_mapped && NativeMethodsShared.
IsWindows
)
DummyMappedDriveUtils.cs (1)
25
return NativeMethods.
IsWindows
? new DummyMappedDrive() : default;
ObjectModelHelpers.cs (2)
2010
NativeMethodsShared.
IsWindows
2021
NativeMethodsShared.
IsWindows
RequiresSymbolicLinksFactAttribute.cs (1)
22
if (s_runningInAzurePipeline || !NativeMethodsShared.
IsWindows
)
RunnerUtilities.cs (1)
100
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.Utilities.Core (10)
AssemblyFoldersEx.cs (1)
80
if (!NativeMethodsShared.
IsWindows
)
LockCheck.cs (1)
259
if (NativeMethodsShared.
IsWindows
)
ToolLocationHelper.cs (4)
1826
if (NativeMethodsShared.
IsWindows
&& platformTarget != null)
2444
string registryRoot = NativeMethodsShared.
IsWindows
? GetTargetPlatformMonikerRegistryRoots(registrySearchLocation) : string.Empty;
2469
if (NativeMethodsShared.
IsWindows
)
2895
if (NativeMethodsShared.
IsWindows
)
ToolTask.cs (4)
673
if (NativeMethodsShared.
IsWindows
)
808
if (NativeMethodsShared.
IsWindows
)
1507
bool runningOnWindows = NativeMethodsShared.
IsWindows
;
1740
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.Utilities.UnitTests (49)
ProcessExtensions_Tests.cs (4)
26
var psi = NativeMethodsShared.
IsWindows
37
NativeMethodsShared.
IsWindows
?
65
if (NativeMethodsShared.
IsWindows
)
95
if (NativeMethodsShared.
IsWindows
)
TaskItem_Tests.cs (2)
226
from.ItemSpec = NativeMethodsShared.
IsWindows
? @"c:\subdir\Monkey.txt" : "/subdir/Monkey.txt";
227
from.GetMetadata(ItemSpecModifiers.Directory).ShouldBe(NativeMethodsShared.
IsWindows
? @"subdir\" : "subdir/");
ToolLocationHelper_Tests.cs (11)
373
NativeMethodsShared.
IsWindows
? "f:\\IDontExistAtAll" : "/IDontExistAtAll");
385
NativeMethodsShared.
IsWindows
? "f:\\IDontExistAtAll" : "/IDontExistAtAll",
1261
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1282
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1304
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1325
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1348
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
3069
string tooLongPath = NativeMethodsShared.
IsWindows
3104
string normalDirectory = NativeMethodsShared.
IsWindows
? "c:\\SDKPath" : "/SDKPath";
3125
string frameworkPathPattern = NativeMethodsShared.
IsWindows
? @"Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MyFramework" : "Microsoft SDKs/Windows/v8.0/ExtensionSDKs/MyFramework";
3126
string frameworkPathPattern2 = NativeMethodsShared.
IsWindows
? @"ExtensionSDKs\MyFramework" : "ExtensionSDKs/MyFramework";
ToolTask_Tests.cs (32)
114
if (!NativeMethodsShared.
IsWindows
&& string.IsNullOrEmpty(responseFileCommands) && string.IsNullOrEmpty(commandLineCommands))
121
StartInfo = GetProcessStartInfo(GenerateFullPathToTool(), NativeMethodsShared.
IsWindows
? "/x" : string.Empty, null);
133
t.ToolPath = NativeMethodsShared.
IsWindows
? @"C:\MyAlternatePath" : "/MyAlternatePath";
149
t.ToolPath = NativeMethodsShared.
IsWindows
? @"C:\MyAlternatePath" : "/MyAlternatePath";
169
t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.
IsWindows
? "attrib.exe" : "ps");
191
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
? "/C garbagegarbagegarbagegarbage.exe" : "-c garbagegarbagegarbagegarbage.exe";
194
t.ExitCode.ShouldBe(NativeMethodsShared.
IsWindows
? 1 : 127); // cmd.exe error code is 1, sh error code is 127
216
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
243
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
275
string singleQuote = NativeMethodsShared.
IsWindows
? "'" : string.Empty;
292
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
316
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
343
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
373
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
402
t.FullToolName = NativeMethodsShared.
IsWindows
? "c:\\baz\\foo.exe" : "/baz/foo.exe";
417
string shellName = NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
418
string copyName = NativeMethodsShared.
IsWindows
? "xcopy.exe" : "cp";
470
string toolName = NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
498
t.FullToolName = NativeMethodsShared.
IsWindows
? "findstr.exe" : "grep";
526
t.FullToolName = NativeMethodsShared.
IsWindows
? "findstr.exe" : "grep";
548
string toolName = NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
587
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
614
string userVarName = NativeMethodsShared.
IsWindows
? "username" : "user";
628
if (NativeMethodsShared.
IsWindows
)
720
string toolName = NativeMethodsShared.
IsWindows
? "cmd" : "sh";
762
if (NativeMethodsShared.
IsWindows
)
801
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
834
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
1060
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
1092
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
?
1447
string toolName = NativeMethodsShared.
IsWindows
? "mytesttool.exe" : "mytesttool";
1550
string toolName = NativeMethodsShared.
IsWindows
? "mytool.exe" : "mytool";
MSBuild (3)
CommunicationsUtilities.cs (2)
287
if (includeSessionId && NativeMethodsShared.
IsWindows
)
583
if (!NativeMethodsShared.
IsWindows
)
XMake.cs (1)
1921
if (NativeMethodsShared.
IsWindows
&&