Skip to content

Commit

Permalink
Adding net461 target to Microsoft.Bcl.* packages (dotnet/corefx#38104)
Browse files Browse the repository at this point in the history
* Adding net461 target to Microsoft.Bcl.* packages

* Adding System.Text.Json net461 target as well


Commit migrated from dotnet/corefx@fdab38c
  • Loading branch information
joperezr authored May 31, 2019
1 parent e7178b2 commit dcdbef7
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 25 deletions.
7 changes: 7 additions & 0 deletions eng/depProj.targets
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ See the LICENSE file in the project root for more information.
<!-- Required by Common.Targets but not used for depproj -->
<Target Name="CreateManifestResourceNames" />

<Target Name="RemoveFrameworkReferences"
AfterTargets="ResolvePackageAssets">
<ItemGroup>
<ResolvedFrameworkAssemblies Remove="@(ResolvedFrameworkAssemblies)" Condition="'%(ResolvedFrameworkAssemblies.NuGetIsFrameworkReference)' == 'true'" />
</ItemGroup>
</Target>

<!-- Support filtering to a subset of packages or files -->
<Target Name="FilterNugetPackages"
BeforeTargets="ResolveAssemblyReferences"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
netstandard2.1;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{6371299B-8F39-4A0A-A9CD-70F80FF205F6}</ProjectGuid>
<Configurations>netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<Configurations>net461-Debug;net461-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
</PropertyGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' OR '$(TargetsNetFx)' == 'true'">
<Compile Include="Microsoft.Bcl.AsyncInterfaces.cs" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard' AND '$(TargetsNetFx)' != 'true'">
<Compile Include="Microsoft.Bcl.AsyncInterfaces.Forwards.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="netstandard" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
netstandard2.1;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<ProjectGuid>{96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}</ProjectGuid>
<Configurations>netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' != 'netstandard'">true</IsPartialFacadeAssembly>
<Configurations>net461-Debug;net461-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' != 'netstandard' AND '$(TargetsNetFx)' != 'true'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
<Compile Include="System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs" />
Expand Down Expand Up @@ -32,7 +32,9 @@
<Link>ProductionCode\System.Runtime\src\System\Runtime\CompilerServices\EnumeratorCancellationAttribute.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' OR '$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Tasks.Extensions" />
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/Microsoft.Bcl.HashCode/ref/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
netstandard;
netstandard2.1;
netcoreapp2.1;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netcoreapp;
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<ProjectGuid>{96AA2060-C846-4E56-9509-E8CB9C114C8F}</ProjectGuid>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netcoreapp2.1-Debug;netcoreapp2.1-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<Configurations>net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp2.1-Debug;netcoreapp2.1-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetsNetFx)' == 'true'">
<Compile Include="Microsoft.Bcl.HashCode.cs" />
<Reference Include="mscorlib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0' AND '$(TargetsNetFx)' != 'true'">
<Compile Include="Microsoft.Bcl.HashCode.Forwards.cs" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" Condition="'$(TargetGroup)' == 'netcoreapp'" />
<Reference Include="System.Runtime" Condition="'$(TargetGroup)' != 'netcoreapp'" />
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/Microsoft.Bcl.HashCode/src/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
netstandard;
netstandard2.1;
netcoreapp2.1;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netcoreapp;
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<ProjectGuid>{B77D0212-D53C-4F7F-8CEC-2E067AC6FCAB}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' != 'netstandard2.0'">true</IsPartialFacadeAssembly>
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' != 'netstandard2.0' AND '$(TargetsNetFx)' != 'true'">true</IsPartialFacadeAssembly>
<OmitResources>$(IsPartialFacadeAssembly)</OmitResources>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netcoreapp2.1-Debug;netcoreapp2.1-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<Configurations>net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp2.1-Debug;netcoreapp2.1-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
Expand All @@ -13,6 +13,8 @@
</Compile>
<Compile Include="BitOperations.cs" />
<Compile Include="Interop.GetRandomBytes.cs" />
<Reference Include="mscorlib" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true' AND '$(TargetGroup)' != 'netstandard2.1'">
<Reference Include="System.Runtime" />
Expand Down
9 changes: 8 additions & 1 deletion src/libraries/System.Text.Json/pkg/System.Text.Json.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<ProjectReference Include="..\ref\System.Text.Json.csproj">
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Text.Json.csproj" />
<ProjectReference Include="..\src\System.Text.Json.csproj">
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<!-- Since UAP and .NETCoreApp are package based we still want to enable
OOBing libraries that happen to overlap with their framework package.
This avoids us having to lock the API in our NuGet packages just
Expand All @@ -14,5 +16,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>
2 changes: 2 additions & 0 deletions src/libraries/System.Text.Json/ref/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<PropertyGroup>
<PackageConfigurations>
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations)
netcoreapp;
uap;
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
8 changes: 5 additions & 3 deletions src/libraries/System.Text.Json/ref/System.Text.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{9F155052-2DDE-4DBD-9F31-ADB45C9FE628}</ProjectGuid>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
<Configurations>net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Text.Json.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard' AND '$(TargetsNetFx)' != 'true'">
<Compile Include="System.Text.Json.Manual.cs" />
<ProjectReference Include="..\..\System.Memory\ref\System.Memory.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' OR '$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="netstandard" />
<Reference Include="System.Memory" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion src/libraries/System.Text.Json/src/Configurations.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
netcoreapp;
uap-Windows_NT;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
16 changes: 11 additions & 5 deletions src/libraries/System.Text.Json/src/System.Text.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<AssemblyName>System.Text.Json</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<Configurations>net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<!-- For the inbox library (that is shipping with the product), this should always be true. -->
<!-- BUILDING_INBOX_LIBRARY is only false when building the netstandard compatible NuGet package. -->
<DefineConstants Condition="'$(TargetsNETStandard)' != 'true'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants>
<DefineConstants Condition="'$(TargetsNETStandard)' != 'true' AND '$(TargetsNetFx)' != 'true'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants>
<DefineConstants Condition="'$(TargetsNetFx)' == 'true'">$(DefineConstants);netstandard</DefineConstants>
<!-- Workaround for overriding the XML comments related warnings that are being supressed repo wide (within arcade): -->
<!-- https://github.com/dotnet/arcade/blob/ea6addfdc65e5df1b2c036f11614a5f922e36267/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props#L90 -->
<!-- For this project, we want warnings if there are public APIs/types without properly formatted XML comments (particularly CS1591). -->
Expand Down Expand Up @@ -152,13 +153,18 @@
<Compile Include="System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs" />
<Compile Include="System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNETStandard)' == 'true'">
<ItemGroup Condition="'$(TargetsNETStandard)' == 'true' OR '$(TargetsNetFx)' == 'true'">
<!-- Common or Common-branched source files -->
<Compile Include="$(CommonPath)\System\Buffers\ArrayBufferWriter.cs">
<Link>Common\System\Buffers\ArrayBufferWriter.cs</Link>
</Compile>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNETStandard)' != 'true'">
<ItemGroup Condition="'$(TargetsNETStandard)' != 'true' AND '$(TargetsNetFx)' != 'true'">
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Reflection.Primitives" />
Expand All @@ -179,4 +185,4 @@
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<BinPlaceRuntime>true</BinPlaceRuntime>
<NETStandardVersion Condition="$(TargetFramework.StartsWith('netstandard'))">$(TargetFramework.SubString(11))</NETStandardVersion>
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<TargetsNetStandardLowerThan21 Condition="'$(TargetsNetStandard)' == 'true' AND '$(NETStandardVersion)' &lt; 2.1">true</TargetsNetStandardLowerThan21>
</PropertyGroup>

<!-- Ref binplacing for all configurations -->
Expand Down Expand Up @@ -32,7 +33,7 @@
<Version>4.5.3</Version>
</PackageReference>

<PackageReference Include="System.Numerics.Vectors" Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(TargetsNetStandard)' == 'true' AND '$(NETStandardVersion)' &lt; 2.1">
<PackageReference Include="System.Numerics.Vectors" Condition="'$(TargetsNetStandardLowerThan21)' == 'true' OR '$(TargetsNetfx)' == 'true'">
<Version>4.5.0</Version>
</PackageReference>

Expand Down
3 changes: 3 additions & 0 deletions src/libraries/external/netfx/netfx.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<PackageReference Include="System.Memory" Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46'">
<Version>4.5.2</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors" Condition="'$(TargetGroup)' == 'net461' OR '$(TargetGroup)' == 'netfx'">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="$(NETStandardSupportPackageId)" Condition="'$(AddNetStandardSupportPackage)' == 'true'">
<Version>$(NETStandardSupportPackageVersion)</Version>
</PackageReference>
Expand Down

0 comments on commit dcdbef7

Please sign in to comment.