diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props index 52613ca6bdd13..5a3944d9aa36c 100644 --- a/eng/Directory.Build.Data.props +++ b/eng/Directory.Build.Data.props @@ -34,11 +34,6 @@ false - - - $(MSBuildThisFileDirectory)Packages.Data.props - - true true diff --git a/eng/Directory.Build.Data.targets b/eng/Directory.Build.Data.targets index 3ceb7c9425dd4..0a55f3766e83d 100644 --- a/eng/Directory.Build.Data.targets +++ b/eng/Directory.Build.Data.targets @@ -1,6 +1,4 @@  - - @@ -68,4 +66,13 @@ + + + + + $(MSBuildThisFileDirectory)Packages.Data.props + $(MSBuildThisFileDirectory)Microsoft.Build.CentralPackageVersions\2.0.46\Sdk + + + \ No newline at end of file diff --git a/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.props b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.props new file mode 100644 index 0000000000000..75efc66ac0e69 --- /dev/null +++ b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.props @@ -0,0 +1,17 @@ + + + + + + + $(MSBuildAllProjects);$(MsBuildThisFileFullPath) + + + + + + \ No newline at end of file diff --git a/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets new file mode 100644 index 0000000000000..43139d8c12e47 --- /dev/null +++ b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets @@ -0,0 +1,183 @@ + + + + + + + + + + $([MSBuild]::GetPathOfFileAbove('Packages.props', $(MSBuildProjectDirectory))) + + + false + + + $(MSBuildAllProjects);$(MsBuildThisFileFullPath) + $(CentralPackagesFile);$(MSBuildAllProjects) + + + + + + Analyzers;Build + + All + + + + + + + + + + + + + + + + <_PackageReferenceWithVersion Include="@(PackageReference->HasMetadata('Version'))" /> + + + <_OriginalPackageReference Include="@(PackageReference->ClearMetadata())" /> + + + + + + + + + + <_PackageReferenceWithVersionOverride Include="@(PackageReference->HasMetadata('VersionOverride'))" + Version="%(VersionOverride)" + Condition=" '$(EnablePackageVersionOverride)' != 'false' " + /> + + + + + + + + <_PackageReferenceWithVersionOverride Remove="@(_PackageReferenceWithVersionOverride)" /> + + + + + + + <_DuplicateGlobalPackageReference Include="@(_OriginalPackageReference)" + Condition=" '@(GlobalPackageReference)' == '@(_OriginalPackageReference)' and '%(Identity)' != '' " /> + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eng/Microsoft.Build.CentralPackageVersions/Readme.md b/eng/Microsoft.Build.CentralPackageVersions/Readme.md new file mode 100644 index 0000000000000..79f4e8919bf6e --- /dev/null +++ b/eng/Microsoft.Build.CentralPackageVersions/Readme.md @@ -0,0 +1,9 @@ +To workaround an issue with https://github.com/Azure/azure-sdk-for-net/issues/7490 we are simply going to +include the contents of the package in the repo itself, given that it is just a props and targets file. + +If this needs to be updated go and download the latest package from +https://www.nuget.org/packages/Microsoft.Build.CentralPackageVersions and extract the sdk.props/targets +file from the package and put them under a folder matching the version of the package. Then update +the places we are importing those files to include the updated version number. Currently only +the CentralPackageVersionPackagePath property in Directory.Build.Data.targets. Be sure to cleam up +the old version as well. \ No newline at end of file