Skip to content

Commit

Permalink
Removing Reference assets from packages which contain runtime-specifi…
Browse files Browse the repository at this point in the history
…c dependencies when targeting Desktop. (dotnet/corefx#33510)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet/corefx#33254)

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

* Adding validation target to catch other instances of packages that need the property

* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.

* Update package index to contain the right versions

* Fixing packaging build errors


Commit migrated from dotnet/corefx@6832425
  • Loading branch information
joperezr authored Nov 16, 2018
1 parent 094e8aa commit def4a49
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 7 deletions.
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/libraries/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. -->
<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>
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>

0 comments on commit def4a49

Please sign in to comment.