Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. #33510

Merged
merged 4 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
<ProjectReference Include="..\ref\CoreFx.Private.TestUtilities.csproj">
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj"/>
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj">
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
11 changes: 11 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,15 @@
<Message Text="DumpTargets> $(OutputPath), C=[$(Configuration)], CG=[$(ConfigurationGroup)], OG=[$(OSGroup)], TG=[$(TargetGroup)]" Importance="Low" />
</Target>

<!-- This target will be moved into buildtools. Checked in here for now to add validationand in order not to block buildtools ingestion. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, now arcade

<Target Name="ValidateExcludeCompileDesktop" AfterTargets="GetPackageDependencies" Inputs="%(Dependency.Identity);%(Dependency.TargetFramework)" Outputs="unused">
<PropertyGroup>
<_excludeCompile Condition="@(Dependency->WithMetadataValue('Exclude', 'Compile')->Count()) == @(Dependency->Count())">true</_excludeCompile>
</PropertyGroup>
<Error Text="Cannot have Exclude=Compile dependencies when targeting a desktop TFM. @(Dependency). You can exclude the reference asset in the package by setting the ExcludeReferenceAssets property to true in your project."
Condition="$([System.String]::Copy('%(Dependency.TargetFramework)').StartsWith('net4')) AND
'$(_excludeCompile)' == 'true' AND
'%(Dependency.Identity)' != '_._'" />
</Target>

</Project>
7 changes: 6 additions & 1 deletion src/System.IO.Pipelines/pkg/System.IO.Pipelines.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
<SupportedFramework>net461;netcoreapp2.0;$(UAPvNextTFM);$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.IO.Pipelines.csproj" />
<HarvestIncludePaths Include="ref/netstandard1.3;lib/netstandard1.3" />
<HarvestIncludePaths Include="lib/netstandard1.3" />
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
<ProjectReference Include="..\ref\System.Net.Http.WinHttpHandler.csproj">
<SupportedFramework>net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Net.Http.WinHttpHandler.csproj" />
<ProjectReference Include="..\src\System.Net.Http.WinHttpHandler.csproj">
<SupportedFramework>net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<HarvestIncludePaths Include="lib/net46;runtimes/win/lib/net46" />
<HarvestIncludePaths Include="ref/netstandard1.3">
<SupportedFramework>netcore50</SupportedFramework>
</HarvestIncludePaths>
<HarvestIncludePaths Include="runtimes/win/lib/netstandard1.3;lib/netstandard1.3" />
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ProjectReference>
<ProjectReference Include="..\src\System.Text.Encoding.CodePages.csproj" />
<HarvestIncludePaths Include="lib/net46" />
<HarvestIncludePaths Include="ref/netstandard1.3;runtimes/win/lib/netstandard1.3;lib/netstandard1.3" />
<HarvestIncludePaths Include="runtimes/win/lib/netstandard1.3;lib/netstandard1.3" />
</ItemGroup>
<ItemGroup>
<InboxOnTargetFramework Include="MonoAndroid10" />
Expand All @@ -26,5 +26,10 @@
<Value>.NETCoreApp;UAP</Value>
</ValidatePackageSuppression>
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
therefore it cannot reference NETStandard.Library -->
<SuppressMetaPackage Include="NETStandard.Library" />
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>