forked from dotnet/iot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
67 lines (60 loc) · 2.59 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<!-- Crosstargeting for RIDs -->
<PropertyGroup Condition="'$(RuntimeIdentifiers)' != '' And '$(RuntimeIdentifier)' == ''">
<IsCrossTargetingRIDs>true</IsCrossTargetingRIDs>
</PropertyGroup>
<Choose>
<When Condition="'$(IsCrossTargetingRIDs)' == 'true'">
<PropertyGroup>
<CrossTargetingRIDTargetsPath>$(MSBuildThisFileDirectory)eng\CrosstargetingRIDs.targets</CrossTargetingRIDTargetsPath>
</PropertyGroup>
</When>
</Choose>
<Import Project="$(CrossTargetingRIDTargetsPath)" Condition="Exists('$(CrossTargetingRIDTargetsPath)')" />
<!-- Packaging Targets -->
<PropertyGroup>
<!-- Collect package assets from builds -->
<IncludeRIDSpecificBuildOutput Condition="'$(IncludeRIDSpecificBuildOutput)' == '' And '$(RuntimeIdentifiers)' != ''">true</IncludeRIDSpecificBuildOutput>
<TargetsForTfmSpecificContentInPackage Condition="'$(IncludeRIDSpecificBuildOutput)' == 'true'">
$(TargetsForTfmSpecificContentInPackage);
_WalkEachRIDForBuildOutput;
_GetNotSupportedAssemblyForPackage;
</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<ItemGroup>
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)" />
</ItemGroup>
<Target Name="_WalkEachRIDForBuildOutput">
<MSBuild
Condition="'$(IncludeRIDSpecificBuildOutput)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="_GetBuildOutputWithRID"
Properties="RuntimeIdentifier=%(_RuntimeIdentifiers.Identity)">
<Output
TaskParameter="TargetOutputs"
ItemName="TfmSpecificPackageFile" />
</MSBuild>
</Target>
<Target Name="_GetNotSupportedAssemblyForPackage">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)notsupported\$(MSBuildProjectName).dll">
<PackagePath>lib/$(TargetFramework)</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(OutputPath)linux\$(MSBuildProjectName).xml">
<PackagePath>lib/$(TargetFramework)</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<Target Name="_GetBuildOutputWithRID" Returns="@(RIDSpecificPackageFile)">
<ItemGroup>
<RIDSpecificPackageFile Include="$(TargetPath)">
<PackagePath>runtimes/$(RuntimeIdentifier)/lib/$(TargetFramework)</PackagePath>
</RIDSpecificPackageFile>
<RIDSpecificPackageFile Include="$(DocumentationFile)">
<PackagePath>runtimes/$(RuntimeIdentifier)/lib/$(TargetFramework)</PackagePath>
</RIDSpecificPackageFile>
</ItemGroup>
</Target>
</Project>