-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoot.Platform.props
97 lines (91 loc) · 3.81 KB
/
Boot.Platform.props
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
Inputs
ZouAgentType
[RuntimeIdentifier]
[Platform]
[ForwardPlatform]
Outputs
Platforms
Platform
RuntimePlatform
ForwardPlatform
-->
<Project InitialTargets="TraceBootPlatform;BootPlatformCheck"
TreatAsLocalProperty="Platform;RuntimePlatform">
<PropertyGroup>
<Platforms>AnyCPU;x86;x64</Platforms>
<DebugBootPlatform>Platform='$(Platform)', RuntimeIdentifier='$(RuntimeIdentifier)'</DebugBootPlatform>
</PropertyGroup>
<Choose>
<When Condition="'$(Platform)' == ''">
<Choose>
<When Condition="$(RuntimeIdentifier.EndsWith('x86'))">
<PropertyGroup>
<DebugBootPlatform>1.1 $(DebugBootPlatform)</DebugBootPlatform>
<Platform >x86</Platform>
<RuntimePlatform>x86</RuntimePlatform>
<ForwardPlatform>x86</ForwardPlatform>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.EndsWith('x64'))">
<PropertyGroup>
<DebugBootPlatform>1.2 $(DebugBootPlatform)</DebugBootPlatform>
<Platform >x64</Platform>
<RuntimePlatform>x64</RuntimePlatform>
<ForwardPlatform>x64</ForwardPlatform>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DebugBootPlatform>1.3 $(DebugBootPlatform)</DebugBootPlatform>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
<When Condition="'$(Platform)' == 'x86' Or '$(Platform)' == 'x64'">
<PropertyGroup>
<DebugBootPlatform>2 $(DebugBootPlatform)</DebugBootPlatform>
<RuntimePlatform>$(Platform)</RuntimePlatform>
<ForwardPlatform>$(Platform)</ForwardPlatform>
</PropertyGroup>
</When>
<When Condition="'$(Platform)' == 'Win32'">
<PropertyGroup>
<DebugBootPlatform>3 $(DebugBootPlatform)</DebugBootPlatform>
<RuntimePlatform>x86</RuntimePlatform>
<ForwardPlatform>x86</ForwardPlatform>
</PropertyGroup>
</When>
<When Condition="'$(Platform)' == 'AnyCPU' Or '$(Platform)' == 'Any CPU'">
<PropertyGroup>
<DebugBootPlatform>4 $(DebugBootPlatform)</DebugBootPlatform>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DebugBootPlatform>5 $(DebugBootPlatform)</DebugBootPlatform>
<Platform >x64</Platform>
<RuntimePlatform>x64</RuntimePlatform>
</PropertyGroup>
</Otherwise>
</Choose>
<Target Name="BootPlatformCheck" Condition="'$(ForwardPlatform)' != ''">
<PropertyGroup>
<ErrorMessage>"Platform ($(ForwardPlatform)) and RuntimePlatform ($(RuntimePlatform)) are not compatibles"</ErrorMessage>
</PropertyGroup>
<Error Text="$(ErrorMessage)" Condition="('$(ForwardPlatform)' == 'Win32' Or '$(ForwardPlatform)' == 'x86') And '$(RuntimePlatform)' != 'x86'" />
<Error Text="$(ErrorMessage)" Condition="('$(ForwardPlatform)' == '' Or '$(ForwardPlatform)' == 'x64') And '$(RuntimePlatform)' != 'x64'" />
</Target>
<Target Name="TraceBootPlatform" Condition="'$(ZouTrace)' == 'true' Or '$(MSBuildProjectFile)' == '$(MSBuildThisFile)'">
<Message Importance="high" Text="zou/Boot.Platform.props [$(MSBuildProjectFile)]" />
<Message Importance="high" Text="-----------------------" />
<Message Importance="high" Text="DebugBootPlatform = $(DebugBootPlatform)" />
<Message Importance="high" Text="ZouAgentType = $(ZouAgentType)" />
<Message Importance="high" Text=" " />
<Message Importance="high" Text="Platform = $(Platform)" />
<Message Importance="high" Text="RuntimePlatform = $(RuntimePlatform)" />
<Message Importance="high" Text="ForwardPlatform = $(ForwardPlatform)" />
<Message Importance="high" Text="RuntimeIdentifier = $(RuntimeIdentifier)"/>
<Message Importance="high" Text=" " />
</Target>
</Project>