diff --git a/Compilers.slnf b/Compilers.slnf index 49acd2063d586..458efec9fbc6d 100644 --- a/Compilers.slnf +++ b/Compilers.slnf @@ -53,6 +53,7 @@ "src\\ExpressionEvaluator\\Core\\Source\\ExpressionCompiler\\Microsoft.CodeAnalysis.ExpressionCompiler.csproj", "src\\ExpressionEvaluator\\VisualBasic\\Source\\ExpressionCompiler\\Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler.vbproj", "src\\Interactive\\csi\\csi.csproj", + "src\\NuGet\\Microsoft.CodeAnalysis.BuildClient.Package\\Microsoft.CodeAnalysis.BuildClient.Package.csproj", "src\\NuGet\\Microsoft.CodeAnalysis.Compilers.Package\\Microsoft.CodeAnalysis.Compilers.Package.csproj", "src\\NuGet\\Microsoft.CodeAnalysis.Package\\Microsoft.CodeAnalysis.Package.csproj", "src\\NuGet\\Microsoft.Net.Compilers.Toolset\\AnyCpu\\Microsoft.Net.Compilers.Toolset.Package.csproj", diff --git a/Roslyn.sln b/Roslyn.sln index 980009f1a1d57..27c924657d823 100644 --- a/Roslyn.sln +++ b/Roslyn.sln @@ -733,6 +733,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeA EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests", "src\Compilers\Core\SdkTaskTests\Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj", "{5399BBCC-417F-C710-46DE-EB0C0074C34D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.BuildClient.Package", "src\NuGet\Microsoft.CodeAnalysis.BuildClient.Package\Microsoft.CodeAnalysis.BuildClient.Package.csproj", "{5E4F7448-B00B-4F5B-859F-6ED0354253D5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1807,6 +1809,10 @@ Global {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Debug|Any CPU.Build.0 = Debug|Any CPU {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Release|Any CPU.ActiveCfg = Release|Any CPU {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Release|Any CPU.Build.0 = Release|Any CPU + {5E4F7448-B00B-4F5B-859F-6ED0354253D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E4F7448-B00B-4F5B-859F-6ED0354253D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E4F7448-B00B-4F5B-859F-6ED0354253D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E4F7448-B00B-4F5B-859F-6ED0354253D5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2150,6 +2156,7 @@ Global {1B4AC233-B345-123F-E004-DAA28DE1CB08} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {5399BBCC-417F-C710-46DE-EB0C0074C34D} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} + {5E4F7448-B00B-4F5B-859F-6ED0354253D5} = {C52D8057-43AF-40E6-A01B-6CDBB7301985} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29} diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index e2ad4fac15ab1..9727fa29ce656 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -31,6 +31,7 @@ "Microsoft.Net.Compilers.Toolset.Arm64": "arcade", "Microsoft.Net.Compilers.Toolset.Framework": "arcade", "Microsoft.NETCore.Compilers": "arcade", + "Microsoft.CodeAnalysis.BuildClient": "arcade", "Microsoft.CodeAnalysis.Contracts": "arcade", "Microsoft.CodeAnalysis.Debugging": "arcade", "Microsoft.CodeAnalysis.PooledObjects": "arcade", diff --git a/src/Compilers/CSharp/csc/CscCommandLine.projitems b/src/Compilers/CSharp/csc/CscCommandLine.projitems index 3aef01cf38e3c..90bc1372064fd 100644 --- a/src/Compilers/CSharp/csc/CscCommandLine.projitems +++ b/src/Compilers/CSharp/csc/CscCommandLine.projitems @@ -18,16 +18,16 @@ CommandLine - - - - - - + - + + + + + + diff --git a/src/Compilers/Core/MSBuildTask/Directory.Build.props b/src/Compilers/Core/MSBuildTask/Directory.Build.props index 6c4c27e3282bd..734b20b8f8522 100644 --- a/src/Compilers/Core/MSBuildTask/Directory.Build.props +++ b/src/Compilers/Core/MSBuildTask/Directory.Build.props @@ -23,18 +23,9 @@ - - - - - - - - + - - @@ -68,4 +59,6 @@ contentFiles\any\any + + diff --git a/src/Compilers/Core/Portable/InternalUtilities/Debug.cs b/src/Compilers/Core/Portable/InternalUtilities/Debug.cs index ebd3a10bf6250..4468c0ac5266c 100644 --- a/src/Compilers/Core/Portable/InternalUtilities/Debug.cs +++ b/src/Compilers/Core/Portable/InternalUtilities/Debug.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs b/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs index fbf4474699150..559fc24c63aad 100644 --- a/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs +++ b/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.IO; using System.Runtime.Versioning; diff --git a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems index 395032d6c3f0a..0034825a87d6d 100644 --- a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems +++ b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems @@ -18,15 +18,15 @@ - - - - - - + + + + + + diff --git a/src/Compilers/Core/CommandLine/BuildProtocol.cs b/src/Compilers/Shared/BuildProtocol.cs similarity index 99% rename from src/Compilers/Core/CommandLine/BuildProtocol.cs rename to src/Compilers/Shared/BuildProtocol.cs index e315beaf65a28..1bd920af986e0 100644 --- a/src/Compilers/Core/CommandLine/BuildProtocol.cs +++ b/src/Compilers/Shared/BuildProtocol.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using Roslyn.Utilities; using System; using System.Collections.Generic; diff --git a/src/Compilers/Shared/BuildServerConnection.cs b/src/Compilers/Shared/BuildServerConnection.cs index 675771e47e064..e3e61d1b46ffd 100644 --- a/src/Compilers/Shared/BuildServerConnection.cs +++ b/src/Compilers/Shared/BuildServerConnection.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.Collections.Generic; using System.Diagnostics; @@ -63,7 +65,8 @@ internal static BuildRequest CreateBuildRequest( string workingDirectory, string? tempDirectory, string? keepAlive, - string? libDirectory) + string? libDirectory, + string? compilerHash = null) { Debug.Assert(workingDirectory is object); @@ -72,7 +75,7 @@ internal static BuildRequest CreateBuildRequest( arguments, workingDirectory: workingDirectory, tempDirectory: tempDirectory, - compilerHash: BuildProtocolConstants.GetCommitHash() ?? "", + compilerHash: compilerHash ?? BuildProtocolConstants.GetCommitHash() ?? "", requestId: requestId, keepAlive: keepAlive, libDirectory: libDirectory); @@ -178,12 +181,6 @@ internal static async Task RunServerBuildRequestAsync( { Debug.Assert(pipeName is object); - // early check for the build hash. If we can't find it something is wrong; no point even trying to go to the server - if (string.IsNullOrWhiteSpace(BuildProtocolConstants.GetCommitHash())) - { - return new IncorrectHashBuildResponse(); - } - using var pipe = await tryConnectToServerAsync(pipeName, timeoutOverride, logger, tryCreateServerFunc, cancellationToken).ConfigureAwait(false); if (pipe is null) { diff --git a/src/Compilers/Core/CommandLine/CompilerServerLogger.cs b/src/Compilers/Shared/CompilerServerLogger.cs similarity index 99% rename from src/Compilers/Core/CommandLine/CompilerServerLogger.cs rename to src/Compilers/Shared/CompilerServerLogger.cs index b0f2a0cb0df69..9f1a6a7f3f43d 100644 --- a/src/Compilers/Core/CommandLine/CompilerServerLogger.cs +++ b/src/Compilers/Shared/CompilerServerLogger.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using Roslyn.Utilities; using System; using System.Collections.Generic; diff --git a/src/Compilers/Core/CommandLine/ConsoleUtil.cs b/src/Compilers/Shared/ConsoleUtil.cs similarity index 100% rename from src/Compilers/Core/CommandLine/ConsoleUtil.cs rename to src/Compilers/Shared/ConsoleUtil.cs diff --git a/src/Compilers/Shared/NamedPipeUtil.cs b/src/Compilers/Shared/NamedPipeUtil.cs index 0a45e71b27ba1..50c2595610c31 100644 --- a/src/Compilers/Shared/NamedPipeUtil.cs +++ b/src/Compilers/Shared/NamedPipeUtil.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.IO; using System.IO.Pipes; diff --git a/src/Compilers/Core/CommandLine/NativeMethods.cs b/src/Compilers/Shared/NativeMethods.cs similarity index 99% rename from src/Compilers/Core/CommandLine/NativeMethods.cs rename to src/Compilers/Shared/NativeMethods.cs index c5008b95be2dc..647245ea26646 100644 --- a/src/Compilers/Core/CommandLine/NativeMethods.cs +++ b/src/Compilers/Shared/NativeMethods.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.Runtime.InteropServices; using System.Runtime.Versioning; diff --git a/src/Compilers/Shared/RuntimeHostInfo.cs b/src/Compilers/Shared/RuntimeHostInfo.cs index 26d11e2d2837e..7ff9b16c7dfab 100644 --- a/src/Compilers/Shared/RuntimeHostInfo.cs +++ b/src/Compilers/Shared/RuntimeHostInfo.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems index 0ac1959f91e31..aab4e9fe23999 100644 --- a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems +++ b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems @@ -18,15 +18,15 @@ CommandLine - - - - - - + + + + + + diff --git a/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.Package.csproj b/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.Package.csproj new file mode 100644 index 0000000000000..140c6b85b08c9 --- /dev/null +++ b/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.Package.csproj @@ -0,0 +1,21 @@ + + + + + + $(NetRoslynSourceBuild) + + + true + true + Microsoft.CodeAnalysis.BuildClient + false + + Package containing sources of Microsoft .NET Compiler Platform ("Roslyn") build client API. For internal use only. + Relying on APIs from this package is explicitly not supported, they can and will break on a regular basis. + + + + + + diff --git a/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.targets b/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.targets new file mode 100644 index 0000000000000..d98ead6380e82 --- /dev/null +++ b/src/NuGet/Microsoft.CodeAnalysis.BuildClient.Package/Microsoft.CodeAnalysis.BuildClient.targets @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/Tools/Replay/Replay.csproj b/src/Tools/Replay/Replay.csproj index 519b8cf1b36ef..180c31962b9f3 100644 --- a/src/Tools/Replay/Replay.csproj +++ b/src/Tools/Replay/Replay.csproj @@ -7,16 +7,6 @@ - - - - - - - - - - csc @@ -41,4 +31,5 @@ +