forked from dotnet/wcf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathharvest.targets
42 lines (38 loc) · 1.88 KB
/
harvest.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
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<HarvestProject>$(RepoRoot)\src\harvest\harvest.csproj</HarvestProject>
<SkipCopyBuildProduct>true</SkipCopyBuildProduct>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificBuildOutput);AddHarvestedFilesToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<!-- Override CoreCompile so that we don't build anything. -->
<Target Name="CoreCompile" />
<!-- Since we are't building, make sure the outputgroups used by packaging will be empty -->
<Target Name="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
</ItemGroup>
</Target>
<Target Name="DebugSymbolsProjectOutputGroup">
<ItemGroup>
<!-- make sure to delete the static-defined item -->
<DebugSymbolsProjectOutputGroupOutput Remove="@(DebugSymbolsProjectOutputGroupOutput)" />
</ItemGroup>
</Target>
<Target Name="_GetPathToHarvest">
<MSBuild Projects="$(HarvestProject)"
Targets="GetPathToHarvest"
Properties="PackageToHarvest=$(PackageId)">
<Output TaskParameter="TargetOutputs" PropertyName="_pathToHarvest"/>
</MSBuild>
</Target>
<Target Name="AddHarvestedFilesToPackage"
DependsOnTargets="_GetPathToHarvest">
<ItemGroup>
<_harvestedItems Include="$(_pathToHarvest)\lib\$(TargetFramework)\*.*" PackagePath="lib\$(TargetFramework)" />
<_harvestedItems Include="$(_pathToHarvest)\ref\$(TargetFramework)\*.*" PackagePath="ref\$(TargetFramework)" />
<TfmSpecificPackageFile Include="@(_harvestedItems)" />
</ItemGroup>
<Error Condition="'@(_harvestedItems)' == ''" Text="Could not harvest any files from $(_pathToHarvest)\%(HarvestIncludePaths.Identity) "/>
</Target>
</Project>