forked from ClassIsland/ClassIsland
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrossPlatformProps.props
More file actions
60 lines (56 loc) · 3.12 KB
/
CrossPlatformProps.props
File metadata and controls
60 lines (56 loc) · 3.12 KB
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
<Project>
<PropertyGroup>
<PlatformNames_Windows>windows</PlatformNames_Windows>
<Os_IsWindows>$([System.OperatingSystem]::IsWindows())</Os_IsWindows>
<Os_IsLinux>$([System.OperatingSystem]::IsLinux())</Os_IsLinux>
<Os_IsMacOs>$([System.OperatingSystem]::IsMacOs())</Os_IsMacOs>
</PropertyGroup>
<!-- 发布时使用的平台设置,根据 CI 传入的参数自动设定相关设置 -->
<PropertyGroup>
<!-- fallback -->
<TargetFramework>$(BaseFramework)</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishBuilding)' == 'true' And '$(PublishPlatform)'=='linux'">
<Platforms_Linux>true</Platforms_Linux>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishBuilding)' == 'true' And '$(PublishPlatform)'=='windows'">
<Platforms_Windows>true</Platforms_Windows>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishBuilding)' == 'true' And '$(PublishPlatform)'=='macos'">
<Platforms_MacOs>true</Platforms_MacOs>
</PropertyGroup>
<!-- 开发时使用的平台设置,根据当前系统信息自动使用相关设置 -->
<PropertyGroup Condition="'$(PublishBuilding)' != 'true' And '$(Os_IsLinux)'=='true'">
<Platforms_Linux>true</Platforms_Linux>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishBuilding)' != 'true' And '$(Os_IsWindows)'=='true'">
<Platforms_Windows>true</Platforms_Windows>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishBuilding)' != 'true' And '$(Os_IsMacOs)'=='true'">
<Platforms_MacOs>true</Platforms_MacOs>
</PropertyGroup>
<PropertyGroup Condition="'$(Platforms_Windows)'=='true'">
<TargetFramework>$(BaseFramework)-windows10.0.19041.0</TargetFramework>
<DefineConstants>$(DefineConstants);Platforms_Windows</DefineConstants>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>Assets\AppLogo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Platforms_MacOs)'=='true'">
<TargetFramework>$(BaseFramework)-macos15.0</TargetFramework>
<DefineConstants>$(DefineConstants);Platforms_MacOs</DefineConstants>
<SupportedOSPlatformVersion>10.15</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Platforms_Windows)'=='true' And ('$(Configuration)'=='Release' Or '$(Configuration)'=='Release_MSIX')">
<OutputType>WinExe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(Platforms_Linux)'=='true'">
<DefineConstants>$(DefineConstants);Platforms_Linux</DefineConstants>
</PropertyGroup>
<Target Name="PrintPlatformInfo" BeforeTargets="Build;ProcessFrameworkReferences">
<Message Text="TargetFramework: $(TargetFramework)" Importance="high"/>
<Message Text="RuntimeIdentifier: $(RuntimeIdentifier)" Importance="high"/>
<Message Text="PublishBuilding: $(PublishBuilding)" Importance="high"/>
<Message Text="PublishPlatform: $(PublishPlatform)" Importance="high"/>
<Message Text="Os_IsWindows: $(Os_IsWindows)" Importance="high"/>
</Target>
</Project>