-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDirectory.Build.targets
27 lines (22 loc) · 1.66 KB
/
Directory.Build.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
<Project>
<Target Name="UseExplicitPackageVersions" BeforeTargets="GenerateNuspec">
<ItemGroup>
<_ProjectReferenceWithExactPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.ExactVersion)' == 'true'" />
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExactPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
<ProjectVersion>[@(_ProjectReferencesWithVersions->'%(ProjectVersion)')]</ProjectVersion>
</_ProjectReferenceWithReassignedVersion>
<_ProjectReferencesWithVersions Remove="@(_ProjectReferenceWithReassignedVersion)" />
<_ProjectReferencesWithVersions Include="@(_ProjectReferenceWithReassignedVersion)" />
</ItemGroup>
</Target>
<UsingTask TaskName="Microsoft.NET.Build.Tasks.GetNuGetShortFolderName" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="GetNuGetShortFolderName">
<!-- https://github.com/NuGet/Home/issues/10063#issuecomment-1988004292 -->
<GetNuGetShortFolderName TargetFrameworkMoniker="$(TargetPlatformMoniker)" TargetPlatformMoniker="$(TargetPlatformMoniker)" Condition="$(TargetFramework.StartsWith('uap'))">
<Output TaskParameter="NuGetShortFolderName" PropertyName="NuGetShortFolderName" />
</GetNuGetShortFolderName>
<GetNuGetShortFolderName TargetFrameworkMoniker="$(TargetFrameworkMoniker)" TargetPlatformMoniker="$(TargetPlatformMoniker)" Condition="!$(TargetFramework.StartsWith('uap'))">
<Output TaskParameter="NuGetShortFolderName" PropertyName="NuGetShortFolderName" />
</GetNuGetShortFolderName>
</Target>
</Project>