Skip to content

Commit

Permalink
Multitarget our msbuild task
Browse files Browse the repository at this point in the history
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 dotnet#24646
  • Loading branch information
jaredpar committed Mar 1, 2018
1 parent 535b71c commit d5eda94
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 64 deletions.
6 changes: 4 additions & 2 deletions build/config/SignToolData.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions build/scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Core/MSBuildTask/CopyRefAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override bool Execute()

if (File.Exists(DestinationPath))
{
Guid source;
var source = Guid.Empty;
try
{
source = ExtractMvid(SourcePath);
Expand Down
5 changes: 2 additions & 3 deletions src/Compilers/Core/MSBuildTask/ErrorString.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 2 additions & 19 deletions src/Compilers/Core/MSBuildTask/MSBuildTask.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<RootNamespace>Microsoft.CodeAnalysis.BuildTasks</RootNamespace>
<AssemblyName>Microsoft.Build.Tasks.CodeAnalysis</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFrameworks>$(RoslynPortableTargetFrameworks46)</TargetFrameworks>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
Expand Down Expand Up @@ -65,26 +66,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildFixedVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreFixedVersion)" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsVersion)" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="$(MicrosoftWin32PrimitivesVersion)" />
<PackageReference Include="System.AppContext" Version="$(SystemAppContextVersion)" />
<PackageReference Include="System.Console" Version="$(SystemConsoleVersion)" />
<PackageReference Include="System.Collections.Concurrent" Version="$(SystemCollectionsConcurrentVersion)" />
<PackageReference Include="System.Diagnostics.Process" Version="$(SystemDiagnosticsProcessVersion)" />
<PackageReference Include="System.Diagnostics.Tools" Version="$(SystemDiagnosticsToolsVersion)" />
<PackageReference Include="System.IO.FileSystem" Version="$(SystemIOFileSystemVersion)" />
<PackageReference Include="System.IO.FileSystem.DriveInfo" Version="$(SystemIOFileSystemDriveInfoVersion)" />
<PackageReference Include="System.IO.Pipes" Version="$(SystemIOPipesVersion)" />
<PackageReference Include="System.IO.Pipes.AccessControl" Version="$(SystemIOPipesAccessControlVersion)" />
<PackageReference Include="System.Linq" Version="$(SystemLinqVersion)" />
<PackageReference Include="System.Reflection" Version="$(SystemReflectionVersion)" />
<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlVersion)" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="$(SystemSecurityCryptographyAlgorithmsVersion)" />
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
<PackageReference Include="System.Text.Encoding" Version="$(SystemTextEncodingVersion)" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="$(SystemTextEncodingExtensionsVersion)" />
<PackageReference Include="System.Text.RegularExpressions" Version="$(SystemTextRegularExpressionsVersion)" />
<PackageReference Include="System.Threading.Thread" Version="$(SystemThreadingThreadVersion)" />
</ItemGroup>
<Import Project="..\CommandLine\CommandLine.projitems" Label="Shared" />
</Project>
1 change: 1 addition & 0 deletions src/Compilers/Extension/CompilerExtension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<AdditionalProperties>TargetFramework=net46</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\Core\Portable\CodeAnalysis.csproj">
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Shared/BuildServerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
33 changes: 15 additions & 18 deletions src/NuGet/Microsoft.CodeAnalysis.Build.Tasks.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,20 @@
$commitPathMessage$
</description>
<dependencies>
<group targetFramework="netstandard1.3">
<group targetFramework="net46">
<dependency id="Microsoft.CodeAnalysis.CSharp" version="[$version$]" />
<dependency id="Microsoft.Build" version="$MicrosoftBuildFixedVersion$" />
<dependency id="Microsoft.Build.Tasks.Core" version="$MicrosoftBuildTasksCoreFixedVersion$" />
<dependency id="System.Security.AccessControl" version="$SystemSecurityAccessControlVersion$" />
<dependency id="System.IO.Pipes.AccessControl" version="$SystemIOPipesAccessControlVersion$" />
</group>

<dependency id="System.AppContext" version="$SystemAppContextVersion$" />
<dependency id="System.Console" version="$SystemConsoleVersion$" />
<dependency id="System.Diagnostics.Process" version="$SystemDiagnosticsProcessVersion$" />
<dependency id="System.Diagnostics.Tools" version="$SystemDiagnosticsToolsVersion$"/>
<dependency id="System.IO.FileSystem" version="$SystemIOFileSystemVersion$"/>
<dependency id="System.IO.FileSystem.DriveInfo" version="$SystemIOFileSystemDriveInfoVersion$"/>
<dependency id="System.IO.Pipes" version="$SystemIOPipesVersion$" />
<group targetFramework="netcoreapp2.0">
<dependency id="Microsoft.CodeAnalysis.CSharp" version="[$version$]" />
<dependency id="Microsoft.Build" version="$MicrosoftBuildFixedVersion$" />
<dependency id="Microsoft.Build.Tasks.Core" version="$MicrosoftBuildTasksCoreFixedVersion$" />
<dependency id="System.Security.AccessControl" version="$SystemSecurityAccessControlVersion$" />
<dependency id="System.Security.Cryptography.Algorithms" version="$SystemSecurityCryptographyAlgorithmsVersion$"/>
<dependency id="System.Security.Principal.Windows" version="$SystemSecurityPrincipalWindowsVersion$" />
<dependency id="System.Text.Encoding" version="$SystemTextEncodingVersion$"/>
<dependency id="System.Text.Encoding.Extensions" version="$SystemTextEncodingExtensionsVersion$"/>
<dependency id="System.Text.RegularExpressions" version="$SystemTextRegularExpressionsVersion$"/>
<dependency id="System.Threading.Thread" version="$SystemThreadingThreadVersion$" />
<dependency id="System.IO.Pipes.AccessControl" version="$SystemIOPipesAccessControlVersion$" />
</group>
</dependencies>

Expand All @@ -52,10 +47,12 @@
</metadata>
<files>
<!-- Include PDB unless embedded into DLL -->
<file src="Dlls\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.dll" target="lib\netstandard1.3" />
<file src="Dlls\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.pdb*" target="lib\netstandard1.3" />
<file src="Dlls\MSBuildTask\Microsoft.CSharp.Core.targets" target="contentFiles\any\any" />
<file src="Dlls\MSBuildTask\Microsoft.VisualBasic.Core.targets" target="contentFiles\any\any" />
<file src="Dlls\MSBuildTask\netcoreapp2.0\Microsoft.Build.Tasks.CodeAnalysis.dll" target="lib\netcoreapp2.0" />
<file src="Dlls\MSBuildTask\netcoreapp2.0\Microsoft.Build.Tasks.CodeAnalysis.pdb*" target="lib\netcoreapp2.0" />
<file src="Dlls\MSBuildTask\net46\Microsoft.Build.Tasks.CodeAnalysis.dll" target="lib\net46" />
<file src="Dlls\MSBuildTask\net46\Microsoft.Build.Tasks.CodeAnalysis.pdb*" target="lib\net46" />
<file src="Dlls\MSBuildTask\net46\Microsoft.CSharp.Core.targets" target="contentFiles\any\any" />
<file src="Dlls\MSBuildTask\net46\Microsoft.VisualBasic.Core.targets" target="contentFiles\any\any" />
<file src="$thirdPartyNoticesPath$" target="" />
</files>
</package>
10 changes: 3 additions & 7 deletions src/NuGet/Microsoft.NETCore.Compilers.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@
<file src="$additionalFilesPath$/Microsoft.NETCore.Compilers.props" target="build" />

<!-- Targets and task files -->
<file src="Dlls/MSBuildTask/netstandard1.3/publish/Microsoft.Build.Tasks.CodeAnalysis.dll" target="tools" />
<file src="Dlls/MSbuildTask/netstandard1.3/publish/Microsoft.CSharp.Core.targets" target="tools" />
<file src="Dlls/MSbuildTask/netstandard1.3/publish/Microsoft.VisualBasic.Core.targets" target="tools" />
<!-- N.B.: The backslashes below cannot be replaced with forward slashes.
https://github.com/NuGet/Home/issues/3584 -->
<file src="Dlls\MSBuildTask\netstandard1.3\publish\System.*.dll" target="tools" />
<file src="Dlls\MSBuildTask\netstandard1.3\publish\runtimes\**" target="tools\runtimes" />
<file src="Dlls/MSBuildTask/netcoreapp2.0/Microsoft.Build.Tasks.CodeAnalysis.dll" target="tools" />
<file src="Dlls/MSbuildTask/netcoreapp2.0/Microsoft.CSharp.Core.targets" target="tools" />
<file src="Dlls/MSbuildTask/netcoreapp2.0/Microsoft.VisualBasic.Core.targets" target="tools" />

<!-- Compiler exe files -->
<file src="Dlls/CodeAnalysis/Microsoft.CodeAnalysis.dll" target="tools/bincore" />
Expand Down
6 changes: 3 additions & 3 deletions src/NuGet/Microsoft.Net.Compilers.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
<file src="Exes\vbc\net46\vbc.rsp" target="tools" />
<file src="Exes\VBCSCompiler\net46\VBCSCompiler.exe" target="tools" />
<file src="Exes\VBCSCompiler\net46\VBCSCompiler.exe.config" target="tools" />
<file src="Dlls\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.dll" target="tools" />
<file src="Dlls\MSbuildTask\Microsoft.CSharp.Core.targets" target="tools" />
<file src="Dlls\MSbuildTask\Microsoft.VisualBasic.Core.targets" target="tools" />
<file src="Dlls\MSBuildTask\net46\Microsoft.Build.Tasks.CodeAnalysis.dll" target="tools" />
<file src="Dlls\MSbuildTask\net46\Microsoft.CSharp.Core.targets" target="tools" />
<file src="Dlls\MSbuildTask\net46\Microsoft.VisualBasic.Core.targets" target="tools" />

<!-- The assemblies are not signed by us and any deployed copy can be used.
The Exes\Toolset directory specifically has all of the assemblies we need.
Expand Down
11 changes: 6 additions & 5 deletions src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb
Original file line number Diff line number Diff line change
Expand Up @@ -769,13 +769,14 @@ Public Class BuildDevDivInsertionFiles
Dim values = CType(element.Property("values").Value, JArray)
For Each item As String In values
Dim parent = Path.GetDirectoryName(item)
Dim name = Path.GetFileName(item)

' Don't add in the csc.exe or vbc.exe from the CoreCLR projects.
If parent.EndsWith("Core", comparison) Then
If parent.EndsWith("NetFX20", comparison) Then
Continue For
End If

If parent.EndsWith("NetFX20", comparison) Then
' Don't add in the netcoreapp2.0 version of DLL
if Path.GetFileName(parent) = "netcoreapp2.0" AndAlso name = "Microsoft.Build.Tasks.CodeAnalysis.dll" Then
Continue For
End If

Expand Down Expand Up @@ -821,8 +822,8 @@ Public Class BuildDevDivInsertionFiles
add("Dlls\CSharpResultProvider.Portable\Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider.vsdconfig")
add("Dlls\FunctionResolver\Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.vsdconfig")
add("Dlls\ServicesVisualStudio\Microsoft.VisualStudio.LanguageServices.vsdconfig")
add("Dlls\MSBuildTask\Microsoft.CSharp.Core.targets")
add("Dlls\MSBuildTask\Microsoft.VisualBasic.Core.targets")
add("Dlls\MSBuildTask\net46\Microsoft.CSharp.Core.targets")
add("Dlls\MSBuildTask\net46\Microsoft.VisualBasic.Core.targets")
add("Dlls\CSharpCompilerTestUtilities\Roslyn.Compilers.CSharp.Test.Utilities.dll")
add("Dlls\BasicCompilerTestUtilities\Roslyn.Compilers.VisualBasic.Test.Utilities.dll")
add("Dlls\CompilerTestResources\\Roslyn.Compilers.Test.Resources.dll")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ folder InstallDir:\MSBuild\15.0\Bin\Roslyn
file source=$(OutputPath)\Exes\csi\net46\csi.rsp
file source=$(OutputPath)\Exes\vbc\net46\vbc.rsp

file source=$(OutputPath)\Dlls\MSBuildTask\Microsoft.VisualBasic.Core.targets
file source=$(OutputPath)\Dlls\MSBuildTask\Microsoft.CSharp.Core.targets
file source=$(OutputPath)\Dlls\MSBuildTask\net46\Microsoft.VisualBasic.Core.targets
file source=$(OutputPath)\Dlls\MSBuildTask\net46\Microsoft.CSharp.Core.targets

file source=$(OutputPath)\Dlls\Scripting\Microsoft.CodeAnalysis.Scripting.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\CSharpScripting\Microsoft.CodeAnalysis.CSharp.Scripting.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\CSharpCodeAnalysis\Microsoft.CodeAnalysis.CSharp.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\MSBuildTask\net46\Microsoft.Build.Tasks.CodeAnalysis.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\BasicCodeAnalysis\Microsoft.CodeAnalysis.VisualBasic.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Dlls\CodeAnalysis\Microsoft.CodeAnalysis.dll vs.file.ngenArchitecture=all
file source=$(OutputPath)\Vsix\CompilerExtension\System.Collections.Immutable.dll vs.file.ngenArchitecture=all
Expand Down

0 comments on commit d5eda94

Please sign in to comment.