forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.winui.cross-runtime.targets
82 lines (66 loc) · 2.92 KB
/
uno.winui.cross-runtime.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Cross-runtime libraries creation targets
-->
<Target Name="PrepareUnoRuntimeProjectReferences" BeforeTargets="BeforeBuild">
<!--
Build the ProjectReference item group for UnoRuntimeProjectReference items.
The references are added as non-referencing ProjectReferences to enable the inclusion
of their output in the final nuget package.
-->
<ItemGroup>
<ProjectReference Include="%(UnoRuntimeProjectReference.Identity)">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
</ItemGroup>
</Target>
<Target Name="ResolvePrepareUnoRuntimeProjectReferences" AfterTargets="ResolveProjectReferences">
<!-- Execute UnoRuntimeGetTargetPath for all UnoRuntimeProjectReference to get their actual output -->
<MSBuild
Projects="@(UnoRuntimeProjectReference)"
Targets="UnoRuntimeGetTargetPath"
BuildInParallel="$(BuildInParallel)"
Properties="Configuration=$(Configuration);Platform=$(Platform);TargetFramework=$(TargetFramework)"
ContinueOnError="!$(BuildingProject)">
<Output TaskParameter="TargetOutputs" ItemName="UnoRuntimeProjectReferenceOutput" />
</MSBuild>
<ItemGroup>
<!-- Add the appropriate metadata to include those files -->
<UnoRuntimeProjectReferenceOutput Update="@(UnoRuntimeProjectReferenceOutput)">
<Pack>true</Pack>
<PackagePath>uno-runtime/%(UnoRuntimeIdentifier)</PackagePath>
</UnoRuntimeProjectReferenceOutput>
<!-- Include symbols as well, if available -->
<UnoRuntimeProjectReferenceOutput
Include="@(UnoRuntimeProjectReferenceOutput->'%(rootdir)%(directory)%(filename).pdb')"
Condition="exists('%(rootdir)%(directory)%(filename).pdb')">
<Pack>true</Pack>
<PackagePath>uno-runtime/%(UnoRuntimeIdentifier)</PackagePath>
</UnoRuntimeProjectReferenceOutput>
</ItemGroup>
<ItemGroup>
<TfmSpecificPackageFile Include="@(UnoRuntimeProjectReferenceOutput)" />
</ItemGroup>
<RemoveDuplicates Inputs="@(TfmSpecificPackageFile)">
<Output TaskParameter="Filtered" ItemName="FilteredUnoRuntimeProjectReferenceOutput" />
</RemoveDuplicates>
<ItemGroup>
<TfmSpecificPackageFile Remove="@(TfmSpecificPackageFile)" />
<TfmSpecificPackageFile Include="@(FilteredUnoRuntimeProjectReferenceOutput)" />
</ItemGroup>
</Target>
<!-- Target used to determine the outputs of a project alongs with its associated UnoRuntimeIdentifier -->
<Target
Name="UnoRuntimeGetTargetPath"
DependsOnTargets="GetTargetPath"
Returns="@(UnoRuntimeTargetPathWithTargetPlatformMoniker)">
<ItemGroup>
<UnoRuntimeTargetPathWithTargetPlatformMoniker
Include="@(TargetPathWithTargetPlatformMoniker)"
UnoRuntimeIdentifier="$(UnoRuntimeIdentifier.ToLower())" />
</ItemGroup>
</Target>
</Project>