Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add netcoreapp3.0 ref to System.IO.Pipelines package #38731

Merged
merged 4 commits into from
Jun 21, 2019
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
3 changes: 3 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<Message Text="Generated reference assembly source code: $(_RefSourceFileOutputPath)" />
</Target>

<!-- Import Packaging targets -->
<Import Project="$(RepositoryEngineeringDir)Packaging.targets" />

<Import Project="$(RepositoryEngineeringDir)DisableSourceControlManagement.targets" Condition="'$(EnableSourceLink)' == 'false'" />

<!-- Define this now until we can clean-up targets that depend on it in the packaging targets -->
Expand Down
25 changes: 25 additions & 0 deletions eng/Packaging.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project>
<!-- There are some packages where we require only one ref for a specific framework to be present. In order to avoid problems with this package when targetting
dektop with RAR we will make sure there are no exclude=compile references in the package.
For more info, please check issues:
- https://github.com/dotnet/corefx/issues/32457 -> Why reference assets were removed from the package
- https://github.com/aspnet/AspNetCore/issues/11206 -> Why ASP.NET required a ref to be added back for netcoreapp
- https://github.com/dotnet/corefx/issues/38729 -> Issue tracking to work of readding a ref to netcoreapp -->
<Target Name="RemoveExcludeCompileFromPackageDependencies" Condition="'$(RemoveExcludeCompileFromPackageDependencies)' == 'true'" DependsOnTargets="GetPackageDependencies" BeforeTargets="ValidateExcludeCompileDesktop">
<ItemGroup>
<Dependency>
<Exclude></Exclude>
</Dependency>
</ItemGroup>
</Target>

<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>
11 changes: 0 additions & 11 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,4 @@
<Target Name="GetDocumentationFile"
Returns="$(DocumentationFile)"/>

<!-- 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>
10 changes: 5 additions & 5 deletions src/System.IO.Pipelines/pkg/System.IO.Pipelines.pkgproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
<PropertyGroup>
<!-- This package is part of the ASP.NET Targeting pack so we require a netcoreapp ref in the package.
In order to avoid problems with RAR when targeting desktop, we remove all exclude=compile from package dependencies. -->
<RemoveExcludeCompileFromPackageDependencies>true</RemoveExcludeCompileFromPackageDependencies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ref\System.IO.Pipelines.csproj">
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.IO.Pipelines.csproj" />
<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>
3 changes: 3 additions & 0 deletions src/System.IO.Pipelines/ref/System.IO.Pipelines.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<PropertyGroup>
<ProjectGuid>{9C524CA0-92FF-437B-B568-BCE8A794A69A}</ProjectGuid>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
<!-- We only plan to use this ref in netcoreapp. For all other netstandard compatible frameworks we should use the lib
asset instead. -->
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard'">netcoreapp2.0</PackageTargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.IO.Pipelines.cs" />
Expand Down