| 1 |
<!-- This overrides the typical ResolveNuGetPackages so that it does copy local of the |
| 2 |
referenced items. This is used so that we can correctly resolve and copy the libraries necessary |
| 3 |
to the core_root directory --> |
| 4 |
|
| 5 |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 6 |
<Target Name="ResolveNuGetPackages"> |
| 7 |
|
| 8 |
<PrereleaseResolveNuGetPackageAssets Condition="Exists($(ProjectAssetsFile))" |
| 9 |
AllowFallbackOnTargetSelection="true" |
| 10 |
IncludeFrameworkReferences="false" |
| 11 |
NuGetPackagesDirectory="$(PackagesDir)" |
| 12 |
RuntimeIdentifier="$(TestNugetRuntimeId)" |
| 13 |
ProjectLanguage="$(Language)" |
| 14 |
ProjectLockFile="$(ProjectAssetsFile)" |
| 15 |
TargetMonikers="$(TargetFrameworkMoniker)"> |
| 16 |
<Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" /> |
| 17 |
<Output TaskParameter="ResolvedReferences" ItemName="Reference" /> |
| 18 |
<Output TaskParameter="ResolvedCopyLocalItems" ItemName="CopyLocal" /> |
| 19 |
</PrereleaseResolveNuGetPackageAssets> |
| 20 |
|
| 21 |
<!-- We may have an indirect package reference that we want to replace with a project reference --> |
| 22 |
<ItemGroup> |
| 23 |
<!-- Convert to file names so that we can intersect --> |
| 24 |
<_ProjectReferenceFilenames Include="@(_ResolvedProjectReferencePaths->'%(FileName)%(Extension)')"> |
| 25 |
<OriginalIdentity>%(Identity)</OriginalIdentity> |
| 26 |
</_ProjectReferenceFilenames> |
| 27 |
|
| 28 |
<_ReferencesFileNames Include="@(Reference->'%(FileName)%(Extension)')"> |
| 29 |
<OriginalIdentity>%(Identity)</OriginalIdentity> |
| 30 |
</_ReferencesFileNames> |
| 31 |
|
| 32 |
<_CopyLocalFileNames Include="@(CopyLocal->'%(FileName)%(Extension)')"> |
| 33 |
<OriginalIdentity>%(Identity)</OriginalIdentity> |
| 34 |
</_CopyLocalFileNames> |
| 35 |
|
| 36 |
<!-- Intersect project-refs with package-refs --> |
| 37 |
<_ReferenceFileNamesToRemove Include="@(_ReferencesFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_ReferencesFileNames)' and '%(Identity)' != ''"/> |
| 38 |
<_CopyLocalFileNamesToRemove Include="@(_CopyLocalFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_CopyLocalFileNames)' and '%(Identity)' != ''"/> |
| 39 |
|
| 40 |
<Reference Remove="@(_ReferenceFileNamesToRemove)" /> |
| 41 |
<CopyLocal Remove="@(_CopyLocalFileNamesToRemove)"/> |
| 42 |
</ItemGroup> |
| 43 |
|
| 44 |
<Message Text="Excluding @(_ReferenceFileNamesToRemove);@(_CopyLocalFileNamesToRemove) from package references since the same file is provided by a project reference." |
| 45 |
Condition="'@(_ReferenceFileNamesToRemove)' != '' or '@(_CopyLocalFileNamesToRemove)' != ''"/> |
| 46 |
|
| 47 |
<Copy |
| 48 |
SourceFiles="@(CopyLocal)" |
| 49 |
DestinationFolder="$(OutDir)" |
| 50 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" |
| 51 |
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" |
| 52 |
Retries="$(CopyRetryCount)" |
| 53 |
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" |
| 54 |
UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> |
| 55 |
|
| 56 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> |
| 57 |
</Copy> |
| 58 |
|
| 59 |
</Target> |
| 60 |
</Project> |