Add flag to exclude MSBuild runtime libraries (#327)

This commit is contained in:
Taylor Southwick 2021-03-09 13:57:38 -08:00 коммит произвёл GitHub
Родитель ae478dc1d5
Коммит 9ab5255e05
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -13,7 +13,13 @@
<Compile Include="$(MSBuildThisFileDirectory)/shared/**/*.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
<PropertyGroup>
<ExcludeMSBuildRuntime Condition=" '$(ExcludeMSBuildRuntime)' =='' ">false</ExcludeMSBuildRuntime>
</PropertyGroup>
<!-- This forces the MSBuild runtime assets to be excluded from build. We have this opt-in because
otherwise it will add these as dependencies to all projects. -->
<ItemGroup Condition="$(ExcludeMSBuildRuntime)">
<!-- Exclude MSBuild runtime assets from both src and test projects
as they shouldn't be present in this solution's output paths.
Instead, these dependencies should be loaded from the selected

Просмотреть файл

@ -10,6 +10,7 @@
<PackageId>upgrade-assistant</PackageId>
<PackageIcon>icon.png</PackageIcon>
<InstallTools>true</InstallTools>
<ExcludeMSBuildRuntime>true</ExcludeMSBuildRuntime>
</PropertyGroup>
<ItemGroup>
<Content Include="appsettings.json">

Просмотреть файл

@ -5,6 +5,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build" ExcludeAssets="runtime" />
<PackageReference Include="NuGet.ProjectModel" ExcludeAssets="runtime" />
<PackageReference Include="NuGet.Frameworks" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
<PackageReference Include="Microsoft.Extensions.Options" />
@ -13,7 +14,6 @@
<!-- This package is mostly COM definitions which can be loaded in .NET 5 runtime just fine -->
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="NuGet.Frameworks" ExcludeAssets="runtime" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\Microsoft.DotNet.UpgradeAssistant.Abstractions\Microsoft.DotNet.UpgradeAssistant.Abstractions.csproj" />

Просмотреть файл

@ -4,6 +4,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
<ExcludeMSBuildRuntime>true</ExcludeMSBuildRuntime>
</PropertyGroup>
<ItemGroup>
<Compile Remove="assets\**" />
@ -14,7 +15,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" />
<PackageReference Include="Microsoft.CodeAnalysis" />
<PackageReference Include="Microsoft.Build.Locator" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" />

Просмотреть файл

@ -4,6 +4,7 @@
<IsPackable>false</IsPackable>
<IsUnitTestProject>true</IsUnitTestProject>
<InstallTools>true</InstallTools>
<ExcludeMSBuildRuntime>true</ExcludeMSBuildRuntime>
</PropertyGroup>
<ItemGroup>
<Compile Remove="IntegrationScenarios\**" />