|
91 | 91 | and flatten matching ones to the output root. This ensures only the target RID's |
92 | 92 | native libs are copied, and they're placed flat for dlopen to find them. --> |
93 | 93 | <Target Name="_StrideFilterAndFlattenRuntimes" |
94 | | - BeforeTargets="_CopyFilesMarkedCopyLocal;_CopySourceItemsToOutputDirectory" |
| 94 | + BeforeTargets="_CopyOutOfDateSourceItemsToOutputDirectory;_CopyOutOfDateSourceItemsToOutputDirectoryAlways;_CopyFilesMarkedCopyLocal" |
| 95 | + DependsOnTargets="GetCopyToOutputDirectoryItems" |
95 | 96 | Condition="'$(RuntimeIdentifier)' != ''"> |
96 | 97 | <ItemGroup> |
97 | | - <!-- Remove non-matching runtimes/ items --> |
98 | | - <None Remove="@(None)" |
99 | | - Condition="'%(None.CopyToOutputDirectory)' != '' And |
100 | | - $([System.String]::Copy('%(None.Link)').Replace('/','\\').StartsWith('runtimes\')) And |
101 | | - !$([System.String]::Copy('%(None.Link)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" /> |
102 | | - <!-- Flatten matching runtimes/ items to output root --> |
103 | | - <None Update="@(None)" |
104 | | - Condition="'%(None.CopyToOutputDirectory)' != '' And |
105 | | - $([System.String]::Copy('%(None.Link)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" |
106 | | - Link="%(Filename)%(Extension)" /> |
| 98 | + <!-- Filter source items (None / Content / etc. with CopyToOutputDirectory) --> |
| 99 | + <_SourceItemsToCopyToOutputDirectory Remove="@(_SourceItemsToCopyToOutputDirectory)" |
| 100 | + Condition="$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectory.TargetPath)').Replace('/','\\').StartsWith('runtimes\')) And |
| 101 | + !$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectory.TargetPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" /> |
| 102 | + <_SourceItemsToCopyToOutputDirectory Update="@(_SourceItemsToCopyToOutputDirectory)" |
| 103 | + Condition="$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectory.TargetPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" |
| 104 | + TargetPath="%(Filename)%(Extension)" /> |
| 105 | + <_SourceItemsToCopyToOutputDirectoryAlways Remove="@(_SourceItemsToCopyToOutputDirectoryAlways)" |
| 106 | + Condition="$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectoryAlways.TargetPath)').Replace('/','\\').StartsWith('runtimes\')) And |
| 107 | + !$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectoryAlways.TargetPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" /> |
| 108 | + <_SourceItemsToCopyToOutputDirectoryAlways Update="@(_SourceItemsToCopyToOutputDirectoryAlways)" |
| 109 | + Condition="$([System.String]::Copy('%(_SourceItemsToCopyToOutputDirectoryAlways.TargetPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" |
| 110 | + TargetPath="%(Filename)%(Extension)" /> |
| 111 | + <!-- Filter ReferenceCopyLocalPaths (NuGet runtime assets + project-reference copies) --> |
| 112 | + <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" |
| 113 | + Condition="$([System.String]::Copy('%(ReferenceCopyLocalPaths.DestinationSubPath)').Replace('/','\\').StartsWith('runtimes\')) And |
| 114 | + !$([System.String]::Copy('%(ReferenceCopyLocalPaths.DestinationSubPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" /> |
| 115 | + <ReferenceCopyLocalPaths Update="@(ReferenceCopyLocalPaths)" |
| 116 | + Condition="$([System.String]::Copy('%(ReferenceCopyLocalPaths.DestinationSubPath)').Replace('/','\\').StartsWith('runtimes\$(RuntimeIdentifier)\'))" |
| 117 | + DestinationSubPath="%(Filename)%(Extension)" /> |
107 | 118 | </ItemGroup> |
108 | 119 | </Target> |
109 | 120 |
|
|
0 commit comments