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

Commit

Permalink
Fix compat pack dependencies to be live pre-release and harvest Syste…
Browse files Browse the repository at this point in the history
…m.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
  • Loading branch information
safern authored Mar 28, 2018
1 parent 906f2d1 commit f14366b
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 78 deletions.
2 changes: 0 additions & 2 deletions external/runtime/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<BuildConfigurations>
netcoreapp-Windows_NT;
netcoreapp-Unix;
netcoreapp2.0-Windows_NT;
netcoreapp2.0-Unix;
uap10.0.16299aot;
uap;
uapaot;
Expand Down
1 change: 0 additions & 1 deletion external/runtime/runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<PropertyGroup>
<NugetRuntimeIdentifier>$(PackageRID)</NugetRuntimeIdentifier>
<RidSpecificAssets>true</RidSpecificAssets>
<CoreClrPackageVersion Condition="'$(TargetGroup)' == 'netcoreapp2.0'">2.0.0</CoreClrPackageVersion>
<NoWarn>$(NoWarn);NU1603;NU1605</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'uapaot' Or '$(TargetGroup)' == 'uap10.0.16299aot'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
</PropertyGroup>

<ItemDefinitionGroup>
<LibraryPackage>
<Version>4.4.0</Version>
</LibraryPackage>
<PrereleaseLibraryPackage>
<Version>4.5.0</Version>
</PrereleaseLibraryPackage>
Expand All @@ -29,6 +26,7 @@
<PrereleaseLibraryPackage Include="System.Configuration.ConfigurationManager" />
<PrereleaseLibraryPackage Include="System.Data.Odbc" />
<PrereleaseLibraryPackage Include="System.Data.DataSetExtensions" />
<PrereleaseLibraryPackage Include="System.Data.SqlClient" />
<PrereleaseLibraryPackage Include="System.Drawing.Common" />
<PrereleaseLibraryPackage Include="System.Diagnostics.EventLog" />
<PrereleaseLibraryPackage Include="System.Diagnostics.PerformanceCounter" />
Expand All @@ -42,6 +40,7 @@
<PrereleaseLibraryPackage Include="System.Management" />
<PrereleaseLibraryPackage Include="System.Runtime.Caching" />
<PrereleaseLibraryPackage Include="System.Security.AccessControl" />
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Cng" />
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Pkcs" />
<PrereleaseLibraryPackage Include="System.Security.Cryptography.ProtectedData" />
<PrereleaseLibraryPackage Include="System.Security.Cryptography.Xml" />
Expand All @@ -68,10 +67,6 @@
<LibraryPackage Include="System.ServiceModel.Security">
<Version>$(ServiceModelVersion)</Version>
</LibraryPackage>

<!-- Stable packages shipped already for netcoreapp2.0 -->
<LibraryPackage Include="System.Data.SqlClient" />
<LibraryPackage Include="System.Security.Cryptography.Cng" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DisableImplicitFrameworkReferences Condition="'$(TargetFramework)' == 'netcoreapp2.0'">true</DisableImplicitFrameworkReferences>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PackageConflictPreferredPackages Condition="'$(TargetFramework)' != 'netcoreapp2.0'">Microsoft.Private.CoreFx.NETCoreApp;runtime.$(RID).Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages)</PackageConflictPreferredPackages>
<DisableImplicitFrameworkReferences Condition="$(TargetFramework.Contains('netcoreapp'))">true</DisableImplicitFrameworkReferences>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="$(CompatibilityPackageVersion)" />
<PackageReference Condition="'$(TargetFramework)' == 'netcoreapp2.0'" Include="Microsoft.NETCore.App" Version="2.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.0'">
<PackageReference Include="Microsoft.Private.CoreFx.NETCoreApp" Version="$(PrivateCorefxPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName);
$winRID = "win7-x64";
$dotnetPath = -join($repoRoot, "\Tools\dotnetcli\dotnet.exe")
$csprojPath = -join($PSScriptRoot, "\", (Get-ChildItem $PSScriptRoot"\*.csproj" | Select-Object -ExpandProperty Name))
$packagesCachePath = -join($repoRoot, "\packages")
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Debug\")
$packageName = "Microsoft.Windows.Compatibility"
param (
$targetFramework = "netcoreapp2.1",
$runtimeVersion = "2.1.0-*",
$refDirName = "netcoreapp21_compat",
$rid = "win7-x64"
)

if (!(Test-Path $localPackageSourcePath))
{
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Release\")
if (!(Test-Path $localPackageSourcePath))
{
Write-Error -Message "Local package source must exist.";
Exit;
}
}

function _getPackageVersion()
function _getPackageVersion($packageName)
{
$searchPattern = -join($localPackageSourcePath, $packageName, ".[0-9].[0-9].[0-9]*.nupkg")
if (!(Test-Path $searchPattern))
{
Write-Error -Message (-join("Didn't find package: Microsoft.Windows.Compatibility in source: ", $localPackageSourcePath, " please run build -allConfigurations"))
Write-Error -Message (-join("Didn't find package: ", $packageName, " in source: ", $localPackageSourcePath, " please run build -allConfigurations"))
Exit;
}

Expand All @@ -34,32 +23,46 @@ function _getPackageVersion()
return $matches[0]
}

function _restoreAndPublish($targetFramework, $rid, $runtimeFramework, $refDirName)
$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName);
$dotnetPath = -join($repoRoot, "\Tools\dotnetcli\dotnet.exe")
$csprojPath = -join($PSScriptRoot, "\", (Get-ChildItem $PSScriptRoot"\*.csproj" | Select-Object -ExpandProperty Name))
$packagesCachePath = -join($repoRoot, "\packages")
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Debug\")
$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)

if (!(Test-Path $localPackageSourcePath))
{
$packageVersion = _getPackageVersion
& $dotnetPath restore --packages $packagesCachePath /p:RestoreSources="https://api.nuget.org/v3/index.json;$localPackageSourcePath" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$packageVersion $csprojPath
& $dotnetPath publish -r $rid /p:RestoreSources="https://api.nuget.org/v3/index.json;$localPackageSourcePath" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$packageVersion /p:RuntimeFrameworkVersion=$runtimeFramework $csprojPath
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Release\")
if (!(Test-Path $localPackageSourcePath))
{
Write-Error -Message "Local package source must exist.";
Exit;
}
}

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

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

Write-Output (-join("Published succedded for: ", $targetFramework))

$refPath = -join($repoRoot, "\bin\ref\", $refDirName)
& $dotnetPath publish -r $rid /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:RuntimeFrameworkVersion=$runtimeFramework /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RID=$rid $csprojPath

if (Test-Path $refPath)
{
Remove-Item $refPath -r -force
}
$outputPath = -join($PSScriptRoot, "\bin\Debug\", $targetFramework, "\", $rid, "\publish\refs\")

New-Item $refPath -ItemType directory
Copy-Item (-join($outputPath, "*")) $refPath
if (!(Test-Path $outputPath))
{
Write-Error -Message (-join("There was an error while publishing for framework: ", $targetFramework))
Exit;
}

Write-Output (-join("Published succedded for: ", $targetFramework))

$refPath = -join($repoRoot, "\bin\ref\", $refDirName)

if (Test-Path $refPath)
{
Remove-Item $refPath -r -force
}

_restoreAndPublish "netcoreapp2.0" $winRID "2.0.0" "netcoreapp20_compat"
_restoreAndPublish "netstandard2.0" $winRID "2.0.0" "netstandard20_compat"
New-Item $refPath -ItemType directory
Copy-Item (-join($outputPath, "*")) $refPath
15 changes: 6 additions & 9 deletions src/System.Buffers/pkg/System.Buffers.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<HarvestIncludePath Include="ref\netstandard1.1;ref\netstandard2.0">
<SupportedFramework>netcore45;netcoreapp1.0;wpa81;$(AllXamarinFrameworks)</SupportedFramework>
</HarvestIncludePath>
<ProjectReference Include="..\ref\System.Buffers.csproj">
<SupportedFramework>net45;netcore45;netcoreapp1.0;wpa81;$(AllXamarinFrameworks)</SupportedFramework>
<SupportedFramework>net45</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Buffers.csproj" />

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

<!-- 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
to match what shipped inbox: since we can provide a new library
we can update it to add API without raising the netstandard version. -->
<ValidatePackageSuppression Include="TreatAsOutOfBox">
<Value>.NETCoreApp;UAP</Value>
</ValidatePackageSuppression>
<InboxOnTargetFramework Include="netcoreapp2.0" />
<InboxOnTargetFramework Include="uap10.0.16299" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
3 changes: 2 additions & 1 deletion src/System.Buffers/ref/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<PackageConfigurations>
netstandard;
netstandard1.1;
uap10.0.16299;
net45;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
uap;
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
14 changes: 11 additions & 3 deletions src/System.Buffers/ref/System.Buffers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{11AE73F7-3532-47B9-8FF6-B4F22D76456C}</ProjectGuid>
<!-- Must match version supported by frameworks which support 4.0.* inbox.
Can be removed when API is added and this assembly is versioned to 4.1.* -->
<AssemblyVersion Condition="'$(TargetsNetFx)' != 'true'">4.0.2.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
Expand All @@ -21,5 +26,8 @@
<ItemGroup Condition="'$(TargetGroup)' == 'uap'">
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>
4 changes: 0 additions & 4 deletions src/System.Buffers/src/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<PackageConfigurations>
netstandard1.1;
netstandard;
netcoreapp2.0-Windows_NT;
netcoreapp2.0-Unix;
uap10.0.16299-Windows_NT;
uap10.0.16299aot-Windows_NT;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
Expand Down
8 changes: 0 additions & 8 deletions src/System.Buffers/src/System.Buffers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Debug|AnyCPU'" />
Expand All @@ -24,10 +20,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299aot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap10.0.16299aot-Windows_NT-Release|AnyCPU'" />
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
<Compile Include="System\Buffers\ArrayPool.cs" />
<Compile Include="System\Buffers\ArrayPoolEventSource.cs" />
Expand Down

0 comments on commit f14366b

Please sign in to comment.