forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackageDownloadAndReference.targets
33 lines (25 loc) · 1.55 KB
/
PackageDownloadAndReference.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<Project>
<!-- These file supports using PackageDownloadAndReference items.
The PackageDownloadAndReference item is used to download a package and reference it in the project, without restoring the package's dependency closure.
When using PackageDownloadAndReference you are responsible for selecting the correct assets from the package and ensuring that the package and it's
dependencies are available at runtime.
The PackageDownloadAndReference item has the following metadata:
- Folder: The folder in the package where the assembly is located.
- AssemblyName: The name of the assembly to reference.
- Private: Whether the reference should be private (copied to the output directory) or not. Default is false.
A common use case for PackageDownloadAndReference is to reference assemblies provided by MSBuild or the .NET SDK.
-->
<ItemDefinitionGroup>
<PackageDownloadAndReference>
<Folder>lib/$(TargetFramework)</Folder>
<AssemblyName>%(Identity)</AssemblyName>
<Private>false</Private>
</PackageDownloadAndReference>
</ItemDefinitionGroup>
<ItemGroup>
<PackageDownload Include="@(PackageDownloadAndReference)" />
<PackageDownload Update="@(PackageDownloadAndReference)" Version="[%(Version)]"/>
<PackageDownloadAndReference Update="@(PackageDownloadAndReference)" PackageFolder="$([System.String]::new(%(Identity)).ToLowerInvariant())" />
<Reference Include="@(PackageDownloadAndReference->'$(NuGetPackageRoot)%(PackageFolder)/%(Version)/%(Folder)/%(AssemblyName).dll')" />
</ItemGroup>
</Project>