-
Notifications
You must be signed in to change notification settings - Fork 107
/
Microsoft.Windows.CsWinRT.Embedded.targets
77 lines (60 loc) · 3.22 KB
/
Microsoft.Windows.CsWinRT.Embedded.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
<!--
***********************************************************************************************
Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Activate the internal version of the runtime layer -->
<DefineConstants>$(DefineConstants);EMBED</DefineConstants>
<!-- Path to runtime sources, must update if their location changes in the .nuspec -->
<CsWinRTEmbeddedTFMNet5OrGreater Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 5">true</CsWinRTEmbeddedTFMNet5OrGreater>
<WinRTRuntimeSourcesDir Condition="'$(WinRTRuntimeSourcesDir)' == ''">$(CsWinRTPath)embedded\</WinRTRuntimeSourcesDir>
</PropertyGroup>
<ItemGroup>
<CsWinRTEmbeddedSourcesAny Include="$(WinRTRuntimeSourcesDir)any\*.cs"/>
<CsWinRTEmbeddedSourcesNet5 Include="$(WinRTRuntimeSourcesDir)net6.0\*.cs"/>
<CsWinRTEmbeddedSourcesNet2 Include="$(WinRTRuntimeSourcesDir)netstandard2.0\*.cs"/>
</ItemGroup>
<!-- Copy sources that are for any framework -->
<Target Name="CsWinRTAddEmbeddedRuntime_AnySources"
AfterTargets="CsWinRTGenerateProjection"
BeforeTargets="CsWinRTIncludeProjection">
<Copy SourceFiles="@(CsWinRTEmbeddedSourcesAny)"
DestinationFolder="$(CsWinRTGeneratedFilesDir)"
UseHardlinksIfPossible="false"
SkipUnchangedFiles="true"/>
</Target>
<!-- Copy netstandard2.0 sources -->
<Target Name="CsWinRTAddEmbeddedRuntime_Net2Sources"
Condition="'$(CsWinRTEmbeddedTFMNet5OrGreater)' != 'true'"
AfterTargets="CsWinRTGenerateProjection"
BeforeTargets="CsWinRTIncludeProjection">
<Copy SourceFiles="@(CsWinRTEmbeddedSourcesNet2)"
DestinationFolder="$(CsWinRTGeneratedFilesDir)"
UseHardlinksIfPossible="false"
SkipUnchangedFiles="true"/>
</Target>
<!-- Copy net5.0 sources -->
<Target Name="CsWinRTAddEmbeddedRuntime_Net5Sources"
Condition="'$(CsWinRTEmbeddedTFMNet5OrGreater)' == 'true'"
AfterTargets="CsWinRTGenerateProjection"
BeforeTargets="CsWinRTIncludeProjection">
<Copy SourceFiles="@(CsWinRTEmbeddedSourcesNet5)"
DestinationFolder="$(CsWinRTGeneratedFilesDir)"
UseHardlinksIfPossible="false"
SkipUnchangedFiles="true"/>
</Target>
<!-- Prevent collisions of WinRT.Runtime types -->
<Target Name="RemoveWinRTRuntimeReference"
Inputs="@(RuntimeCopyLocalItems)"
AfterTargets="ResolvePackageAssets"
Outputs="@(RuntimeCopyLocalItems)">
<ItemGroup>
<Reference Remove="WinRT.Runtime" />
<RuntimeCopyLocalItems Remove="@(RuntimeCopyLocalItems)" Condition="'%(DestinationSubPath)' == 'WinRT.Runtime.dll'"/>
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition="'%(HintPath)' == '$(CsWinRTPath)lib\net6.0\WinRT.Runtime.dll'"/>
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition="'%(HintPath)' == '$(CsWinRTPath)lib\net8.0\WinRT.Runtime.dll'"/>
</ItemGroup>
</Target>
</Project>