Repository navigation
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
114 lines (105 loc) · 9.1 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
114 lines (105 loc) · 9.1 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
107
108
109
110
111
112
113
114
<Project>
<PropertyGroup Condition="'$(WttsNativeAot)' == 'true'">
<DefineConstants>$(DefineConstants);WTTS_NATIVE_AOT</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(WttsUseSimdSkia)' == 'true'">
<DefineConstants>$(DefineConstants);WTTS_SIMD_SKIA</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(WttsStartupTrace)' == 'true'">
<DefineConstants>$(DefineConstants);STARTUP_WATCH_TRACE</DefineConstants>
</PropertyGroup>
<Target Name="WttsEmbedProjectSatelliteAssemblies" BeforeTargets="_ComputeIlcCompileInputs"
Condition="'$(WttsNativeAot)' == 'true' AND '$(PublishAot)' == 'true'">
<ItemGroup>
<ResolvedFileToPublish Condition="'%(ResolvedFileToPublish.Extension)' == '.dll' AND $([System.String]::Copy('%(ResolvedFileToPublish.Filename)').EndsWith('.resources'))">
<AssetType>resources</AssetType>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
<!-- Select portable variants before framework resolution so both JIT and native
publications avoid acquiring WPF solely through these utility dependencies. -->
<Target Name="WttsSelectPortableNativeDependencies" AfterTargets="ResolvePackageAssets" BeforeTargets="AddTransitiveFrameworkReferences"
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<ItemGroup>
<_WttsPortableCompile Include="@(ResolvedCompileFileDefinitions)" Condition="'%(NuGetPackageId)' == 'Splat.Drawing'">
<PortablePath>$(NuGetPackageRoot)splat.drawing\%(NuGetPackageVersion)\lib\net10.0\Splat.Drawing.dll</PortablePath>
</_WttsPortableCompile>
<_WttsPortableCompile Include="@(ResolvedCompileFileDefinitions)" Condition="'%(NuGetPackageId)' == 'Microsoft.VisualStudio.Threading.Only'">
<PortablePath>$(NuGetPackageRoot)microsoft.visualstudio.threading.only\%(NuGetPackageVersion)\lib\net8.0\Microsoft.VisualStudio.Threading.dll</PortablePath>
</_WttsPortableCompile>
<_WttsPortableRuntime Include="@(RuntimeCopyLocalItems)" Condition="'%(NuGetPackageId)' == 'Splat.Drawing'">
<PortablePath>$(NuGetPackageRoot)splat.drawing\%(NuGetPackageVersion)\lib\net10.0\Splat.Drawing.dll</PortablePath>
</_WttsPortableRuntime>
<_WttsPortableRuntime Include="@(RuntimeCopyLocalItems)" Condition="'%(NuGetPackageId)' == 'Microsoft.VisualStudio.Threading.Only'">
<PortablePath>$(NuGetPackageRoot)microsoft.visualstudio.threading.only\%(NuGetPackageVersion)\lib\net8.0\Microsoft.VisualStudio.Threading.dll</PortablePath>
</_WttsPortableRuntime>
</ItemGroup>
<Error Condition="'@(_WttsPortableCompile)' != '' AND !Exists('%(_WttsPortableCompile.PortablePath)')"
Text="Desktop publication requires the portable dependency: %(_WttsPortableCompile.PortablePath)" />
<Error Condition="'@(_WttsPortableRuntime)' != '' AND !Exists('%(_WttsPortableRuntime.PortablePath)')"
Text="Desktop publication requires the portable dependency: %(_WttsPortableRuntime.PortablePath)" />
<ItemGroup>
<ResolvedCompileFileDefinitions Remove="@(_WttsPortableCompile)" />
<ResolvedCompileFileDefinitions Include="@(_WttsPortableCompile->'%(PortablePath)')" />
<RuntimeCopyLocalItems Remove="@(_WttsPortableRuntime)" />
<RuntimeCopyLocalItems Include="@(_WttsPortableRuntime->'%(PortablePath)')" />
<TransitiveFrameworkReference Remove="Microsoft.WindowsDesktop.App;Microsoft.WindowsDesktop.App.WPF" />
</ItemGroup>
</Target>
<Target Name="WttsArchiveNativeSymbols" AfterTargets="ComputeFilesToPublish"
Condition="('$(WttsNativeAot)' == 'true' AND '$(PublishAot)' == 'true') OR '$(MSBuildProjectName)' == 'BD.WTTS.Client.Avalonia.App' OR '$(MSBuildProjectName)' == 'BD.WTTS.Client.Plugins.Accelerator.ReverseProxy'">
<PropertyGroup>
<_WttsNativeSymbolsDirectory Condition="'$(ArtifactsPath)' != ''">$(ArtifactsPath)/symbols/$(MSBuildProjectName)/$(RuntimeIdentifier)/</_WttsNativeSymbolsDirectory>
<_WttsNativeSymbolsDirectory Condition="'$(_WttsNativeSymbolsDirectory)' == ''">$(BaseOutputPath)native-symbols/$(Configuration)/$(TargetFramework)/$(RuntimeIdentifier)/</_WttsNativeSymbolsDirectory>
</PropertyGroup>
<ItemGroup>
<_WttsNativeSymbols Include="@(ResolvedFileToPublish)" Condition="'%(Extension)' == '.pdb' OR '%(Extension)' == '.dbg'" />
<ResolvedFileToPublish Remove="@(_WttsNativeSymbols)" />
</ItemGroup>
<Copy SourceFiles="@(_WttsNativeSymbols)" DestinationFiles="@(_WttsNativeSymbols->'$(_WttsNativeSymbolsDirectory)%(RelativePath)')" SkipUnchangedFiles="true" />
</Target>
<!-- These executables host themselves; the CoreCLR IIS in-process loader cannot host Native AOT. -->
<Target Name="WttsExcludeNativeIisHosting" AfterTargets="ComputeFilesToPublish"
Condition="'$(WttsNativeAot)' == 'true' AND '$(PublishAot)' == 'true'">
<ItemGroup>
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)"
Condition="'%(Filename)%(Extension)' == 'aspnetcorev2_inprocess.dll'" />
</ItemGroup>
</Target>
<!-- Precompile startup-heavy assemblies, not every SDK/API surface. Keep independent
IL assemblies and dynamic plugins; composite R2R and global trimming stay off. -->
<Target Name="WttsSelectStartupReadyToRunAssemblies" BeforeTargets="_PrepareForReadyToRunCompilation"
Condition="'$(MSBuildProjectName)' == 'BD.WTTS.Client.Avalonia.App' AND '$(PublishReadyToRun)' == 'true' AND '$(WttsNativeAot)' != 'true'">
<ItemGroup>
<_WttsIlOnlyAssembly Include="@(ResolvedFileToPublish)"
Condition="'%(ResolvedFileToPublish.Extension)' == '.dll' AND '%(ResolvedFileToPublish.Filename)' != 'Steam++' AND '%(ResolvedFileToPublish.Filename)' != 'BD.WTTS.Client' AND '%(ResolvedFileToPublish.Filename)' != 'BD.WTTS.Client.Avalonia' AND '%(ResolvedFileToPublish.Filename)' != 'Avalonia.Base' AND '%(ResolvedFileToPublish.Filename)' != 'Avalonia.Controls' AND '%(ResolvedFileToPublish.Filename)' != 'FluentAvalonia'" />
<PublishReadyToRunExclude Include="@(_WttsIlOnlyAssembly->'%(Filename)%(Extension)')" />
</ItemGroup>
</Target>
<!-- Windows development does not require the Apple workloads. Opt in for cross-platform builds. -->
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows')) AND '$(BuildAllTargetFrameworks)' != 'true' AND '$(WttsDesktopTargetFrameworks)' == '' AND $(TargetFrameworks.Contains('-windows')) AND $(TargetFrameworks.Contains('-macos'))">
<TargetFrameworks>$([MSBuild]::Unescape($([System.Text.RegularExpressions.Regex]::Replace('$(TargetFrameworks)', 'net[0-9.]+-(macos|maccatalyst)[0-9.]*;?', '').TrimEnd(';'))))</TargetFrameworks>
</PropertyGroup>
<!-- Limit platform projects when validating one desktop without changing plain .NET/resource projects. -->
<PropertyGroup Condition="'$(WttsDesktopTargetFrameworks)' != '' AND $(TargetFrameworks.Contains('-windows')) AND $(TargetFrameworks.Contains('-macos'))">
<TargetFrameworks>$([System.Text.RegularExpressions.Regex]::Replace('$(WttsDesktopTargetFrameworks)', '-.*', ''));$(WttsDesktopTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition="'$(MSBuildProjectName)' == 'BD.WTTS.Client.Avalonia' OR ($([System.String]::Copy('$(MSBuildProjectName)').StartsWith('BD.WTTS.Client.Plugins.')) AND '$(MSBuildProjectName)' != 'BD.WTTS.Client.Plugins.Accelerator.ReverseProxy' AND '$(MSBuildProjectName)' != 'BD.WTTS.Client.Plugins.Update')">
<Compile Include="$(MSBuildThisFileDirectory)src\FluentAvaloniaAliases.cs" Link="Properties\FluentAvaloniaAliases.cs" />
</ItemGroup>
<!-- SteamClient and the application must compile against the same formatter types. -->
<ItemGroup Condition="'$(MSBuildProjectFullPath)' == '$(MSBuildThisFileDirectory)ref\SteamClient\src\BD.SteamClient\BD.SteamClient.csproj'">
<PackageReference Remove="BD.Common" />
<ProjectReference Include="$(MSBuildThisFileDirectory)ref\Common\src\BD.Common\BD.Common.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(WttsNativeAot)' == 'true' AND '$(MSBuildProjectFullPath)' == '$(MSBuildThisFileDirectory)ref\WTTS.MicroServices.ClientSDK\src\BD.WTTS.MicroServices.ClientSDK\BD.WTTS.MicroServices.ClientSDK.csproj'">
<TargetFrameworks>net11.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition="'$(WttsNativeAot)' == 'true' AND '$(MSBuildProjectFullPath)' == '$(MSBuildThisFileDirectory)ref\WTTS.MicroServices.ClientSDK\src\BD.WTTS.MicroServices.ClientSDK\BD.WTTS.MicroServices.ClientSDK.csproj' AND $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0'))">
<PackageReference Remove="BD.Common;BD.Common.Primitives;BD.Common.ModelValidator" />
<ProjectReference Include="$(MSBuildThisFileDirectory)ref\Common\src\BD.Common\BD.Common.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)ref\Common\src\BD.Common.Primitives\BD.Common.Primitives.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)ref\Common\src\BD.Common.ModelValidator\BD.Common.ModelValidator.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)build/native-graphics/StaticGraphics.targets" Condition="'$(MSBuildProjectName)' == 'BD.WTTS.Client.Avalonia.App'" />
</Project>