From b4a0be4516cc6db8995b5eba09529af58ad67198 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 6 Dec 2022 14:40:19 +0100 Subject: [PATCH] Move reference assembly logic into root msbuild files (#79268) * Move reference assembly logic into root msbuild files That allows other components like the linker that don't reside under src/libraries to build reference assemblies without duplicating the infrastructure. --- Directory.Build.props | 32 +++++++++++++++++++++++++++++ Directory.Build.targets | 31 ++++++++++++++++++++++++++++ eng/referenceAssemblies.props | 29 -------------------------- eng/references.targets | 31 ---------------------------- src/libraries/Directory.Build.props | 8 +------- 5 files changed, 64 insertions(+), 67 deletions(-) delete mode 100644 eng/referenceAssemblies.props diff --git a/Directory.Build.props b/Directory.Build.props index f79e516b4e3..af4ea362d07 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -40,6 +40,13 @@ x64 $(TargetArchitecture) + + + + true + $(MSBuildProjectName)$([System.IO.Path]::DirectorySeparatorChar)ref + @@ -318,6 +325,31 @@ false + + + + false + + $(NoWarn);CS0169;CS0649;CS8618 + + $(NoWarn);CS8597 + + $(NoWarn);CS8625 + + $(NoWarn);CS8617 + + + none + + + + + + + <_Parameter1>(System.Reflection.AssemblyNameFlags)0x70 + <_Parameter1_IsLiteral>true + + $(RepositoryEngineeringDir)NoTargetsSdk.BeforeTargets.targets diff --git a/Directory.Build.targets b/Directory.Build.targets index ef9e5f5810c..dd991ce5d5f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -75,6 +75,37 @@ $(PackageDescription) + + + + $(IsReferenceAssemblyProject) + + + + + + + + + + + + <_FileVersionMaj>$(FileVersion.Split('.')[0]) + <_FileVersionMin>$(FileVersion.Split('.')[1]) + <_FileVersionBld>$(FileVersion.Split('.')[2]) + <_FileVersionRev>$(FileVersion.Split('.')[3]) + $(_FileVersionMaj).$([MSBuild]::Add($(_FileVersionMin), 100)).$(_FileVersionBld).$(_FileVersionRev) + + - false - - - $(NoWarn);CS0169;CS0649;CS8618 - - - $(NoWarn);CS8597 - - - $(NoWarn);CS8625 - - - $(NoWarn);CS8617 - - - - - - - <_Parameter1>(System.Reflection.AssemblyNameFlags)0x70 - <_Parameter1_IsLiteral>true - - - - diff --git a/eng/references.targets b/eng/references.targets index 0dac6789715..71871e1e910 100644 --- a/eng/references.targets +++ b/eng/references.targets @@ -79,22 +79,6 @@ - - - $(IsReferenceAssemblyProject) - - - - - - - - - - - - - <_FileVersionMaj>$(FileVersion.Split('.')[0]) - <_FileVersionMin>$(FileVersion.Split('.')[1]) - <_FileVersionBld>$(FileVersion.Split('.')[2]) - <_FileVersionRev>$(FileVersion.Split('.')[3]) - $(_FileVersionMaj).$([MSBuild]::Add($(_FileVersionMin), 100)).$(_FileVersionBld).$(_FileVersionRev) - - diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 1c283ebe9f7..e9fc8e8bfe0 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -2,11 +2,6 @@ true true - - - <_projectDirName>$([System.IO.Path]::GetFileName('$(MSBuildProjectDirectory)')) - true - $(MSBuildProjectName)$([System.IO.Path]::DirectorySeparatorChar)ref @@ -32,7 +27,7 @@ - true - -- 2.34.1