diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2022-01-18 18:07:01 +0300 |
---|---|---|
committer | Viktor Hofer <viktor.hofer@microsoft.com> | 2022-02-24 14:32:04 +0300 |
commit | 9ebe0efa4850fb2e451befe1fdf7c2d3cbb5c862 (patch) | |
tree | b89ad195ff24e3ddf4d092b3953731de4d55ace5 /eng/references.targets | |
parent | fbf95fde7c4a23571dab5586b649729ff454000f (diff) |
sfx+oob split, shim project refactoring, P2Ps
Split the build of shared framework and out-of-band projects so that
it's possible to just build the shard framework projects, which was
requested by the CLR teams. In the next infrastructure rollout, the
current "libs.ref+libs.src" subsets should be removed. Generate the
targeting pack with an incomplete (without shims) frameworklist as part
of the "libs.sfx" subset.
Build the shim projects after the shared framework and oob projects and
re-generate the targeting pack's frameworklist to include the shims.
Refactor the shims so that they aren't grouped anymore by generated &
manual. Instead group them by "ref" and "src" same as other libraries
in the tree which allows to reference the source project shims and read
from the ReferenceAssembly metadata.
Use ProjectReferences in traversal projects and shim projects instead
of named references that point to binplace directories (see graph below)
This allows to build parts of the product dynamically, i.e. the shim
projects, apicompat.proj, sfx.proj and oob.proj.
Diffstat (limited to 'eng/references.targets')
-rw-r--r-- | eng/references.targets | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/eng/references.targets b/eng/references.targets index 4603fb98566..c73b8295397 100644 --- a/eng/references.targets +++ b/eng/references.targets @@ -16,19 +16,17 @@ <ItemGroup Condition="'@(ProjectReference)' != ''"> <_coreLibProjectReference Include="@(ProjectReference->WithMetadataValue('Identity', '$(CoreLibProject)'))" /> - <ProjectReference Update="@(_coreLibProjectReference)"> - <!-- Don't flow TargetFramework and Platform to use same inputs and outputs as the CoreLib's build as part of the runtime. --> - <UndefineProperties>$(UndefineProperties);TargetFramework;Platform</UndefineProperties> + <ProjectReference Update="@(_coreLibProjectReference)" + Private="false"> <SetConfiguration Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(Configuration)' != '$(CoreCLRConfiguration)'">Configuration=$(CoreCLRConfiguration)</SetConfiguration> <SetConfiguration Condition="'$(RuntimeFlavor)' == 'Mono' and '$(Configuration)' != '$(MonoConfiguration)'">Configuration=$(MonoConfiguration)</SetConfiguration> - <Private>false</Private> </ProjectReference> <!-- If a CoreLib ProjectReference is present, make all P2P assets non transitive. --> - <ProjectReference Update="@(ProjectReference)" + <ProjectReference Update="@(ProjectReference->WithMetadataValue('PrivateAssets', ''))" PrivateAssets="all" - Condition="'@(_coreLibProjectReference)' != ''" /> + Condition="'$(IsSourceProject)' == 'true' and '@(_coreLibProjectReference)' != ''" /> </ItemGroup> <!-- Disable TargetArchitectureMismatch warning when we reference CoreLib as it is platform specific. --> @@ -78,8 +76,19 @@ <Target Name="ValidateReferenceAssemblyProjectReferences" AfterTargets="ResolveReferences" - Condition="'$(IsReferenceAssembly)' == 'true'"> + Condition="'$(IsReferenceAssembly)' == 'true' and + '$(SkipValidateReferenceAssemblyProjectReferences)' != 'true'"> <Error Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and '%(ReferencePath.IsReferenceAssembly)' != 'true' and '%(ReferencePath.ReferenceAssembly)' == ''" Text="Reference assemblies must only reference other reference assemblies and '%(ReferencePath.ProjectReferenceOriginalItemSpec)' is not a reference assembly project and does not set 'ProduceReferenceAssembly'." /> </Target> + + <!-- An opt-in target to trim out private assemblies from the ref assembly ReferencePath. --> + <Target Name="TrimOutPrivateAssembliesFromReferencePath" + Condition="'$(CompileUsingReferenceAssemblies)' == 'true' and '$(TrimOutPrivateAssembliesFromReferencePath)' == 'true'" + AfterTargets="FindReferenceAssembliesForReferences"> + <ItemGroup> + <ReferencePathWithRefAssemblies Remove="@(ReferencePathWithRefAssemblies)" + Condition="$(NetCoreAppLibraryNoReference.Contains('%(Filename);'))" /> + </ItemGroup> + </Target> </Project> |