forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Framework compilers package for SDK consumption
This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - dotnet#61252 - dotnet/msbuild#7832 The package verification
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...icrosoft.Net.Compilers.Toolset/Framework/Microsoft.Net.Compilers.Framework.Package.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net472</TargetFramework> | ||
|
||
<IsPackable>true</IsPackable> | ||
<NuspecPackageId>Microsoft.Net.Compilers.Framework</NuspecPackageId> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<PackageDescription> | ||
.NET Framework Compilers Toolset Package | ||
|
||
Referencing this package will cause the project to be built using the C# and Visual Basic framework compilers contained in the package, as opposed to the version installed with MSBuild. | ||
|
||
This package is an implementation detail of a .NET SDK feature. Directly referencing this package is not supported. | ||
|
||
$(RoslynPackageDescriptionDetails) | ||
</PackageDescription> | ||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_GetFilesToPackage</TargetsForTfmSpecificContentInPackage> | ||
<!-- Remove NU5128 once https://github.com/NuGet/Home/issues/8583 is fixed --> | ||
<NoWarn>$(NoWarn);NU5100;NU5128</NoWarn> | ||
|
||
<_DependsOn>InitializeDesktopCompilerArtifacts</_DependsOn> | ||
<_DependsOn Condition="'$(TargetFramework)' == 'net6.0'">InitializeCoreClrCompilerArtifacts</_DependsOn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\Compilers\CSharp\csc\AnyCpu\csc.csproj" PrivateAssets="All"/> | ||
<ProjectReference Include="..\..\..\Compilers\VisualBasic\vbc\AnyCpu\vbc.csproj" PrivateAssets="All"/> | ||
<ProjectReference Include="..\..\..\Interactive\csi\csi.csproj" PrivateAssets="All"/> | ||
<ProjectReference Include="..\..\..\Compilers\Core\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.csproj" PrivateAssets="All"/> | ||
<ProjectReference Include="..\..\..\Compilers\Server\VBCSCompiler\AnyCpu\VBCSCompiler.csproj" PrivateAssets="All"/> | ||
</ItemGroup> | ||
|
||
<Target Name="_GetFilesToPackage" DependsOnTargets="$(_DependsOn)"> | ||
<ItemGroup> | ||
<_File Include="@(DesktopCompilerArtifact)" TargetDir="tasks/net472"/> | ||
<_File Include="@(DesktopCompilerResourceArtifact)" TargetDir="tasks/net472"/> | ||
<_File Include="$(MSBuildProjectDirectory)\build\**\*.*" Condition="'$(TargetFramework)' == 'net472'" TargetDir="build" /> | ||
<_File Include="$(MSBuildProjectDirectory)\buildMultiTargeting\**\*.*" Condition="'$(TargetFramework)' == 'net472'" TargetDir="buildMultiTargeting" /> | ||
|
||
<TfmSpecificPackageFile Include="@(_File)" PackagePath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Import Project="..\DesktopCompilerArtifacts.targets" /> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
...t/Microsoft.Net.Compilers.Toolset/Framework/build/Microsoft.Net.Compilers.Framework.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<_RoslynTargetDirectoryName>net472</_RoslynTargetDirectoryName> | ||
<_RoslynTasksDirectory>$(MSBuildThisFileDirectory)..\tasks\$(_RoslynTargetDirectoryName)\</_RoslynTasksDirectory> | ||
<RoslynTasksAssembly>$(_RoslynTasksDirectory)Microsoft.Build.Tasks.CodeAnalysis.dll</RoslynTasksAssembly> | ||
<UseSharedCompilation Condition="'$(UseSharedCompilation)' == ''">true</UseSharedCompilation> | ||
<CSharpCoreTargetsPath>$(_RoslynTasksDirectory)Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath> | ||
<VisualBasicCoreTargetsPath>$(_RoslynTasksDirectory)Microsoft.VisualBasic.Core.targets</VisualBasicCoreTargetsPath> | ||
</PropertyGroup> | ||
|
||
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Csc" AssemblyFile="$(RoslynTasksAssembly)" /> | ||
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Vbc" AssemblyFile="$(RoslynTasksAssembly)" /> | ||
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly" AssemblyFile="$(RoslynTasksAssembly)" /> | ||
</Project> |
4 changes: 4 additions & 0 deletions
4
...t.Compilers.Toolset/Framework/buildMultiTargeting/Microsoft.Net.Compilers.Framework.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. --> | ||
<Project> | ||
<Import Project="$(MSBuildThisFileDirectory)..\build\$(MSBuildThisFile)" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters