From d5eda947e8ef8ca6adeb5a655e626918036816e0 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Mon, 5 Feb 2018 23:10:48 -0800 Subject: [PATCH] Multitarget our msbuild task Changes our task to multi-target between net46 and netcoreapp2.0. This matches how the rest of the SDK is deploying and makes for a smoother integration into CLI. context #24646 --- build/config/SignToolData.json | 6 ++-- build/scripts/build.ps1 | 3 +- .../Core/MSBuildTask/CopyRefAssembly.cs | 2 +- .../Core/MSBuildTask/ErrorString.Designer.cs | 5 ++- .../Core/MSBuildTask/MSBuildTask.csproj | 21 ++---------- .../Extension/CompilerExtension.csproj | 1 + src/Compilers/Shared/BuildServerConnection.cs | 2 +- .../Microsoft.CodeAnalysis.Build.Tasks.nuspec | 33 +++++++++---------- src/NuGet/Microsoft.NETCore.Compilers.nuspec | 10 ++---- src/NuGet/Microsoft.Net.Compilers.nuspec | 6 ++-- .../BuildDevDivInsertionFiles.vb | 11 ++++--- .../Microsoft.CodeAnalysis.Compilers.swr | 6 ++-- 12 files changed, 42 insertions(+), 64 deletions(-) diff --git a/build/config/SignToolData.json b/build/config/SignToolData.json index 61e2ea0efadf8..e4ea966a1a817 100644 --- a/build/config/SignToolData.json +++ b/build/config/SignToolData.json @@ -60,8 +60,10 @@ "Dlls\\InteractiveEditorFeatures\\Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll", "Dlls\\InteractiveEditorFeatures\\*\\Microsoft.CodeAnalysis.InteractiveEditorFeatures.resources.dll", "Dlls\\InteractiveFeatures\\Microsoft.CodeAnalysis.InteractiveFeatures.dll", - "Dlls\\MSBuildTask\\Microsoft.Build.Tasks.CodeAnalysis.dll", - "Dlls\\MSBuildTask\\*\\Microsoft.Build.Tasks.CodeAnalysis.resources.dll", + "Dlls\\MSBuildTask\\net46\\Microsoft.Build.Tasks.CodeAnalysis.dll", + "Dlls\\MSBuildTask\\net46\\*\\Microsoft.Build.Tasks.CodeAnalysis.resources.dll", + "Dlls\\MSBuildTask\\netcoreapp2.0\\Microsoft.Build.Tasks.CodeAnalysis.dll", + "Dlls\\MSBuildTask\\netcoreapp2.0\\*\\Microsoft.Build.Tasks.CodeAnalysis.resources.dll", "Dlls\\RemoteWorkspaces\\Microsoft.CodeAnalysis.Remote.Workspaces.dll", "Dlls\\Scripting\\Microsoft.CodeAnalysis.Scripting.dll", "Dlls\\Scripting\\*\\Microsoft.CodeAnalysis.Scripting.resources.dll", diff --git a/build/scripts/build.ps1 b/build/scripts/build.ps1 index 312e1c08ac46d..27a191f1f3b92 100644 --- a/build/scripts/build.ps1 +++ b/build/scripts/build.ps1 @@ -240,6 +240,7 @@ function Build-Artifacts() { # finish building these before we can run signing. function Build-ExtraSignArtifacts() { + Ensure-NuGet | Out-Null Push-Location (Join-Path $repoDir "src\Setup") try { # Publish the CoreClr projects (CscCore and VbcCore) and dependencies for later NuGet packaging. @@ -249,8 +250,6 @@ function Build-ExtraSignArtifacts() { Run-MSBuild "..\Compilers\VisualBasic\vbc\vbc.csproj" "/p:TargetFramework=netcoreapp2.0 /t:PublishWithoutBuilding" Write-Host "Publishing VBCSCompiler" Run-MSBuild "..\Compilers\Server\VBCSCompiler\VBCSCompiler.csproj" "/p:TargetFramework=netcoreapp2.0 /t:PublishWithoutBuilding" - Write-Host "Publishing MSBuildTask" - Run-MSBuild "..\Compilers\Core\MSBuildTask\MSBuildTask.csproj" "/p:TargetFramework=netstandard1.3 /t:PublishWithoutBuilding" $dest = @( $configDir) diff --git a/src/Compilers/Core/MSBuildTask/CopyRefAssembly.cs b/src/Compilers/Core/MSBuildTask/CopyRefAssembly.cs index 55995f06cbb94..13d8eef059494 100644 --- a/src/Compilers/Core/MSBuildTask/CopyRefAssembly.cs +++ b/src/Compilers/Core/MSBuildTask/CopyRefAssembly.cs @@ -40,7 +40,7 @@ public override bool Execute() if (File.Exists(DestinationPath)) { - Guid source; + var source = Guid.Empty; try { source = ExtractMvid(SourcePath); diff --git a/src/Compilers/Core/MSBuildTask/ErrorString.Designer.cs b/src/Compilers/Core/MSBuildTask/ErrorString.Designer.cs index d4db8b30d05b1..12862c5b224ba 100644 --- a/src/Compilers/Core/MSBuildTask/ErrorString.Designer.cs +++ b/src/Compilers/Core/MSBuildTask/ErrorString.Designer.cs @@ -10,7 +10,6 @@ namespace Microsoft.CodeAnalysis.BuildTasks { using System; - using System.Reflection; /// @@ -20,7 +19,7 @@ namespace Microsoft.CodeAnalysis.BuildTasks { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class ErrorString { @@ -40,7 +39,7 @@ internal ErrorString() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.BuildTasks.ErrorString", typeof(ErrorString).GetTypeInfo().Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.BuildTasks.ErrorString", typeof(ErrorString).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/Compilers/Core/MSBuildTask/MSBuildTask.csproj b/src/Compilers/Core/MSBuildTask/MSBuildTask.csproj index 91af17b8a8760..7d898b3f563a4 100644 --- a/src/Compilers/Core/MSBuildTask/MSBuildTask.csproj +++ b/src/Compilers/Core/MSBuildTask/MSBuildTask.csproj @@ -9,7 +9,8 @@ Microsoft.CodeAnalysis.BuildTasks Microsoft.Build.Tasks.CodeAnalysis en-US - netstandard1.3 + $(RoslynPortableTargetFrameworks46) + false @@ -65,26 +66,8 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Compilers/Extension/CompilerExtension.csproj b/src/Compilers/Extension/CompilerExtension.csproj index 81c08b04497d6..8573d07e6692c 100644 --- a/src/Compilers/Extension/CompilerExtension.csproj +++ b/src/Compilers/Extension/CompilerExtension.csproj @@ -100,6 +100,7 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems DebugSymbolsProjectOutputGroup%3b true + TargetFramework=net46 BuiltProjectOutputGroup diff --git a/src/Compilers/Shared/BuildServerConnection.cs b/src/Compilers/Shared/BuildServerConnection.cs index 5b3f735964b73..56dce3b524465 100644 --- a/src/Compilers/Shared/BuildServerConnection.cs +++ b/src/Compilers/Shared/BuildServerConnection.cs @@ -472,7 +472,7 @@ private static bool CheckPipeConnectionOwnership(NamedPipeClientStream pipeStrea } } -#if NETSTANDARD1_3 +#if NET46 internal static bool CheckIdentityUnix(PipeStream stream) { // Identity verification is unavailable in the MSBuild task, diff --git a/src/NuGet/Microsoft.CodeAnalysis.Build.Tasks.nuspec b/src/NuGet/Microsoft.CodeAnalysis.Build.Tasks.nuspec index 9d931f3ea4192..9e308e44500cb 100644 --- a/src/NuGet/Microsoft.CodeAnalysis.Build.Tasks.nuspec +++ b/src/NuGet/Microsoft.CodeAnalysis.Build.Tasks.nuspec @@ -14,25 +14,20 @@ $commitPathMessage$ - + + + + - - - - - - - + + + + - - - - - - + @@ -52,10 +47,12 @@ - - - - + + + + + + diff --git a/src/NuGet/Microsoft.NETCore.Compilers.nuspec b/src/NuGet/Microsoft.NETCore.Compilers.nuspec index ed7af1102796a..5a062fc794e94 100644 --- a/src/NuGet/Microsoft.NETCore.Compilers.nuspec +++ b/src/NuGet/Microsoft.NETCore.Compilers.nuspec @@ -26,13 +26,9 @@ - - - - - - + + + diff --git a/src/NuGet/Microsoft.Net.Compilers.nuspec b/src/NuGet/Microsoft.Net.Compilers.nuspec index 99d3169b3e76f..4623eae807055 100644 --- a/src/NuGet/Microsoft.Net.Compilers.nuspec +++ b/src/NuGet/Microsoft.Net.Compilers.nuspec @@ -49,9 +49,9 @@ - - - + + +