Repository navigation
Expand file tree
/
Copy pathOrgZ.csproj
More file actions
249 lines (236 loc) · 13.5 KB
/
Copy pathOrgZ.csproj
File metadata and controls
249 lines (236 loc) · 13.5 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Version>0.17.23</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>Assets\app.ico</ApplicationIcon>
<IsWindowsBuild Condition="$(RuntimeIdentifier.StartsWith('win')) OR ($([MSBuild]::IsOSPlatform('Windows')) AND '$(RuntimeIdentifier)' == '')">true</IsWindowsBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindowsBuild)' == 'true'">
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
<!-- The Nano 5G CDB skeleton is loaded by a Service (must work headless / in tests too), so it's
a plain embedded resource rather than an Avalonia asset, which needs the running app's
AssetLoader. -->
<AvaloniaResource Remove="Assets\nano5g-cdb-skeleton.cdb" />
<EmbeddedResource Include="Assets\nano5g-cdb-skeleton.cdb">
<LogicalName>OrgZ.nano5g-cdb-skeleton.cdb</LogicalName>
</EmbeddedResource>
</ItemGroup>
<!-- Exclude the test project + tools/ helpers (both live in subfolders of the OrgZ root). -->
<ItemGroup>
<Compile Remove="OrgZ.Tests\**" />
<EmbeddedResource Remove="OrgZ.Tests\**" />
<None Remove="OrgZ.Tests\**" />
<AvaloniaResource Remove="OrgZ.Tests\**" />
<AvaloniaXaml Remove="OrgZ.Tests\**" />
<Compile Remove="tools\**" />
<EmbeddedResource Remove="tools\**" />
<None Remove="tools\**" />
<AvaloniaResource Remove="tools\**" />
<AvaloniaXaml Remove="tools\**" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\app.ico" />
</ItemGroup>
<!-- Ship the third-party binary license notices next to the app (LGPL/BSD compliance for the
bundled ffmpeg/flac/lame). Included in every build/publish regardless of RID. -->
<ItemGroup>
<Content Include="licenses\**\*" Link="licenses\%(RecursiveDir)%(Filename)%(Extension)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="12.0.3" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="12.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="12.0.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.3" />
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="LibVLCSharp" Version="3.9.4" />
<PackageReference Include="Optris.Icons.Avalonia" Version="12.0.4" />
<PackageReference Include="Optris.Icons.Avalonia.FontAwesome" Version="12.0.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.7" />
<!-- Pin the native SQLite past NU1903 (GHSA-2m69-gcr7-jv3q). Microsoft.Data.Sqlite 9.0.x
transitively pins lib.e_sqlite3 2.1.10, and the whole 2.1.x line (<= 2.1.11) is flagged;
the fix only lands in the 3.0.x native. Override JUST the native binary - the managed
core stays 2.1.10 as Microsoft.Data.Sqlite expects, and the SQLite C ABI core P/Invokes
is stable across the two, so nothing else has to move. -->
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="3.50.3" />
<PackageReference Include="Serilog" Version="4.2.0" />
<!-- SVG rasterization for station logos / remote artwork; Avalonia can't decode SVG natively. -->
<PackageReference Include="Svg.Skia" Version="3.2.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="TagLibSharp" Version="2.3.0" />
<!-- Kept in lockstep with the `vpk` pin in .github/workflows/release.yml. The CLI writes
Update.exe and the release feed; this library reads them from inside the app, and a
0.0.x client against a 1.2.x feed is a mismatched pair nobody tests. 1.2.110 also has
a real net10.0 target, where 0.0.1298 topped out at net8.0. -->
<PackageReference Include="Velopack" Version="1.2.110-ge826545" />
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.21" Condition="'$(IsWindowsBuild)' == 'true'" />
<PackageReference Include="System.Management" Version="9.0.1" Condition="'$(IsWindowsBuild)' == 'true'" />
<!-- ServiceBase: lets the device-helper answer the Windows SCM control dispatcher so
`sc start OrgZDeviceHelper` doesn't time out (error 1053). Windows-only. -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.1" Condition="'$(IsWindowsBuild)' == 'true'" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Update="Controls\RadioFilterPanel.axaml.cs">
<DependentUpon>RadioFilterPanel.axaml</DependentUpon>
</Compile>
<Compile Update="Controls\DeviceInfoBar.axaml.cs">
<DependentUpon>DeviceInfoBar.axaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Using Include="Avalonia.Threading" />
<Using Include="CommunityToolkit.Mvvm.ComponentModel" />
<Using Include="CommunityToolkit.Mvvm.Input" />
<Using Include="OrgZ.Controls" />
<Using Include="OrgZ.Models" />
<Using Include="OrgZ.Services" />
<Using Include="OrgZ.Helpers" />
<Using Include="OrgZ.Views" />
<Using Include="System.Collections.ObjectModel" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="OrgZ.Tests" />
<InternalsVisibleTo Include="DocsScreenshots" />
<InternalsVisibleTo Include="AirPlayLab" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FoxRedbook" Version="1.0.0-alpha.3" />
<PackageReference Include="FoxOrangebook" Version="1.0.0-alpha.11" />
</ItemGroup>
<!-- Drop the libvlc plugin categories a MUSIC player never loads.
Measured cost: `new LibVLC()` scans this directory to build its plugin cache, and on
a first run - cold disk, every DLL virus-scanned as it's touched - that took TWENTY
SECONDS on a clean Windows install, versus ~5 s for the whole rest of startup. The
scan is per-file, so removing files is what makes it faster; the ~35 MB saved is a
bonus.
Mirrors the policy scripts/fetch-vlc-mac.sh already applies on macOS, so both
platforms ship the same engine. Audio, access, demux, packetizer and codec all STAY -
codec holds the audio decoders alongside the video ones and can't be dropped wholesale. -->
<Target Name="TrimVlcPluginsOnPublish"
AfterTargets="Publish"
Condition="'$(IsWindowsBuild)' == 'true' And Exists('$(PublishDir)libvlc')">
<ItemGroup>
<_VlcPluginRoot Include="$(PublishDir)libvlc\win-x64\plugins" />
<!-- Video rendering, subtitles, muxing and streaming out: OrgZ does none of it,
and the VU meter is our own FFT rather than libvlc's visualizers. -->
<_UnusedVlcCategory Include="video_output;video_filter;video_chroma;video_splitter" />
<_UnusedVlcCategory Include="d3d11;d3d9" />
<_UnusedVlcCategory Include="visualization" />
<_UnusedVlcCategory Include="spu;text_renderer" />
<_UnusedVlcCategory Include="stream_out;mux;access_output" />
<_UnusedVlcFile Include="@(_UnusedVlcCategory->'$(PublishDir)libvlc\win-x64\plugins\%(Identity)\**\*')" />
</ItemGroup>
<Message Importance="high" Text="Trimming unused libvlc plugin categories: @(_UnusedVlcCategory, ', ')" />
<Delete Files="@(_UnusedVlcFile)" ContinueOnError="true" />
<RemoveDir Directories="@(_UnusedVlcCategory->'$(PublishDir)libvlc\win-x64\plugins\%(Identity)')" ContinueOnError="true" />
</Target>
<!-- Strip runtime-specific native payloads we never load on the current OS.
dotnet build emits every RID a referenced package supports - ~500 MB of
Windows + Linux + musl + wasm + maccatalyst variants we'll never touch
on a macOS dev box, and vice versa. The strip is per-host (each OS keeps
its own runtimes and the shared "unix" bucket) and runs after every
build, so `bin/Debug` doesn't bloat to 600 MB every session. -->
<Target Name="StripUnusedRuntimes" AfterTargets="Build" Condition="Exists('$(OutDir)runtimes')">
<Exec Condition="$([MSBuild]::IsOSPlatform('OSX'))"
Command="find "$(OutDir)runtimes" -mindepth 1 -maxdepth 1 -type d ! -name 'osx*' ! -name 'unix' -exec rm -rf {} +"
ConsoleToMsBuild="true"
IgnoreExitCode="true" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Linux'))"
Command="find "$(OutDir)runtimes" -mindepth 1 -maxdepth 1 -type d ! -name 'linux*' ! -name 'unix' -exec rm -rf {} +"
ConsoleToMsBuild="true"
IgnoreExitCode="true" />
<!-- Windows: PowerShell removes anything that isn't a win-* or "unix"
bucket. Quoting is fussy because MSBuild expands $(OutDir) with a
trailing slash; the inner ${} keeps PowerShell happy. -->
<Exec Condition="$([MSBuild]::IsOSPlatform('Windows'))"
Command="powershell -NoProfile -Command "Get-ChildItem -LiteralPath '$(OutDir)runtimes' -Directory | Where-Object { $_.Name -notlike 'win*' -and $_.Name -ne 'unix' } | Remove-Item -Recurse -Force""
ConsoleToMsBuild="true"
IgnoreExitCode="true" />
</Target>
<!-- Bundle Linux flac/lame binaries next to the build output. Picked up at
runtime by RipEncoder.ResolveExecutable as the fallback when neither
binary is found on PATH - the case AppImage installs hit on distros
without flac/lame preinstalled. The repo tools/linux-x64/ directory
ships only a README; whoever produces the AppImage is expected to
drop static-linked binaries in there (see tools/linux-x64/README.md).
If the directory has nothing copyable, MSBuild's no-match is silent
and dev builds still work via PATH. -->
<ItemGroup>
<LinuxEncoderBinary Include="tools\linux-x64\*"
Exclude="tools\linux-x64\*.md;tools\linux-x64\.gitkeep" />
</ItemGroup>
<Target Name="BundleLinuxEncoders"
AfterTargets="Build"
Condition="$([MSBuild]::IsOSPlatform('Linux')) Or $(RuntimeIdentifier.StartsWith('linux-'))"
Inputs="@(LinuxEncoderBinary)"
Outputs="@(LinuxEncoderBinary->'$(OutDir)tools\%(Filename)%(Extension)')">
<Copy SourceFiles="@(LinuxEncoderBinary)"
DestinationFolder="$(OutDir)tools"
SkipUnchangedFiles="true" />
<!-- ELFs need the executable bit. .NET's Copy doesn't preserve mode,
so set it explicitly. No-op on files that were never copied. -->
<Exec Command="chmod +x "$(OutDir)tools"/*"
Condition="'@(LinuxEncoderBinary)' != ''"
IgnoreExitCode="true" />
</Target>
<!-- Windows counterpart: bundle flac.exe / lame.exe so ripping works without a
separate install. RipEncoder.ResolveExecutable falls back to
{BaseDirectory}/tools/{name}.exe, which the *elevated* rip helper resolves
too (it's the same OrgZ.exe), so this is the only place the UAC'd encoder
can reliably find the binaries. Populate tools\win-x64\ via
scripts/fetch-encoders.ps1. Empty dir = silent no-op (dev falls back to PATH). -->
<ItemGroup>
<WindowsEncoderBinary Include="tools\win-x64\*"
Exclude="tools\win-x64\*.md;tools\win-x64\.gitkeep;tools\win-x64\.gitignore" />
</ItemGroup>
<Target Name="BundleWindowsEncoders"
AfterTargets="Build"
Condition="$([MSBuild]::IsOSPlatform('Windows')) Or $(RuntimeIdentifier.StartsWith('win'))"
Inputs="@(WindowsEncoderBinary)"
Outputs="@(WindowsEncoderBinary->'$(OutDir)tools\%(Filename)%(Extension)')">
<Copy SourceFiles="@(WindowsEncoderBinary)"
DestinationFolder="$(OutDir)tools"
SkipUnchangedFiles="true" />
</Target>
<!-- Publish-time bundling: the AfterBuild copies above land tools/ in bin/ (so `dotnet run`
during dev finds them), but `dotnet publish` doesn't carry them into the publish output.
This copies the target RID's fetched media tools (ffmpeg, flac, lame) into publish/tools/
so they ship in the Velopack package. release.yml runs scripts/fetch-encoders.ps1 to
populate tools/<rid>/ before publish; ExecutableResolver finds them at BaseDirectory/tools. -->
<Target Name="BundleMediaToolsOnPublish"
AfterTargets="Publish"
Condition="'$(RuntimeIdentifier)' != '' And Exists('$(MSBuildProjectDirectory)/tools/$(RuntimeIdentifier)')">
<ItemGroup>
<_PublishMediaTool Include="tools/$(RuntimeIdentifier)/*"
Exclude="tools/$(RuntimeIdentifier)/*.md;tools/$(RuntimeIdentifier)/.gitignore;tools/$(RuntimeIdentifier)/.gitkeep" />
</ItemGroup>
<Copy SourceFiles="@(_PublishMediaTool)"
DestinationFolder="$(PublishDir)tools"
SkipUnchangedFiles="true"
Condition="'@(_PublishMediaTool)' != ''" />
<!-- ELF/Mach-O binaries need the executable bit; .NET's Copy doesn't preserve mode. -->
<Exec Command="chmod +x '$(PublishDir)tools'/*"
Condition="'@(_PublishMediaTool)' != '' And !$([MSBuild]::IsOSPlatform('Windows'))"
IgnoreExitCode="true" />
</Target>
</Project>