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

Commit f14366b

Browse files
authored
Fix compat pack dependencies to be live pre-release and harvest System.Buffers ref to previously shipped version (#28428)
* Break netcoreapp20 build configuration from System.Buffers * Build buffers with inbox frameworks using placeholders * Update Compatibility pack System.Security.Cryptography.Cng to live prerelease dependency * Update Compatibility Validation project and script to be able to restore for 2.1 and to include ASP.NET for ApiCatalog * Merge conflicts and fix configurations to have ref harvested for all configurations * Add netfx configuration to ref project for netfx vertical * Remove not necessary build configurations * PR Feedback
1 parent 906f2d1 commit f14366b

File tree

10 files changed

+75
-78
lines changed

10 files changed

+75
-78
lines changed

external/runtime/Configurations.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<BuildConfigurations>
55
netcoreapp-Windows_NT;
66
netcoreapp-Unix;
7-
netcoreapp2.0-Windows_NT;
8-
netcoreapp2.0-Unix;
97
uap10.0.16299aot;
108
uap;
119
uapaot;

external/runtime/runtime.depproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<PropertyGroup>
55
<NugetRuntimeIdentifier>$(PackageRID)</NugetRuntimeIdentifier>
66
<RidSpecificAssets>true</RidSpecificAssets>
7-
<CoreClrPackageVersion Condition="'$(TargetGroup)' == 'netcoreapp2.0'">2.0.0</CoreClrPackageVersion>
87
<NoWarn>$(NoWarn);NU1603;NU1605</NoWarn>
98
</PropertyGroup>
109
<PropertyGroup Condition="'$(TargetGroup)' == 'uapaot' Or '$(TargetGroup)' == 'uap10.0.16299aot'">

pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.pkgproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
</PropertyGroup>
99

1010
<ItemDefinitionGroup>
11-
<LibraryPackage>
12-
<Version>4.4.0</Version>
13-
</LibraryPackage>
1411
<PrereleaseLibraryPackage>
1512
<Version>4.5.0</Version>
1613
</PrereleaseLibraryPackage>
@@ -29,6 +26,7 @@
2926
<PrereleaseLibraryPackage Include="System.Configuration.ConfigurationManager" />
3027
<PrereleaseLibraryPackage Include="System.Data.Odbc" />
3128
<PrereleaseLibraryPackage Include="System.Data.DataSetExtensions" />
29+
<PrereleaseLibraryPackage Include="System.Data.SqlClient" />
3230
<PrereleaseLibraryPackage Include="System.Drawing.Common" />
3331
<PrereleaseLibraryPackage Include="System.Diagnostics.EventLog" />
3432
<PrereleaseLibraryPackage Include="System.Diagnostics.PerformanceCounter" />
@@ -42,6 +40,7 @@
4240
<PrereleaseLibraryPackage Include="System.Management" />
4341
<PrereleaseLibraryPackage Include="System.Runtime.Caching" />
4442
<PrereleaseLibraryPackage Include="System.Security.AccessControl" />
43+
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Cng" />
4544
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Pkcs" />
4645
<PrereleaseLibraryPackage Include="System.Security.Cryptography.ProtectedData" />
4746
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Xml" />
@@ -68,10 +67,6 @@
6867
<LibraryPackage Include="System.ServiceModel.Security">
6968
<Version>$(ServiceModelVersion)</Version>
7069
</LibraryPackage>
71-
72-
<!-- Stable packages shipped already for netcoreapp2.0 -->
73-
<LibraryPackage Include="System.Data.SqlClient" />
74-
<LibraryPackage Include="System.Security.Cryptography.Cng" />
7570
</ItemGroup>
7671

7772
<ItemGroup>
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<DisableImplicitFrameworkReferences Condition="'$(TargetFramework)' == 'netcoreapp2.0'">true</DisableImplicitFrameworkReferences>
4-
<PreserveCompilationContext>true</PreserveCompilationContext>
3+
<PreserveCompilationContext>true</PreserveCompilationContext>
4+
<PackageConflictPreferredPackages Condition="'$(TargetFramework)' != 'netcoreapp2.0'">Microsoft.Private.CoreFx.NETCoreApp;runtime.$(RID).Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages)</PackageConflictPreferredPackages>
5+
<DisableImplicitFrameworkReferences Condition="$(TargetFramework.Contains('netcoreapp'))">true</DisableImplicitFrameworkReferences>
56
</PropertyGroup>
67

78
<ItemGroup>
89
<PackageReference Include="Microsoft.Windows.Compatibility" Version="$(CompatibilityPackageVersion)" />
9-
<PackageReference Condition="'$(TargetFramework)' == 'netcoreapp2.0'" Include="Microsoft.NETCore.App" Version="2.0.0" />
10+
</ItemGroup>
11+
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.0'">
12+
<PackageReference Include="Microsoft.Private.CoreFx.NETCoreApp" Version="$(PrivateCorefxPackageVersion)" />
13+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-*" />
14+
</ItemGroup>
15+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
16+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
17+
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0" />
1018
</ItemGroup>
1119
</Project>
Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName);
2-
$winRID = "win7-x64";
3-
$dotnetPath = -join($repoRoot, "\Tools\dotnetcli\dotnet.exe")
4-
$csprojPath = -join($PSScriptRoot, "\", (Get-ChildItem $PSScriptRoot"\*.csproj" | Select-Object -ExpandProperty Name))
5-
$packagesCachePath = -join($repoRoot, "\packages")
6-
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Debug\")
7-
$packageName = "Microsoft.Windows.Compatibility"
1+
param (
2+
$targetFramework = "netcoreapp2.1",
3+
$runtimeVersion = "2.1.0-*",
4+
$refDirName = "netcoreapp21_compat",
5+
$rid = "win7-x64"
6+
)
87

9-
if (!(Test-Path $localPackageSourcePath))
10-
{
11-
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Release\")
12-
if (!(Test-Path $localPackageSourcePath))
13-
{
14-
Write-Error -Message "Local package source must exist.";
15-
Exit;
16-
}
17-
}
18-
19-
function _getPackageVersion()
8+
function _getPackageVersion($packageName)
209
{
2110
$searchPattern = -join($localPackageSourcePath, $packageName, ".[0-9].[0-9].[0-9]*.nupkg")
2211
if (!(Test-Path $searchPattern))
2312
{
24-
Write-Error -Message (-join("Didn't find package: Microsoft.Windows.Compatibility in source: ", $localPackageSourcePath, " please run build -allConfigurations"))
13+
Write-Error -Message (-join("Didn't find package: ", $packageName, " in source: ", $localPackageSourcePath, " please run build -allConfigurations"))
2514
Exit;
2615
}
2716

@@ -34,32 +23,46 @@ function _getPackageVersion()
3423
return $matches[0]
3524
}
3625

37-
function _restoreAndPublish($targetFramework, $rid, $runtimeFramework, $refDirName)
26+
$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName);
27+
$dotnetPath = -join($repoRoot, "\Tools\dotnetcli\dotnet.exe")
28+
$csprojPath = -join($PSScriptRoot, "\", (Get-ChildItem $PSScriptRoot"\*.csproj" | Select-Object -ExpandProperty Name))
29+
$packagesCachePath = -join($repoRoot, "\packages")
30+
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Debug\")
31+
$restoreSources = -join("https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;https://api.nuget.org/v3/index.json;https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;", $localPackageSourcePath)
32+
33+
if (!(Test-Path $localPackageSourcePath))
3834
{
39-
$packageVersion = _getPackageVersion
40-
& $dotnetPath restore --packages $packagesCachePath /p:RestoreSources="https://api.nuget.org/v3/index.json;$localPackageSourcePath" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$packageVersion $csprojPath
41-
& $dotnetPath publish -r $rid /p:RestoreSources="https://api.nuget.org/v3/index.json;$localPackageSourcePath" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$packageVersion /p:RuntimeFrameworkVersion=$runtimeFramework $csprojPath
35+
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Release\")
36+
if (!(Test-Path $localPackageSourcePath))
37+
{
38+
Write-Error -Message "Local package source must exist.";
39+
Exit;
40+
}
41+
}
4242

43-
$outputPath = -join($PSScriptRoot, "\bin\Debug\", $targetFramework, "\", $rid, "\publish\refs\")
43+
$compatPackageVersion = _getPackageVersion "Microsoft.Windows.Compatibility"
44+
$privatePackageVersion = _getPackageVersion "Microsoft.Private.CoreFx.NETCoreApp"
4445

45-
if (!(Test-Path $outputPath))
46-
{
47-
Write-Error -Message (-join("There was an error while publishing for framework: ", $targetFramework))
48-
Exit;
49-
}
46+
& $dotnetPath restore --packages $packagesCachePath /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RID=$rid $csprojPath
5047

51-
Write-Output (-join("Published succedded for: ", $targetFramework))
52-
53-
$refPath = -join($repoRoot, "\bin\ref\", $refDirName)
48+
& $dotnetPath publish -r $rid /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:RuntimeFrameworkVersion=$runtimeFramework /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RID=$rid $csprojPath
5449

55-
if (Test-Path $refPath)
56-
{
57-
Remove-Item $refPath -r -force
58-
}
50+
$outputPath = -join($PSScriptRoot, "\bin\Debug\", $targetFramework, "\", $rid, "\publish\refs\")
5951

60-
New-Item $refPath -ItemType directory
61-
Copy-Item (-join($outputPath, "*")) $refPath
52+
if (!(Test-Path $outputPath))
53+
{
54+
Write-Error -Message (-join("There was an error while publishing for framework: ", $targetFramework))
55+
Exit;
56+
}
57+
58+
Write-Output (-join("Published succedded for: ", $targetFramework))
59+
60+
$refPath = -join($repoRoot, "\bin\ref\", $refDirName)
61+
62+
if (Test-Path $refPath)
63+
{
64+
Remove-Item $refPath -r -force
6265
}
6366

64-
_restoreAndPublish "netcoreapp2.0" $winRID "2.0.0" "netcoreapp20_compat"
65-
_restoreAndPublish "netstandard2.0" $winRID "2.0.0" "netstandard20_compat"
67+
New-Item $refPath -ItemType directory
68+
Copy-Item (-join($outputPath, "*")) $refPath

src/System.Buffers/pkg/System.Buffers.pkgproj

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<ItemGroup>
5+
<HarvestIncludePath Include="ref\netstandard1.1;ref\netstandard2.0">
6+
<SupportedFramework>netcore45;netcoreapp1.0;wpa81;$(AllXamarinFrameworks)</SupportedFramework>
7+
</HarvestIncludePath>
58
<ProjectReference Include="..\ref\System.Buffers.csproj">
6-
<SupportedFramework>net45;netcore45;netcoreapp1.0;wpa81;$(AllXamarinFrameworks)</SupportedFramework>
9+
<SupportedFramework>net45</SupportedFramework>
710
</ProjectReference>
811
<ProjectReference Include="..\src\System.Buffers.csproj" />
912

1013
<!-- this package is part of the implementation closure of NETStandard.Library
1114
therefore it cannot reference NETStandard.Library -->
1215
<SuppressMetaPackage Include="NETStandard.Library" />
1316

14-
<!-- Since UAP and .NETCoreApp are package based we still want to enable
15-
OOBing libraries that happen to overlap with their framework package.
16-
This avoids us having to lock the API in our NuGet packages just
17-
to match what shipped inbox: since we can provide a new library
18-
we can update it to add API without raising the netstandard version. -->
19-
<ValidatePackageSuppression Include="TreatAsOutOfBox">
20-
<Value>.NETCoreApp;UAP</Value>
21-
</ValidatePackageSuppression>
17+
<InboxOnTargetFramework Include="netcoreapp2.0" />
18+
<InboxOnTargetFramework Include="uap10.0.16299" />
2219
</ItemGroup>
2320
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
2421
</Project>

src/System.Buffers/ref/Configurations.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<PackageConfigurations>
55
netstandard;
66
netstandard1.1;
7-
uap10.0.16299;
7+
net45;
88
</PackageConfigurations>
99
<BuildConfigurations>
1010
$(PackageConfigurations);
1111
uap;
12+
netfx;
1213
</BuildConfigurations>
1314
</PropertyGroup>
1415
</Project>

src/System.Buffers/ref/System.Buffers.csproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<PropertyGroup>
55
<ProjectGuid>{11AE73F7-3532-47B9-8FF6-B4F22D76456C}</ProjectGuid>
6+
<!-- Must match version supported by frameworks which support 4.0.* inbox.
7+
Can be removed when API is added and this assembly is versioned to 4.1.* -->
8+
<AssemblyVersion Condition="'$(TargetsNetFx)' != 'true'">4.0.2.0</AssemblyVersion>
69
</PropertyGroup>
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Debug|AnyCPU'" />
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Release|AnyCPU'" />
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
714
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
815
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
916
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Debug|AnyCPU'" />
1017
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Release|AnyCPU'" />
11-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Debug|AnyCPU'" />
12-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Release|AnyCPU'" />
1318
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
1419
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
1520
<ItemGroup>
@@ -21,5 +26,8 @@
2126
<ItemGroup Condition="'$(TargetGroup)' == 'uap'">
2227
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
2328
</ItemGroup>
29+
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
30+
<Reference Include="mscorlib" />
31+
</ItemGroup>
2432
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
25-
</Project>
33+
</Project>

src/System.Buffers/src/Configurations.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
<PackageConfigurations>
55
netstandard1.1;
66
netstandard;
7-
netcoreapp2.0-Windows_NT;
8-
netcoreapp2.0-Unix;
9-
uap10.0.16299-Windows_NT;
10-
uap10.0.16299aot-Windows_NT;
117
</PackageConfigurations>
128
<BuildConfigurations>
139
$(PackageConfigurations);

src/System.Buffers/src/System.Buffers.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
1313
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
1414
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
15-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Unix-Debug|AnyCPU'" />
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Unix-Release|AnyCPU'" />
17-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Debug|AnyCPU'" />
18-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Release|AnyCPU'" />
1915
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
2016
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
2117
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Debug|AnyCPU'" />
@@ -24,10 +20,6 @@
2420
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
2521
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
2622
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
27-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Windows_NT-Debug|AnyCPU'" />
28-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Windows_NT-Release|AnyCPU'" />
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299aot-Windows_NT-Debug|AnyCPU'" />
30-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299aot-Windows_NT-Release|AnyCPU'" />
3123
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
3224
<Compile Include="System\Buffers\ArrayPool.cs" />
3325
<Compile Include="System\Buffers\ArrayPoolEventSource.cs" />

0 commit comments

Comments
 (0)