Skip to content

Commit

Permalink
Use SDK's .NETFramework refpack version (dotnet#60555)
Browse files Browse the repository at this point in the history
Use the MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion property which is exposed by the SDK instead of the one exposed by Arcade to make sure that we are always targeting the latest version.
  • Loading branch information
ViktorHofer authored Oct 25, 2021
1 parent 8b91223 commit f9ed53d
Show file tree
Hide file tree
Showing 29 changed files with 20 additions and 44 deletions.
1 change: 0 additions & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<InnerBuildArgs>$(InnerBuildArgs) --verbosity $(LogVerbosity)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --nodereuse false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --warnAsError false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:PackageRid=$(TargetRid)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:NoPgoOptimize=true</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:KeepNativeSymbols=true</InnerBuildArgs>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/shims/ApiCompat.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</ItemGroup>

<ItemGroup>
<PackageDownload Include="microsoft.netcore.app.ref" Version="[$(NetCoreAppLatestStablePackageBaselineVersion)]" />
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(NetCoreAppLatestStablePackageBaselineVersion)]" />
<PackageDownload Include="NETStandard.Library.Ref" Version="[$(NETStandardLibraryRefVersion)]" />
<PackageDownload Include="NETStandard.Library" Version="[$(NetStandardLibraryVersion)]" />
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="$(MicrosoftDotNetApiCompatVersion)" IsImplicitlyDefined="true" />
Expand Down
6 changes: 0 additions & 6 deletions src/libraries/shims/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
<Import Project="..\Directory.Build.props" />
<Import Project="netfxreference.props" />

<PropertyGroup>
<NETFrameworkReferenceAssemblyTFM>net48</NETFrameworkReferenceAssemblyTFM>
<NetFxRefPath>$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.$(NETFrameworkReferenceAssemblyTFM)\$(MicrosoftNetFrameworkReferenceAssembliesVersion)\build\.NETFramework\v4.8\</NetFxRefPath>
<NETStandard21RefPath>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'netstandard.library.ref', '$(NETStandardLibraryRefVersion)', 'ref', 'netstandard2.1'))</NETStandard21RefPath>
</PropertyGroup>

<PropertyGroup Condition="'$(IsFrameworkSupportFacade)' == 'true'">
<IsNETCoreAppSrc>true</IsNETCoreAppSrc>
<IsNETCoreAppRef>true</IsNETCoreAppRef>
Expand Down
21 changes: 18 additions & 3 deletions src/libraries/shims/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
<Project>
<ItemGroup Condition="'$(IsFrameworkSupportFacade)' == 'true'">
<ResolvedMatchingContract Include="$(ContractAssemblyPath)" />
<Import Project="..\Directory.Build.targets" />

<PropertyGroup>
<NETFrameworkReferenceAssemblyTFM>net48</NETFrameworkReferenceAssemblyTFM>
<NetFxRefPath>$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.$(NETFrameworkReferenceAssemblyTFM)\$(MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion)\build\.NETFramework\v4.8\</NetFxRefPath>
<NETStandard21RefPath>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'netstandard.library.ref', '$(NETStandardLibraryRefVersion)', 'ref', 'netstandard2.1'))</NETStandard21RefPath>
</PropertyGroup>

<!-- Download the corresponding targeting pack to build against the contract. -->
<ItemGroup Condition="'$(IsFrameworkSupportFacade)' == 'true' and '$(MSBuildProjectName)' == 'netstandard'">
<PackageDownload Include="NETStandard.Library.Ref"
Version="[$(NETStandardLibraryRefVersion)]" />
<ResolvedMatchingContract Include="$(NETStandard21RefPath)$(MSBuildProjectName).dll" />
</ItemGroup>

<Import Project="..\Directory.Build.targets" />
<ItemGroup Condition="'$(IsFrameworkSupportFacade)' == 'true' and '$(MSBuildProjectName)' != 'netstandard'">
<PackageDownload Include="Microsoft.NETFramework.ReferenceAssemblies.$(NETFrameworkReferenceAssemblyTFM)"
Version="[$(MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion)]" />
<ResolvedMatchingContract Include="$(NetFxRefPath)$(MSBuildProjectName).dll" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions src/libraries/shims/generateShims.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<_contractName>%(GenFacadesContracts.Identity)</_contractName>
<_contractStrongNameKeyId>%(GenFacadesContracts.StrongNameKeyId)</_contractStrongNameKeyId>
<_contractStrongNameKeyId Condition="'$(_contractStrongNameKeyId)' == ''">Microsoft</_contractStrongNameKeyId>
<_contractDirProperty>%(GenFacadesContracts.ContractDir)</_contractDirProperty>
<_contractAssembly>$(%(GenFacadesContracts.ContractDir))$(_contractName).dll</_contractAssembly>
<_contractProjectFile>generated/$(_contractName).csproj</_contractProjectFile>
</PropertyGroup>
Expand All @@ -37,7 +36,6 @@
<PropertyGroup>
<AssemblyVersion>$(_contractAssemblyVersion)</AssemblyVersion>
<StrongNameKeyId>$(_contractStrongNameKeyId)</StrongNameKeyId>
<ContractAssemblyPath>%24($(_contractDirProperty))%24(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'%24(MSBuildProjectFullPath)' == '%24(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Expand Down
9 changes: 1 addition & 8 deletions src/libraries/shims/generated/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
</PropertyGroup>

<!-- Download the .NET Framework RefPack to build against the contract. -->
<!-- System.Data.SqlClient is not live built anymore, reference it manually. -->
<ItemGroup>
<PackageDownload Include="NETStandard.Library.Ref"
Condition="'$(MSBuildProjectName)' == 'netstandard'"
Version="[$(NETStandardLibraryRefVersion)]" />
<PackageDownload Include="Microsoft.NETFramework.ReferenceAssemblies.$(NETFrameworkReferenceAssemblyTFM)"
Condition="'$(MSBuildProjectName)' != 'netstandard'"
Version="[$(MicrosoftNetFrameworkReferenceAssembliesVersion)]" />
<!-- System.Data.SqlClient is not live built anymore, reference it manually. -->
<PackageReference Include="System.Data.SqlClient"
Version="$(SystemDataSqlClientVersion)" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/libraries/shims/generated/Microsoft.VisualBasic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>MicrosoftShared</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Drawing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Numerics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Security.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>MicrosoftShared</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.ServiceProcess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Transactions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Xml.Linq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.Xml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/System.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/WindowsBase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>MicrosoftShared</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/mscorlib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
<ContractAssemblyPath>$(NetFxRefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
1 change: 0 additions & 1 deletion src/libraries/shims/generated/netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<StrongNameKeyId>Open</StrongNameKeyId>
<ContractAssemblyPath>$(NETStandard21RefPath)$(MSBuildProjectName).dll</ContractAssemblyPath>
</PropertyGroup>
<Import Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileFullPath)'" Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>

0 comments on commit f9ed53d

Please sign in to comment.