432 references to IsWindows
Microsoft.Build (47)
BackEnd\BuildManager\BuildManager.cs (1)
471
if (NativeMethodsShared.
IsWindows
|| parameters.LowPriority)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
840
if (!NativeMethodsShared.
IsWindows
|| BuildEnvironmentHelper.Instance.RunningInVisualStudio)
BackEnd\Components\Communications\CurrentHost.cs (1)
31
NativeMethodsShared.
IsWindows
? "dotnet.exe" : "dotnet");
BackEnd\Components\Communications\NodeLauncher.cs (1)
101
if (!NativeMethodsShared.
IsWindows
)
BackEnd\Node\OutOfProcNode.cs (1)
857
if (!lowPriority || NativeMethodsShared.
IsWindows
)
BackEnd\Node\OutOfProcServerNode.cs (1)
391
if (NativeMethodsShared.
IsWindows
&& command.ConsoleConfiguration.BufferWidth > 0)
BuildEnvironmentHelper.cs (3)
139
if (!NativeMethodsShared.
IsWindows
)
171
if (NativeMethodsShared.
IsWindows
&&
244
if (NativeMethodsShared.
IsWindows
&&
CommunicationsUtilities.cs (1)
517
if (!NativeMethodsShared.
IsWindows
)
Evaluation\Evaluator.cs (1)
1144
if (!NativeMethodsShared.
IsWindows
)
Evaluation\Expander.cs (2)
1649
if (!NativeMethodsShared.
IsWindows
|| !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
1689
if (!NativeMethodsShared.
IsWindows
&& !registryKeyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Evaluation\IntrinsicFunctions.cs (5)
196
if (!NativeMethodsShared.
IsWindows
|| !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
213
if (!NativeMethodsShared.
IsWindows
|| !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
227
if (!NativeMethodsShared.
IsWindows
|| !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
250
if (!NativeMethodsShared.
IsWindows
|| !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
281
if (!NativeMethodsShared.
IsWindows
&& !keyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
FileMatcher.cs (2)
1259
bool isUncPath = NativeMethodsShared.
IsWindows
&& fixedDir.Length > 1
2255
if (NativeMethodsShared.
IsWindows
&&
FileSystems.cs (1)
20
if (NativeMethodsShared.
IsWindows
)
FileUtilities.cs (4)
564
if (NativeMethodsShared.
IsWindows
|| string.IsNullOrEmpty(value)
585
if (NativeMethodsShared.
IsWindows
|| value.IsEmpty)
670
if (NativeMethodsShared.
IsWindows
)
764
if (NativeMethodsShared.
IsWindows
&& !EndsWithSlash(fullPath))
FrameworkLocationHelper.cs (14)
90
internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethodsShared.
IsWindows
? "v1.1" : "1.1"; // v1.1 is for Everett.
95
internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethodsShared.
IsWindows
? "v2.0" : "2.0"; // v2.0 is for Whidbey.
99
internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethodsShared.
IsWindows
? "v3.0" : "3.0"; // v3.0 is for WinFx.
113
internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethodsShared.
IsWindows
? "v3.5" : "3.5"; // v3.5 is for Orcas.
119
internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethodsShared.
IsWindows
? "v4.0" : "4.0";
120
internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethodsShared.
IsWindows
? "v4.5" : "4.5";
503
if (!NativeMethodsShared.
IsWindows
)
553
if (NativeMethodsShared.
IsWindows
)
600
if (NativeMethodsShared.
IsWindows
)
774
if (!NativeMethodsShared.
IsWindows
)
928
combinedPath = NativeMethodsShared.
IsWindows
1142
dotNetFrameworkVersionFolderPrefix: NativeMethodsShared.
IsWindows
? "v4.0" : "v4.5",
1395
(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.
IsWindows
? "MSBuild.exe" : "mcs.exe")) &&
1514
if (NativeMethodsShared.
IsWindows
)
Instance\HostServices.cs (1)
90
if (NativeMethodsShared.
IsWindows
)
Instance\RunningObjectTable.cs (1)
26
if (!NativeMethodsShared.
IsWindows
)
Logging\BaseConsoleLogger.cs (1)
265
runningWithCharacterFileType = NativeMethodsShared.
IsWindows
&& ConsoleConfiguration.OutputIsScreen;
Logging\InProcessConsoleConfiguration.cs (2)
27
if (NativeMethodsShared.
IsWindows
&& !Console.IsOutputRedirected)
78
if (NativeMethodsShared.
IsWindows
)
ManagedFileSystem.cs (1)
26
return NativeMethodsShared.
IsWindows
;
Modifiers.cs (1)
464
if (NativeMethodsShared.
IsWindows
)
TempFileUtilities.cs (1)
42
string msbuildTempFolder = NativeMethodsShared.
IsWindows
?
Microsoft.Build.CommandLine.UnitTests (10)
XMake_Tests.cs (10)
1165
NativeMethodsShared.
IsWindows
? @"c:\bin\msbuild.exe" : "/msbuild.exe",
1192
private readonly string _pathToArbitraryBogusFile = NativeMethodsShared.
IsWindows
// OK on 64 bit as well
1202
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1208
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
1217
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1223
if (NativeMethodsShared.
IsWindows
)
1231
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
1247
var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.
IsWindows
? " /v:diag" : " -v:diag");
1257
output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.
IsWindows
? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive);
2120
fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + (NativeMethodsShared.
IsWindows
? "c:\\temp\\cat.log" : "/tmp/cat.log") };
Microsoft.Build.Engine.OM.UnitTests (44)
BuildEnvironmentHelper.cs (3)
139
if (!NativeMethodsShared.
IsWindows
)
171
if (NativeMethodsShared.
IsWindows
&&
244
if (NativeMethodsShared.
IsWindows
&&
Construction\WhiteSpacePreservation_Tests.cs (1)
449
if (NativeMethodsShared.
IsWindows
)
Definition\DefinitionEditing_Tests.cs (9)
331
NativeMethodsShared.
IsWindows
524
NativeMethodsShared.
IsWindows
? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x");
530
NativeMethodsShared.
IsWindows
? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[
534
NativeMethodsShared.
IsWindows
?
1520
xml.AddImport(NativeMethodsShared.
IsWindows
?
2249
NativeMethodsShared.
IsWindows
? @"c:\" + Guid.NewGuid().ToString() + @"\**\i1" : "/" + Guid.NewGuid().ToString() + "/**/i1");
2439
NativeMethodsShared.
IsWindows
? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x");
2443
NativeMethodsShared.
IsWindows
? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[0].Xml;
2446
NativeMethodsShared.
IsWindows
?
Definition\Project_Tests.cs (2)
44
private readonly int RootPrefixLength = NativeMethodsShared.
IsWindows
? 3 : 1;
676
if (NativeMethodsShared.
IsWindows
)
Definition\ProjectCollection_Tests.cs (1)
409
string projectDirectory = NativeMethodsShared.
IsWindows
? "c:\\1" : "/l";
Definition\ProjectItem_Tests.cs (12)
285
NativeMethodsShared.
IsWindows
? @"<i Include='c:\foo\bar.baz'/>" : @"<i Include='/foo/bar.baz'/>");
299
NativeMethodsShared.
IsWindows
? @"c:\foo\bar.baz" : "/foo/bar.baz",
301
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\" : "/", item.GetMetadataValue("RootDir"));
304
Assert.Equal(NativeMethodsShared.
IsWindows
? @"c:\foo\" : "/foo/", item.GetMetadataValue("RelativeDir"));
305
Assert.Equal(NativeMethodsShared.
IsWindows
? @"foo\" : "foo/", item.GetMetadataValue("Directory"));
308
NativeMethodsShared.
IsWindows
? @"c:\foo\bar.baz" : "/foo/bar.baz",
370
"<i Include='" + directory + (NativeMethodsShared.
IsWindows
? @"\**\*'/>" : "/**/*'/>"));
372
Assert.Equal(NativeMethodsShared.
IsWindows
? @"b\" : "b/", item.GetMetadataValue("RecursiveDir"));
415
IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='i0;" + directory + (NativeMethodsShared.
IsWindows
? @"\**\*;i2'/>" : "/**/*;i2'/>"));
419
Assert.Equal(NativeMethodsShared.
IsWindows
? @"b\" : "b/", items[1].GetMetadataValue("RecursiveDir"));
752
if (NativeMethodsShared.
IsWindows
)
1646
<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") + @"'/>
266
<i Include='" + (NativeMethodsShared.
IsWindows
? @"c:\a\b.ext" : "/a/b.ext") + @"'/>
292
<i Include='" + (NativeMethodsShared.
IsWindows
? @"c:\a\b.ext" : "/a/b.ext") + @"'/>
320
<i Include='" + (NativeMethodsShared.
IsWindows
? @"c:\a\b.ext" : "/a/b.ext") + @"'>
Definition\ProjectProperty_Tests.cs (2)
155
string varName = NativeMethodsShared.
IsWindows
? "username" : "USER";
178
string varName = NativeMethodsShared.
IsWindows
? "username" : "USER";
FileSystems.cs (1)
20
if (NativeMethodsShared.
IsWindows
)
FileUtilities.cs (4)
564
if (NativeMethodsShared.
IsWindows
|| string.IsNullOrEmpty(value)
585
if (NativeMethodsShared.
IsWindows
|| value.IsEmpty)
670
if (NativeMethodsShared.
IsWindows
)
764
if (NativeMethodsShared.
IsWindows
&& !EndsWithSlash(fullPath))
Instance\ProjectInstance_Tests.cs (3)
895
instance.GetProperty(NativeMethodsShared.
IsWindows
? "username" : "USER").EvaluatedValue =
920
instance.GetProperty(NativeMethodsShared.
IsWindows
? "username" : "USER").EvaluatedValue =
942
instance.GetProperty(NativeMethodsShared.
IsWindows
? "username" : "USER").EvaluatedValue =
Instance\ProjectItemInstance_Tests.cs (1)
757
<i Include='i1.cpp;" + (NativeMethodsShared.
IsWindows
? @"c:\bar\i2.cpp" : "/bar/i2.cpp") + @"'>
TempFileUtilities.cs (1)
42
string msbuildTempFolder = NativeMethodsShared.
IsWindows
?
Microsoft.Build.Engine.UnitTests (86)
BackEnd\BuildRequestConfiguration_Tests.cs (1)
535
if (!NativeMethodsShared.
IsWindows
)
ConsoleLogger_Tests.cs (1)
2381
bool runningWithCharDevice = NativeMethodsShared.
IsWindows
? IsRunningWithCharacterFileType() : false;
Construction\SolutionFile_Tests.cs (5)
35
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";
115
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
678
p.FullPath = NativeMethodsShared.
IsWindows
? "c:\\foo.sln" : "/foo.sln";
Definition\Toolset_Tests.cs (1)
55
if (NativeMethodsShared.
IsWindows
)
Definition\ToolsetConfigurationReader_Tests.cs (1)
567
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";
148
NativeMethodsShared.
IsWindows
? "c:\\directory1\\directory2" : "/directory1/directory2",
224
string dir = NativeMethodsShared.
IsWindows
? "c:\\directory1\\directory2" : "/directory1/directory2";
225
string overrideDir = NativeMethodsShared.
IsWindows
? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks";
889
NativeMethodsShared.
IsWindows
? "c:\\inline" : "/inline",
954
new DefaultTasksFile(NativeMethodsShared.
IsWindows
963
new DefaultTasksFile(NativeMethodsShared.
IsWindows
969
new DefaultTasksFile(NativeMethodsShared.
IsWindows
975
new DefaultTasksFile(NativeMethodsShared.
IsWindows
981
new DefaultTasksFile(NativeMethodsShared.
IsWindows
987
new DefaultTasksFile(NativeMethodsShared.
IsWindows
993
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1001
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1009
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1015
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1028
new DefaultTasksFile(NativeMethodsShared.
IsWindows
1037
new DefaultTasksFile(NativeMethodsShared.
IsWindows
Evaluation\Evaluator_Tests.cs (12)
122
string fooPath = NativeMethodsShared.
IsWindows
? @"c:\temp\foo.import" : "/temp/foo.import";
123
string barPath = NativeMethodsShared.
IsWindows
? @"c:\temp\bar.import" : "/temp/bar.import";
1301
string targets1FileName = NativeMethodsShared.
IsWindows
? @"c:\a\t1.targets" : "/a/t1.targets";
1302
string aDirName = NativeMethodsShared.
IsWindows
? @"c:\a\" : "/a/";
1303
string targets2FileName = NativeMethodsShared.
IsWindows
? @"c:\a\b\t2.targets" : "/a/b/t2.targets";
1304
string bDirName = NativeMethodsShared.
IsWindows
? @"c:\a\b\" : "/a/b/";
1305
string targets3FileName = NativeMethodsShared.
IsWindows
? @"c:\t3.targets" : "/t3.targets";
1306
string rootDirName = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
1307
string aProjName = NativeMethodsShared.
IsWindows
? @"c:\a\p.proj" : "/a/p.proj";
2702
string file = NativeMethodsShared.
IsWindows
? @"c:\foo\bar.csproj" : "/foo/bar.csproj";
2721
string file = NativeMethodsShared.
IsWindows
? @"c:\bar.csproj" : "/bar.csproj";
2722
string dir = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
Evaluation\Expander_Tests.cs (10)
41
private static readonly string s_rootPathPrefix = NativeMethodsShared.
IsWindows
? "C:\\" : Path.VolumeSeparatorChar.ToString();
1315
NativeMethodsShared.
IsWindows
? @"subdir1\engine.dll" : "subdir1/engine.dll", project.FullPath);
1319
NativeMethodsShared.
IsWindows
? @"subdir2\tasks.dll" : "subdir2/tasks.dll", project.FullPath);
1805
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3760
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3784
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3808
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
3832
string envVar = NativeMethodsShared.
IsWindows
? "TEMP" : "USER";
4228
if (NativeMethodsShared.
IsWindows
)
4233
if (!NativeMethodsShared.
IsWindows
)
Evaluation\ItemEvaluation_Tests.cs (1)
604
if (!NativeMethodsShared.
IsWindows
)
Evaluation\ItemSpec_Tests.cs (1)
42
var absoluteRootPath = NativeMethodsShared.
IsWindows
FileMatcher_Tests.cs (17)
1004
if (NativeMethodsShared.
IsWindows
)
1018
NativeMethodsShared.
IsWindows
? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt",
1019
NativeMethodsShared.
IsWindows
? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt",
1446
string[] strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file" };
1447
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\" : "/").ToArray();
1450
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directory\\1.file" : "/directory/1.file" };
1451
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\" : "/").ToArray();
1452
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "directory\\1.file" : "directory/1.file");
1454
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directory\\1.file" : "/directory/1.file" };
1455
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1458
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file" };
1459
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1460
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "c:\\1.file" : "/1.file");
1462
strings = new string[1] { NativeMethodsShared.
IsWindows
? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file" };
1463
strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.
IsWindows
? "c:\\directory" : "/directory").ToArray();
1464
Assert.Equal(strings[0], NativeMethodsShared.
IsWindows
? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file");
1466
if (NativeMethodsShared.
IsWindows
)
FileUtilities_Tests.cs (13)
51
string itemSpec = NativeMethodsShared.
IsWindows
? @"c:\foo.txt" : "/foo.txt";
52
string itemSpecDir = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
72
string projectPath = NativeMethodsShared.
IsWindows
? @"c:\abc\goo.proj" : @"/abc/goo.proj";
73
string projectPathDir = NativeMethodsShared.
IsWindows
? @"c:\abc\" : @"/abc/";
90
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:" : "/"));
550
var isWindows = NativeMethodsShared.
IsWindows
;
965
string root = NativeMethodsShared.
IsWindows
? @"c:\" : "/";
Globbing\MSBuildGlob_Tests.cs (5)
39
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
112
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
133
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
153
var globRoot = NativeMethodsShared.
IsWindows
? @"c:\a" : "/a";
353
return NativeMethodsShared.
IsWindows
? normalizedPath.Replace("\\\\", "\\") : normalizedPath;
Microsoft.Build.Framework (18)
EncodingUtilities.cs (2)
57
if (NativeMethods.
IsWindows
)
223
if (!NativeMethods.
IsWindows
)
NativeMethods.cs (16)
447
if (
IsWindows
)
496
if (
IsWindows
)
601
return
IsWindows
&& !IsLongPathsEnabledRegistry();
708
get { return
IsWindows
? "Windows_NT" : "Unix"; }
860
if (
IsWindows
)
900
if (!
IsWindows
)
977
if (
IsWindows
)
995
if (
IsWindows
)
1059
if (
IsWindows
)
1375
if (
IsWindows
)
1459
if (
IsWindows
)
1506
if (
IsWindows
&& originalConsoleMode is not null)
1590
if (
IsWindows
)
1697
return
IsWindows
1712
return
IsWindows
1727
return
IsWindows
Microsoft.Build.Framework.UnitTests (3)
FileClassifier_Tests.cs (3)
26
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
40
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
58
var volume = NativeMethodsShared.
IsWindows
? @"X:\" : "/home/usr";
Microsoft.Build.Tasks.Core (53)
AssemblyDependency\AssemblyInformation.cs (6)
78
if (NativeMethodsShared.
IsWindows
)
246
if (!NativeMethodsShared.
IsWindows
)
384
if (!NativeMethodsShared.
IsWindows
)
637
if (NativeMethodsShared.
IsWindows
)
660
if (NativeMethodsShared.
IsWindows
)
711
if (!NativeMethodsShared.
IsWindows
)
AssemblyDependency\AssemblyMetadata.cs (1)
30
ScatterFiles = NativeMethodsShared.
IsWindows
? import.Files : null;
AssemblyDependency\GlobalAssemblyCache.cs (1)
185
if (NativeMethodsShared.
IsWindows
)
AssemblyDependency\Reference.cs (1)
514
else if (NativeMethodsShared.
IsWindows
)
AssemblyFolder.cs (1)
108
if (NativeMethodsShared.
IsWindows
)
AssemblyFoldersEx.cs (1)
80
if (!NativeMethodsShared.
IsWindows
)
BuildEnvironmentHelper.cs (3)
139
if (!NativeMethodsShared.
IsWindows
)
171
if (NativeMethodsShared.
IsWindows
&&
244
if (NativeMethodsShared.
IsWindows
&&
Copy.cs (2)
326
if (!NativeMethodsShared.
IsWindows
)
1028
if (NativeMethodsShared.
IsWindows
)
Exec.cs (3)
493
if (NativeMethodsShared.
IsWindows
)
585
if (NativeMethodsShared.
IsWindows
)
646
protected override string ToolName => NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
FileMatcher.cs (2)
1259
bool isUncPath = NativeMethodsShared.
IsWindows
&& fixedDir.Length > 1
2255
if (NativeMethodsShared.
IsWindows
&&
FileState.cs (3)
90
if (NativeMethodsShared.
IsWindows
)
103
if (NativeMethodsShared.
IsWindows
)
177
if (NativeMethodsShared.
IsWindows
)
FileSystems.cs (1)
20
if (NativeMethodsShared.
IsWindows
)
FileUtilities.cs (6)
484
if (NativeMethodsShared.
IsWindows
)
509
if (!NativeMethodsShared.
IsWindows
|| !path.StartsWith(@"\\", StringComparison.Ordinal))
564
if (NativeMethodsShared.
IsWindows
|| string.IsNullOrEmpty(value)
585
if (NativeMethodsShared.
IsWindows
|| value.IsEmpty)
670
if (NativeMethodsShared.
IsWindows
)
764
if (NativeMethodsShared.
IsWindows
&& !EndsWithSlash(fullPath))
GenerateApplicationManifest.cs (1)
115
if (!NativeMethodsShared.
IsWindows
)
GenerateDeploymentManifest.cs (1)
157
if (!NativeMethodsShared.
IsWindows
)
GenerateLauncher.cs (1)
44
if (!NativeMethodsShared.
IsWindows
)
GenerateManifestBase.cs (2)
275
if (!NativeMethodsShared.
IsWindows
)
623
if (NativeMethodsShared.
IsWindows
)
GenerateResource.cs (1)
932
private static readonly bool AllowMOTW = !NativeMethodsShared.
IsWindows
|| (Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\SDK", "AllowProcessOfUntrustedResourceFiles", null) is string allowUntrustedFiles && allowUntrustedFiles.Equals("true", StringComparison.OrdinalIgnoreCase));
GetInstalledSDKLocations.cs (1)
127
if (!NativeMethodsShared.
IsWindows
)
GetSDKReferenceFiles.cs (1)
230
if (!NativeMethodsShared.
IsWindows
)
ManagedFileSystem.cs (1)
26
return NativeMethodsShared.
IsWindows
;
ManifestUtil\SecurityUtil.cs (1)
868
if (NativeMethodsShared.
IsWindows
&& (toolPath == null || !FileSystems.Default.FileExists(toolPath)))
Modifiers.cs (1)
464
if (NativeMethodsShared.
IsWindows
)
NativeMethods.cs (5)
805
if (NativeMethodsShared.
IsWindows
)
838
if (NativeMethodsShared.
IsWindows
)
989
if (NativeMethodsShared.
IsWindows
)
1284
if (NativeMethodsShared.
IsWindows
)
1344
if (NativeMethodsShared.
IsWindows
)
ResGen.cs (2)
334
&& NativeMethodsShared.
IsWindows
374
NativeMethodsShared.
IsWindows
&&
ResolveSDKReference.cs (1)
268
if (!NativeMethodsShared.
IsWindows
)
SignFile.cs (1)
46
if (!NativeMethodsShared.
IsWindows
)
TempFileUtilities.cs (1)
42
string msbuildTempFolder = NativeMethodsShared.
IsWindows
?
XamlTaskFactory\TaskParser.cs (1)
174
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.Tasks.UnitTests (69)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (1)
190
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");
39
{ new TaskItem(NativeMethodsShared.
IsWindows
? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt") };
40
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
55
NativeMethodsShared.
IsWindows
? @"d:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt")
61
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1" : "/x1";
76
NativeMethodsShared.
IsWindows
? @"c:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt")
78
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
82
t.AssignedFiles[0].GetMetadata("TargetPath").ShouldBe(NativeMethodsShared.
IsWindows
? @"f3\f4\file.txt" : "f3/f4/file.txt");
101
itemSpec: NativeMethodsShared.
IsWindows
? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt",
104
t.RootFolder = NativeMethodsShared.
IsWindows
? @"c:\f1\f2" : "/f1/f2";
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
72
projectDirectoryPath = NativeMethodsShared.
IsWindows
? projectDirectoryPath.Replace(":\\", "\\") : projectDirectoryPath.Replace("/", "\\");
124
projectDirectory = NativeMethodsShared.
IsWindows
? projectDirectory.Replace(":\\", "\\") : projectDirectory.Replace("/", "\\");
CombinePath_Tests.cs (11)
49
string path1 = NativeMethodsShared.
IsWindows
? @"c:\ghi.txt" : "/ghi.txt";
50
string path2 = NativeMethodsShared.
IsWindows
? @"d:\jkl\mno.txt" : "/jkl/mno.txt";
52
string pathsToMatch = string.Format(NativeMethodsShared.
IsWindows
? @"
61
t.Paths = NativeMethodsShared.
IsWindows
78
t.BasePath = NativeMethodsShared.
IsWindows
? @"c:\abc\def" : "/abc/def";
98
t.BasePath = NativeMethodsShared.
IsWindows
? @"\\fileserver\public" : "/rootdir/public";
99
string path1 = NativeMethodsShared.
IsWindows
? @"c:\ghi.txt" : "/ghi.txt";
100
string path2 = NativeMethodsShared.
IsWindows
? @"d:\jkl\mno.txt" : "/jkl/mno.txt";
102
string pathsToMatch = string.Format(NativeMethodsShared.
IsWindows
? @"
110
t.Paths = NativeMethodsShared.
IsWindows
128
if (NativeMethodsShared.
IsWindows
)
Copy_Tests.cs (1)
1384
if (NativeMethodsShared.
IsWindows
)
Exec_Tests.cs (22)
148
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "xcopy thisisanonexistentfile" : "cp thisisanonexistentfile thatisanonexistentfile");
152
Assert.Equal(NativeMethodsShared.
IsWindows
? 4 : 1, exec.ExitCode);
154
if (!NativeMethodsShared.
IsWindows
)
164
int expectedExitCode = NativeMethodsShared.
IsWindows
? -1 : 137;
166
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? ":foo \n goto foo" : "while true; do sleep 1; done");
185
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? ":foo \n goto foo" : "while true; do sleep 1; done");
199
exec.ExitCode.ShouldBe(NativeMethodsShared.
IsWindows
? -1 : 137);
228
var cmdLine = NativeMethodsShared.
IsWindows
245
var cmdLine = NativeMethodsShared.
IsWindows
269
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "echo [%cd%]" : "echo [$PWD]");
270
string working = !NativeMethodsShared.
IsWindows
? "/usr/lib" :
302
Directory.SetCurrentDirectory(NativeMethodsShared.
IsWindows
?
305
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? "echo [%cd%]" : "echo [$PWD]");
579
if (!NativeMethodsShared.
IsWindows
)
640
if (NativeMethodsShared.
IsWindows
)
663
if (NativeMethodsShared.
IsWindows
)
694
if (NativeMethodsShared.
IsWindows
)
726
var cmdLine = NativeMethodsShared.
IsWindows
742
var cmdLine = NativeMethodsShared.
IsWindows
792
var cmdLine = NativeMethodsShared.
IsWindows
888
exec.Command = NativeMethodsShared.
IsWindows
? "echo [%MYENVVAR%]" : "echo [$myenvvar]";
1041
Exec exec = PrepareExec(NativeMethodsShared.
IsWindows
? $"type {textFilePath}" : $"cat {textFilePath}");
FindUnderPath_Tests.cs (3)
79
new TaskItem(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt") };
112
Assert.Equal(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
134
Assert.Equal(NativeMethodsShared.
IsWindows
? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
MakeDir_Tests.cs (2)
91
if (NativeMethodsShared.
IsWindows
)
115
if (!NativeMethodsShared.
IsWindows
)
ResolveSDKReference_Tests.cs (2)
26
private readonly string _sdkPath = NativeMethodsShared.
IsWindows
1520
string goodSDKLocation = NativeMethodsShared.
IsWindows
? "C:\\GoodSDKLocation\\" : "/GoodSDKLocation/";
ResourceHandling\GenerateResource_Tests.cs (7)
433
NativeMethodsShared.
IsWindows
? bitmap.ToUpper() : bitmap,
652
NativeMethodsShared.
IsWindows
? bitmap.ToUpper() : bitmap);
698
if (!NativeMethodsShared.
IsWindows
)
908
if (!NativeMethodsShared.
IsWindows
)
2840
t.StronglyTypedFileName = NativeMethodsShared.
IsWindows
? "||" : "\0";
4076
NativeMethodsShared.
IsWindows
4166
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)
156
if (NativeMethodsShared.
IsWindows
)
WriteCodeFragment_Tests.cs (1)
542
public static string EscapedLineSeparator => NativeMethodsShared.
IsWindows
? "\\r\\n" : "\\n";
Microsoft.Build.UnitTests.Shared (7)
DummyMappedDrive.cs (2)
25
if (!NativeMethodsShared.
IsWindows
)
61
if (_mapped && NativeMethodsShared.
IsWindows
)
DummyMappedDriveUtils.cs (1)
26
return NativeMethods.
IsWindows
? new DummyMappedDrive() : default;
ObjectModelHelpers.cs (2)
1987
NativeMethodsShared.
IsWindows
1998
NativeMethodsShared.
IsWindows
RequiresSymbolicLinksFactAttribute.cs (1)
22
if (s_runningInAzurePipeline || !NativeMethodsShared.
IsWindows
)
RunnerUtilities.cs (1)
78
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.Utilities.Core (41)
AssemblyFoldersEx.cs (1)
80
if (!NativeMethodsShared.
IsWindows
)
BuildEnvironmentHelper.cs (3)
139
if (!NativeMethodsShared.
IsWindows
)
171
if (NativeMethodsShared.
IsWindows
&&
244
if (NativeMethodsShared.
IsWindows
&&
FileMatcher.cs (2)
1259
bool isUncPath = NativeMethodsShared.
IsWindows
&& fixedDir.Length > 1
2255
if (NativeMethodsShared.
IsWindows
&&
FileSystems.cs (1)
20
if (NativeMethodsShared.
IsWindows
)
FileUtilities.cs (6)
484
if (NativeMethodsShared.
IsWindows
)
509
if (!NativeMethodsShared.
IsWindows
|| !path.StartsWith(@"\\", StringComparison.Ordinal))
564
if (NativeMethodsShared.
IsWindows
|| string.IsNullOrEmpty(value)
585
if (NativeMethodsShared.
IsWindows
|| value.IsEmpty)
670
if (NativeMethodsShared.
IsWindows
)
764
if (NativeMethodsShared.
IsWindows
&& !EndsWithSlash(fullPath))
FrameworkLocationHelper.cs (16)
90
internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethodsShared.
IsWindows
? "v1.1" : "1.1"; // v1.1 is for Everett.
95
internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethodsShared.
IsWindows
? "v2.0" : "2.0"; // v2.0 is for Whidbey.
99
internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethodsShared.
IsWindows
? "v3.0" : "3.0"; // v3.0 is for WinFx.
113
internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethodsShared.
IsWindows
? "v3.5" : "3.5"; // v3.5 is for Orcas.
119
internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethodsShared.
IsWindows
? "v4.0" : "4.0";
120
internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethodsShared.
IsWindows
? "v4.5" : "4.5";
503
if (!NativeMethodsShared.
IsWindows
)
553
if (NativeMethodsShared.
IsWindows
)
600
if (NativeMethodsShared.
IsWindows
)
741
if (NativeMethodsShared.
IsWindows
)
774
if (!NativeMethodsShared.
IsWindows
)
928
combinedPath = NativeMethodsShared.
IsWindows
1142
dotNetFrameworkVersionFolderPrefix: NativeMethodsShared.
IsWindows
? "v4.0" : "v4.5",
1373
if (NativeMethodsShared.
IsWindows
&& !CheckForFrameworkInstallation(
1395
(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.
IsWindows
? "MSBuild.exe" : "mcs.exe")) &&
1514
if (NativeMethodsShared.
IsWindows
)
ManagedFileSystem.cs (1)
26
return NativeMethodsShared.
IsWindows
;
Modifiers.cs (1)
464
if (NativeMethodsShared.
IsWindows
)
ProcessExtensions.cs (1)
17
if (NativeMethodsShared.
IsWindows
)
TempFileUtilities.cs (1)
42
string msbuildTempFolder = NativeMethodsShared.
IsWindows
?
ToolLocationHelper.cs (4)
1821
if (NativeMethodsShared.
IsWindows
&& platformTarget != null)
2438
string registryRoot = NativeMethodsShared.
IsWindows
? GetTargetPlatformMonikerRegistryRoots(registrySearchLocation) : string.Empty;
2463
if (NativeMethodsShared.
IsWindows
&& ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4))
2889
if (NativeMethodsShared.
IsWindows
)
ToolTask.cs (4)
655
if (NativeMethodsShared.
IsWindows
)
767
if (NativeMethodsShared.
IsWindows
)
1400
bool runningOnWindows = NativeMethodsShared.
IsWindows
;
1632
if (NativeMethodsShared.
IsWindows
)
Microsoft.Build.Utilities.UnitTests (40)
ProcessExtensions_Tests.cs (1)
20
NativeMethodsShared.
IsWindows
?
TaskItem_Tests.cs (2)
227
from.ItemSpec = NativeMethodsShared.
IsWindows
? @"c:\subdir\Monkey.txt" : "/subdir/Monkey.txt";
228
from.GetMetadata(FileUtilities.ItemSpecModifiers.Directory).ShouldBe(NativeMethodsShared.
IsWindows
? @"subdir\" : "subdir/");
ToolLocationHelper_Tests.cs (11)
376
NativeMethodsShared.
IsWindows
? "f:\\IDontExistAtAll" : "/IDontExistAtAll");
388
NativeMethodsShared.
IsWindows
? "f:\\IDontExistAtAll" : "/IDontExistAtAll",
1264
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1285
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1307
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1328
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
1351
string targetFrameworkRootPath = NativeMethodsShared.
IsWindows
3075
string tooLongPath = NativeMethodsShared.
IsWindows
3110
string normalDirectory = NativeMethodsShared.
IsWindows
? "c:\\SDKPath" : "/SDKPath";
3131
string frameworkPathPattern = NativeMethodsShared.
IsWindows
? @"Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MyFramework" : "Microsoft SDKs/Windows/v8.0/ExtensionSDKs/MyFramework";
3132
string frameworkPathPattern2 = NativeMethodsShared.
IsWindows
? @"ExtensionSDKs\MyFramework" : "ExtensionSDKs/MyFramework";
ToolTask_Tests.cs (26)
111
if (!NativeMethodsShared.
IsWindows
&& string.IsNullOrEmpty(responseFileCommands) && string.IsNullOrEmpty(commandLineCommands))
118
StartInfo = GetProcessStartInfo(GenerateFullPathToTool(), NativeMethodsShared.
IsWindows
? "/x" : string.Empty, null);
130
t.ToolPath = NativeMethodsShared.
IsWindows
? @"C:\MyAlternatePath" : "/MyAlternatePath";
146
t.ToolPath = NativeMethodsShared.
IsWindows
? @"C:\MyAlternatePath" : "/MyAlternatePath";
166
t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.
IsWindows
? "attrib.exe" : "ps");
188
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
? "/C garbagegarbagegarbagegarbage.exe" : "-c garbagegarbagegarbagegarbage.exe";
191
t.ExitCode.ShouldBe(NativeMethodsShared.
IsWindows
? 1 : 127); // cmd.exe error code is 1, sh error code is 127
213
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
240
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
272
string singleQuote = NativeMethodsShared.
IsWindows
? "'" : string.Empty;
289
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
313
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
337
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
361
t.FullToolName = NativeMethodsShared.
IsWindows
? "c:\\baz\\foo.exe" : "/baz/foo.exe";
376
string shellName = NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
377
string copyName = NativeMethodsShared.
IsWindows
? "xcopy.exe" : "cp";
429
string toolName = NativeMethodsShared.
IsWindows
? "cmd.exe" : "sh";
457
t.FullToolName = NativeMethodsShared.
IsWindows
? "findstr.exe" : "grep";
485
t.FullToolName = NativeMethodsShared.
IsWindows
? "findstr.exe" : "grep";
519
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
546
string userVarName = NativeMethodsShared.
IsWindows
? "username" : "user";
560
if (NativeMethodsShared.
IsWindows
)
652
string toolName = NativeMethodsShared.
IsWindows
? "cmd" : "sh";
693
if (NativeMethodsShared.
IsWindows
)
732
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
764
t.MockCommandLineCommands = NativeMethodsShared.
IsWindows
MSBuild (14)
BuildEnvironmentHelper.cs (3)
139
if (!NativeMethodsShared.
IsWindows
)
171
if (NativeMethodsShared.
IsWindows
&&
244
if (NativeMethodsShared.
IsWindows
&&
CommunicationsUtilities.cs (1)
517
if (!NativeMethodsShared.
IsWindows
)
FileSystems.cs (1)
20
if (NativeMethodsShared.
IsWindows
)
FileUtilities.cs (4)
564
if (NativeMethodsShared.
IsWindows
|| string.IsNullOrEmpty(value)
585
if (NativeMethodsShared.
IsWindows
|| value.IsEmpty)
670
if (NativeMethodsShared.
IsWindows
)
764
if (NativeMethodsShared.
IsWindows
&& !EndsWithSlash(fullPath))
ManagedFileSystem.cs (1)
26
return NativeMethodsShared.
IsWindows
;
Modifiers.cs (1)
464
if (NativeMethodsShared.
IsWindows
)
MSBuildClientApp.cs (1)
109
NativeMethodsShared.
IsWindows
? "dotnet.exe" : "dotnet");
TempFileUtilities.cs (1)
42
string msbuildTempFolder = NativeMethodsShared.
IsWindows
?
XMake.cs (1)
1846
if (NativeMethodsShared.
IsWindows
&&