diff options
author | Santiago Fernandez Madero <safern@microsoft.com> | 2018-03-28 19:54:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 19:54:37 +0300 |
commit | f14366baaa80a893e53934b98e9786dac54c136f (patch) | |
tree | ae09595450846ce964ab29ff530a4699ce180ddf /pkg | |
parent | 906f2d151660ae9b8c547722b44b06693a86c1b2 (diff) |
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
Diffstat (limited to 'pkg')
3 files changed, 56 insertions, 50 deletions
diff --git a/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.pkgproj b/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.pkgproj index ea4f0d53be..ffa4e7e23c 100644 --- a/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.pkgproj +++ b/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.pkgproj @@ -8,9 +8,6 @@ </PropertyGroup> <ItemDefinitionGroup> - <LibraryPackage> - <Version>4.4.0</Version> - </LibraryPackage> <PrereleaseLibraryPackage> <Version>4.5.0</Version> </PrereleaseLibraryPackage> @@ -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" /> @@ -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" /> @@ -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> diff --git a/pkg/Microsoft.Windows.Compatibility/tests/Microsoft.Windows.Compatibility.Validation.csproj b/pkg/Microsoft.Windows.Compatibility/tests/Microsoft.Windows.Compatibility.Validation.csproj index 45ec708355..b183bd2c2f 100644 --- a/pkg/Microsoft.Windows.Compatibility/tests/Microsoft.Windows.Compatibility.Validation.csproj +++ b/pkg/Microsoft.Windows.Compatibility/tests/Microsoft.Windows.Compatibility.Validation.csproj @@ -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>
\ No newline at end of file diff --git a/pkg/Microsoft.Windows.Compatibility/tests/publishcompatibilityassets.ps1 b/pkg/Microsoft.Windows.Compatibility/tests/publishcompatibilityassets.ps1 index 0db2d675c0..0dac35cb5b 100644 --- a/pkg/Microsoft.Windows.Compatibility/tests/publishcompatibilityassets.ps1 +++ b/pkg/Microsoft.Windows.Compatibility/tests/publishcompatibilityassets.ps1 @@ -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; } @@ -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"
\ No newline at end of file +New-Item $refPath -ItemType directory +Copy-Item (-join($outputPath, "*")) $refPath |