|  | 
| 1 | 1 | <Project> | 
|  | 2 | + | 
| 2 | 3 |   <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"> | 
| 3 | 4 |     <!-- | 
| 4 | 5 |       Disable RAR from transitively discovering dependencies for references. This is required as we don't copy | 
|  | 
| 14 | 15 |     </ProjectReference> | 
| 15 | 16 |   </ItemDefinitionGroup> | 
| 16 | 17 | 
 | 
|  | 18 | +  <!-- Set the corresponding CoreLib runtime configuration. --> | 
| 17 | 19 |   <ItemGroup Condition="'@(ProjectReference)' != ''"> | 
| 18 | 20 |     <_coreLibProjectReference Include="@(ProjectReference->WithMetadataValue('Identity', '$(CoreLibProject)'))" /> | 
| 19 |  | -    <ProjectReference Update="@(_coreLibProjectReference)" | 
| 20 |  | -                      Private="false"> | 
|  | 21 | +    <ProjectReference Update="@(_coreLibProjectReference)"> | 
| 21 | 22 |       <SetConfiguration Condition="'$(RuntimeFlavor)' == 'CoreCLR' and | 
| 22 | 23 |                                    '$(Configuration)' != '$(CoreCLRConfiguration)'">Configuration=$(CoreCLRConfiguration)</SetConfiguration> | 
| 23 | 24 |       <SetConfiguration Condition="'$(RuntimeFlavor)' == 'Mono' and | 
| 24 | 25 |                                    '$(Configuration)' != '$(MonoConfiguration)'">Configuration=$(MonoConfiguration)</SetConfiguration> | 
| 25 | 26 |     </ProjectReference> | 
| 26 |  | -    <!-- If a CoreLib ProjectReference is present, make all P2P assets non transitive. --> | 
| 27 |  | -    <ProjectReference Update="@(ProjectReference->WithMetadataValue('PrivateAssets', ''))" | 
| 28 |  | -                      PrivateAssets="all" | 
| 29 |  | -                      Condition="'$(IsSourceProject)' == 'true' and '@(_coreLibProjectReference)' != ''" /> | 
| 30 | 27 |   </ItemGroup> | 
| 31 | 28 | 
 | 
| 32 |  | -  <!-- Make shared framework assemblies not app-local (non private). --> | 
| 33 |  | -  <Target Name="UpdateProjectReferencesWithPrivateAttribute" | 
| 34 |  | -          AfterTargets="AssignProjectConfiguration" | 
| 35 |  | -          BeforeTargets="PrepareProjectReferences" | 
| 36 |  | -          Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and | 
| 37 |  | -                     ('$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true') and | 
| 38 |  | -                     '@(ProjectReferenceWithConfiguration)' != ''"> | 
| 39 |  | -    <ItemGroup> | 
| 40 |  | -      <ProjectReferenceWithConfiguration PrivateAssets="all" | 
| 41 |  | -                                         Private="false" | 
| 42 |  | -                                         Condition="$(NetCoreAppLibrary.Contains('%(Filename);')) and '%(ProjectReferenceWithConfiguration.Private)' == ''" /> | 
| 43 |  | -    </ItemGroup> | 
| 44 |  | -  </Target> | 
|  | 29 | +  <!-- Mark shared framework assemblies as non-transitive (privateassets=all) and non app-local (private=false). --> | 
|  | 30 | +  <ItemGroup Condition="'@(ProjectReference)' != '' and | 
|  | 31 | +                        '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and | 
|  | 32 | +                        '$(TargetFrameworkVersion)' == 'v$(NetCoreAppCurrentVersion)'"> | 
|  | 33 | +    <_ProjectReferenceWithOriginalIdentity Include="@(ProjectReference)" | 
|  | 34 | +                                           OriginalIdentity="%(Identity)" /> | 
|  | 35 | +    <_projectReferenceWithFilename Include="@(_ProjectReferenceWithOriginalIdentity->Metadata('Filename'))" /> | 
|  | 36 | + | 
|  | 37 | +    <_projectReferenceExcludedWithFilename Include="@(_projectReferenceWithFilename)" | 
|  | 38 | +                                           Exclude="@(NetCoreAppLibrary)" /> | 
|  | 39 | +    <_frameworkProjectReference Include="@(_projectReferenceWithFilename)" | 
|  | 40 | +                                Exclude="@(_projectReferenceExcludedWithFilename)" /> | 
|  | 41 | + | 
|  | 42 | +    <ProjectReference Update="@(_frameworkProjectReference->Metadata('OriginalIdentity'))"> | 
|  | 43 | +      <PrivateAssets Condition="'%(PrivateAssets)' == ''">all</PrivateAssets> | 
|  | 44 | +      <Private Condition="'%(Private)' == ''">false</Private> | 
|  | 45 | +    </ProjectReference> | 
|  | 46 | +  </ItemGroup> | 
| 45 | 47 | 
 | 
| 46 | 48 |   <Target Name="ReplaceCoreLibSrcWithRefAssemblyForCompilation" | 
| 47 | 49 |           AfterTargets="FindReferenceAssembliesForReferences" | 
|  | 
| 52 | 54 |       <ReferencePathWithRefAssemblies Include="@(_resolvedCoreLibProjectReference->Metadata('ReferenceAssembly'))" /> | 
| 53 | 55 |     </ItemGroup> | 
| 54 | 56 |   </Target> | 
|  | 57 | + | 
| 55 | 58 | </Project> | 
0 commit comments