-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
106 lines (93 loc) · 6.79 KB
/
Copy pathDirectory.Build.props
File metadata and controls
106 lines (93 loc) · 6.79 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
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
98
99
100
101
102
103
104
105
106
<?xml version='1.0' encoding='utf-8'?>
<Project>
<PropertyGroup>
<MajorVersion>6</MajorVersion>
<MinorVersion>1</MinorVersion>
<PatchVersion>1</PatchVersion>
<ReleaseVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</ReleaseVersion>
<WindowsVersion>$(ReleaseVersion).0</WindowsVersion>
<GitCommitHash>unknown</GitCommitHash>
<Authors>Bartosz Cichecki; Universal Device Toolkit Contributors</Authors>
<Company>Universal Device Toolkit Contributors</Company>
<ProjectCopyright>Lenovo Legion Toolkit copyright retained by Bartosz Cichecki and contributors; Universal Device Toolkit modifications Copyright (C) 2026 Universal Device Toolkit Contributors</ProjectCopyright>
<Copyright Condition="'$(Copyright)' == ''">$(ProjectCopyright)</Copyright>
<Version Condition="'$(Version)' == ''">$(ReleaseVersion)</Version>
<FileVersion Condition="'$(FileVersion)' == ''">$(WindowsVersion)</FileVersion>
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">$(WindowsVersion)</AssemblyVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<InformationalVersion>$(Version)+$(GitCommitHash)</InformationalVersion>
<SkipGitInfoLookup>$([System.String]::Copy('$(MSBuildThisFileDirectory)').StartsWith('\\wsl.localhost\', System.StringComparison.OrdinalIgnoreCase))</SkipGitInfoLookup>
<!--
Platform selection for the UDT app graph (Lib, Host, Lib.Macro, ...).
UDTWindows=true -> net10.0-windows10.0.26100.0 (Windows-only packages/APIs).
UDTWindows=false -> net10.0 (portable subset; Platform.Linux/MacOS backends).
Resolution order (first non-empty wins):
1. -p:UDTWindows=true|false (command line)
2. $env:UDT_PLATFORM (build.sh / CI): 'linux' or 'macos' forces portable,
'windows' (or unset) keeps the default for the host OS.
3. Host OS: Windows hosts default to UDTWindows=true, other hosts to false.
-->
<UDTWindows Condition="'$(UDTWindows)' == '' and '$(UDT_PLATFORM)' != '' and '$(UDT_PLATFORM)' != 'windows'">false</UDTWindows>
<UDTWindows Condition="'$(UDTWindows)' == '' and $([MSBuild]::IsOSPlatform('Windows'))">true</UDTWindows>
<UDTWindows Condition="'$(UDTWindows)' == ''">false</UDTWindows>
<UDTTargetFramework Condition="'$(UDTWindows)' == 'true'">net10.0-windows10.0.26100.0</UDTTargetFramework>
<UDTTargetFramework Condition="'$(UDTWindows)' != 'true'">net10.0</UDTTargetFramework>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<RestoreConfigFile Condition="'$(RestoreConfigFile)' == '' and Exists('$(MSBuildThisFileDirectory)NuGet.Config')">$(MSBuildThisFileDirectory)NuGet.Config</RestoreConfigFile>
<DefaultItemExcludes>$(DefaultItemExcludes);**/obj-*/**</DefaultItemExcludes>
<EnableUdtTestHooks Condition="'$(EnableUdtTestHooks)' == ''">false</EnableUdtTestHooks>
<DefineConstants Condition="'$(EnableUdtTestHooks)' == 'true'">$(DefineConstants);UDT_TEST_HOOKS</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(DefineConstants);LINUX</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<Nullable Condition="'$(Nullable)' == ''">enable</Nullable>
<ImplicitUsings Condition="'$(ImplicitUsings)' == ''">enable</ImplicitUsings>
<!-- Keep only languages shipped via LocalizationHelper / language packs.
Orphan Crowdin .resx cultures still live in source but are not compiled into satellites.
Culture names must use the BCP 47 canonical form (see CONTRIBUTING.md / Assert-CultureNaming.ps1). -->
<UdtSatelliteResourceLanguages>ar;bg;cs;de;el;en;es;fr;hu;it;ja;lv;nl-NL;pl;pt;pt-BR;ro;ru;sk;tr;uk;uz-Latn-UZ;vi;zh-Hans;zh-Hant</UdtSatelliteResourceLanguages>
<!-- Test projects keep all Crowdin satellites for pack/UI coverage. -->
<SatelliteResourceLanguages Condition="'$(SatelliteResourceLanguages)' == '' and '$(IsTestProject)' != 'true'">$(UdtSatelliteResourceLanguages)</SatelliteResourceLanguages>
</PropertyGroup>
<!--
Portable cross-platform projects must opt out before the Windows x64/win-x64 stamp.
Project-level DisableUdtForceX64=true is too late (props evaluate first), so detect by name.
Includes: CrossPlatform (CLI), Lib.Shared (extracted cross-platform business logic),
Lib.Abstractions (pure interfaces).
-->
<PropertyGroup Condition="$(MSBuildProjectName.Contains('CrossPlatform')) or $(MSBuildProjectName.Contains('Shared')) or $(MSBuildProjectName.Contains('Abstractions')) or $(MSBuildProjectName.Contains('Platform.Linux')) or $(MSBuildProjectName.Contains('Platform.MacOS')) or $(MSBuildProjectName.Contains('Platform.Windows.Core')) or $(MSBuildProjectName.Contains('Tests.Infrastructure'))">
<DisableUdtForceX64>true</DisableUdtForceX64>
</PropertyGroup>
<!--
Align processor architecture across the Windows app graph.
Shipping projects are win-x64 (AMD64). MSIL/AnyCPU consumers referencing them trigger MSB3270.
IMPORTANT: TargetFramework is often still empty when Directory.Build.props is evaluated
(set later in the .csproj). Gate on UDTTargetFramework so this applies early for Windows
projects. Portable CrossPlatform projects set DisableUdtForceX64 above and skip this.
Directory.Build.targets re-asserts after the project file when TargetFramework is known.
-->
<PropertyGroup Condition="'$(DisableUdtForceX64)' != 'true' and $(UDTTargetFramework.Contains('windows'))">
<Platforms>x64</Platforms>
<Platform Condition="'$(Platform)' == '' or '$(Platform)' == 'AnyCPU' or '$(Platform)' == 'Any CPU'">x64</Platform>
<PlatformTarget>x64</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(EnableUdtTestHooks)' == 'true'">
<ProjectReference>
<AdditionalProperties>%(AdditionalProperties);EnableUdtTestHooks=true</AdditionalProperties>
</ProjectReference>
</ItemDefinitionGroup>
<Target Name="GetGitInfo" BeforeTargets="BeforeBuild">
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" IgnoreExitCode="true" WorkingDirectory="$(MSBuildThisFileDirectory)" Condition="'$(SkipGitInfoLookup)' != 'True'">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHashRaw" />
</Exec>
<PropertyGroup>
<GitCommitHashRaw>$([System.String]::new($(GitCommitHashRaw)).Trim())</GitCommitHashRaw>
</PropertyGroup>
<PropertyGroup>
<GitCommitHash Condition=" '$(GitCommitHashRaw)' != '' ">$(GitCommitHashRaw)</GitCommitHash>
<InformationalVersion>$(Version)+$(GitCommitHash)</InformationalVersion>
</PropertyGroup>
</Target>
</Project>