-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathPublish.targets
23 lines (18 loc) · 1.48 KB
/
Publish.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- This target filters the @(ReferenceCopyLocalPaths) item list based on the provided publish file exclusion list. -->
<Target Name="_FilterReferenceCopyLocalPaths" AfterTargets="ResolveAssemblyReferences" Condition=" '@(NuGetPackageIdExclusionList)' != '' ">
<ItemGroup>
<!-- This duplicates each item in @(ReferenceCopyLocalPaths), once per item in @(NuGetPackageIdExclusionList). -->
<_AllReferenceCopyLocalPathsWithExclusionListMetadata Include="@(ReferenceCopyLocalPaths)">
<NuGetPackageIdExclusionList>%(NuGetPackageIdExclusionList.Identity)</NuGetPackageIdExclusionList>
</_AllReferenceCopyLocalPathsWithExclusionListMetadata>
<!-- This filters the list back down to just the items where the NuGetPackageId matches one of the items in NuGetPackageIdExclusionList (e.g. the excluded items of @(ReferenceCopyLocalPaths)). -->
<ExcludedAllReferenceCopyLocalPaths Include="@(_AllReferenceCopyLocalPathsWithExclusionListMetadata)" Condition=" '%(_AllReferenceCopyLocalPathsWithExclusionListMetadata.NuGetPackageId)' == '%(_AllReferenceCopyLocalPathsWithExclusionListMetadata.NuGetPackageIdExclusionList)' " />
<!-- Finally, actually remove the items that have been identified as excluded. -->
<ReferenceCopyLocalPaths Remove="@(ExcludedAllReferenceCopyLocalPaths)" />
</ItemGroup>
</Target>
</Project>