@@ -415,7 +415,7 @@ public void TestDefaultCSharpAutoBuilder()
415415 actions . RunProcess [ "cmd.exe /C dotnet --info" ] = 0 ;
416416 actions . RunProcess [ @"cmd.exe /C dotnet clean C:\Project\test.csproj" ] = 0 ;
417417 actions . RunProcess [ @"cmd.exe /C dotnet restore C:\Project\test.csproj" ] = 0 ;
418- actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental C:\Project\test.csproj" ] = 0 ;
418+ actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false C:\Project\test.csproj" ] = 0 ;
419419 actions . FileExists [ "csharp.log" ] = true ;
420420 actions . FileExists [ @"C:\Project\test.csproj" ] = true ;
421421 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
@@ -439,9 +439,6 @@ public void TestDefaultCSharpAutoBuilder()
439439 [ Fact ]
440440 public void TestLinuxCSharpAutoBuilder ( )
441441 {
442- actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
443- actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
444- Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
445442 actions . RunProcess [ "dotnet --info" ] = 0 ;
446443 actions . RunProcess [ @"dotnet clean C:\Project/test.csproj" ] = 0 ;
447444 actions . RunProcess [ @"dotnet restore C:\Project/test.csproj" ] = 0 ;
@@ -463,7 +460,7 @@ public void TestLinuxCSharpAutoBuilder()
463460 actions . LoadXml [ @"C:\Project/test.csproj" ] = xml ;
464461
465462 var autobuilder = CreateAutoBuilder ( false ) ;
466- TestAutobuilderScript ( autobuilder , 0 , 5 ) ;
463+ TestAutobuilderScript ( autobuilder , 0 , 4 ) ;
467464 }
468465
469466 [ Fact ]
@@ -603,8 +600,6 @@ private void TestAutobuilderScript(Autobuilder autobuilder, int expectedOutput,
603600 [ Fact ]
604601 public void TestLinuxBuildCommand ( )
605602 {
606- actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
607- actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
608603 actions . RunProcess [ @"C:\odasa/tools/odasa index --auto ""./build.sh --skip-tests""" ] = 0 ;
609604 actions . FileExists [ "csharp.log" ] = true ;
610605 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
@@ -615,7 +610,7 @@ public void TestLinuxBuildCommand()
615610 SkipVsWhere ( ) ;
616611
617612 var autobuilder = CreateAutoBuilder ( false , buildCommand : "./build.sh --skip-tests" ) ;
618- TestAutobuilderScript ( autobuilder , 0 , 2 ) ;
613+ TestAutobuilderScript ( autobuilder , 0 , 1 ) ;
619614 }
620615
621616 [ Fact ]
@@ -626,14 +621,12 @@ public void TestLinuxBuildSh()
626621 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
627622 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
628623 actions . RunProcess [ @"/bin/chmod u+x C:\Project/build/build.sh" ] = 0 ;
629- actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
630- actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
631624 actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/build/build.sh" ] = 0 ;
632625 actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto C:\Project/build/build.sh" ] = @"C:\Project/build" ;
633626 actions . FileExists [ "csharp.log" ] = true ;
634627
635628 var autobuilder = CreateAutoBuilder ( false ) ;
636- TestAutobuilderScript ( autobuilder , 0 , 3 ) ;
629+ TestAutobuilderScript ( autobuilder , 0 , 2 ) ;
637630 }
638631
639632 [ Fact ]
@@ -645,14 +638,12 @@ public void TestLinuxBuildShCSharpLogMissing()
645638 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
646639
647640 actions . RunProcess [ @"/bin/chmod u+x C:\Project/build.sh" ] = 0 ;
648- actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
649- actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
650641 actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/build.sh" ] = 0 ;
651642 actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto C:\Project/build.sh" ] = @"C:\Project" ;
652643 actions . FileExists [ "csharp.log" ] = false ;
653644
654645 var autobuilder = CreateAutoBuilder ( false ) ;
655- TestAutobuilderScript ( autobuilder , 1 , 3 ) ;
646+ TestAutobuilderScript ( autobuilder , 1 , 2 ) ;
656647 }
657648
658649 [ Fact ]
@@ -664,14 +655,12 @@ public void TestLinuxBuildShFailed()
664655 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
665656
666657 actions . RunProcess [ @"/bin/chmod u+x C:\Project/build.sh" ] = 0 ;
667- actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
668- actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
669658 actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/build.sh" ] = 5 ;
670659 actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto C:\Project/build.sh" ] = @"C:\Project" ;
671660 actions . FileExists [ "csharp.log" ] = true ;
672661
673662 var autobuilder = CreateAutoBuilder ( false ) ;
674- TestAutobuilderScript ( autobuilder , 1 , 3 ) ;
663+ TestAutobuilderScript ( autobuilder , 1 , 2 ) ;
675664 }
676665
677666 [ Fact ]
@@ -872,9 +861,6 @@ public void TestSkipNugetBuildless()
872861 [ Fact ]
873862 public void TestSkipNugetDotnet ( )
874863 {
875- actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
876- actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
877- Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
878864 actions . RunProcess [ "dotnet --info" ] = 0 ;
879865 actions . RunProcess [ @"dotnet clean C:\Project/test.csproj" ] = 0 ;
880866 actions . RunProcess [ @"dotnet restore C:\Project/test.csproj" ] = 0 ;
@@ -896,7 +882,7 @@ public void TestSkipNugetDotnet()
896882 actions . LoadXml [ @"C:\Project/test.csproj" ] = xml ;
897883
898884 var autobuilder = CreateAutoBuilder ( false , dotnetArguments : "--no-restore" ) ; // nugetRestore=false does not work for now.
899- TestAutobuilderScript ( autobuilder , 0 , 5 ) ;
885+ TestAutobuilderScript ( autobuilder , 0 , 4 ) ;
900886 }
901887
902888 [ Fact ]
@@ -907,13 +893,10 @@ public void TestDotnetVersionNotInstalled()
907893 actions . RunProcess [ @"chmod u+x dotnet-install.sh" ] = 0 ;
908894 actions . RunProcess [ @"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet" ] = 0 ;
909895 actions . RunProcess [ @"rm dotnet-install.sh" ] = 0 ;
910- actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
911- actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
912- Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
913896 actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
914897 actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean C:\Project/test.csproj" ] = 0 ;
915898 actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore C:\Project/test.csproj" ] = 0 ;
916- actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental C:\Project/test.csproj" ] = 0 ;
899+ actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false C:\Project/test.csproj" ] = 0 ;
917900 actions . FileExists [ "csharp.log" ] = true ;
918901 actions . FileExists [ "test.csproj" ] = true ;
919902 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
@@ -933,7 +916,7 @@ public void TestDotnetVersionNotInstalled()
933916 actions . DownloadFiles . Add ( ( "https://dot.net/v1/dotnet-install.sh" , "dotnet-install.sh" ) ) ;
934917
935918 var autobuilder = CreateAutoBuilder ( false , dotnetVersion : "2.1.3" ) ;
936- TestAutobuilderScript ( autobuilder , 0 , 9 ) ;
919+ TestAutobuilderScript ( autobuilder , 0 , 8 ) ;
937920 }
938921
939922 [ Fact ]
@@ -945,11 +928,6 @@ public void TestDotnetVersionAlreadyInstalled()
945928 actions . RunProcess [ @"chmod u+x dotnet-install.sh" ] = 0 ;
946929 actions . RunProcess [ @"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet" ] = 0 ;
947930 actions . RunProcess [ @"rm dotnet-install.sh" ] = 0 ;
948- actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
949- actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
950- Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
951- Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
952- Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
953931 actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
954932 actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean C:\Project/test.csproj" ] = 0 ;
955933 actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore C:\Project/test.csproj" ] = 0 ;
@@ -973,7 +951,7 @@ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
973951 actions . DownloadFiles . Add ( ( "https://dot.net/v1/dotnet-install.sh" , "dotnet-install.sh" ) ) ;
974952
975953 var autobuilder = CreateAutoBuilder ( false , dotnetVersion : "2.1.3" ) ;
976- TestAutobuilderScript ( autobuilder , 0 , 9 ) ;
954+ TestAutobuilderScript ( autobuilder , 0 , 8 ) ;
977955 }
978956
979957 private void TestDotnetVersionWindows ( Action action , int commandsRun )
@@ -984,7 +962,7 @@ private void TestDotnetVersionWindows(Action action, int commandsRun)
984962 actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet --info" ] = 0 ;
985963 actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet clean C:\Project\test.csproj" ] = 0 ;
986964 actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet restore C:\Project\test.csproj" ] = 0 ;
987- actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental C:\Project\test.csproj" ] = 0 ;
965+ actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental /p:UseSharedCompilation=false C:\Project\test.csproj" ] = 0 ;
988966 actions . FileExists [ "csharp.log" ] = true ;
989967 actions . FileExists [ @"C:\Project\test.csproj" ] = true ;
990968 actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
0 commit comments