Files
DorkNet/cli/DorkNet.ServerCli/DorkNet.ServerCli.csproj
Alexa d3ca1f9297 fix(cli): exit 0 on --help so CI smoke test passes (#13)
* fix(cli): exit 0 on --help, handle parse errors cleanly

--help printed usage but returned exit code 1, failing the CI smoke test. Treat --help / -h / no-args as a successful usage print (exit 0), and catch parser ArgumentExceptions so a missing value or bad --mode exits 1 with a message instead of an unhandled crash.

* fix(cli): declare RuntimeIdentifiers so no-restore publish works

CI restores without a RID then publishes per-RID with no-restore, which failed NETSDK1047 because the assets file had no RID targets. Declaring RuntimeIdentifiers makes the RID-less restore cover all of them.
2026-06-16 01:04:45 +03:00

80 lines
3.3 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Plain net9.0 (no -windows) so this publishes for Linux + macOS
alongside Windows. The shared Backend classes are written to
OperatingSystem.IsWindows()-gate any Windows-only paths. -->
<TargetFramework>net9.0</TargetFramework>
<!-- Declared so a RID-less restore produces assets for every target the
CI matrix / release pipeline later publishes with no-restore. Without
this, RID-specific publish fails with NETSDK1047. -->
<RuntimeIdentifiers>win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>DorkNet.ServerCli</RootNamespace>
<AssemblyName>dorknet-server</AssemblyName>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.4" />
</ItemGroup>
<!-- Link the relevant Backend files from the launcher project. They
live in the launcher's namespace (DorkNet.Launcher.Backend) and
avoid Windows-specific APIs, so they compile cleanly under the
cross-platform target framework. -->
<ItemGroup>
<Compile Include="..\..\launcher\Backend\AppPaths.cs">
<Link>Backend\AppPaths.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\AppState.cs">
<Link>Backend\AppState.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\JoinCode.cs">
<Link>Backend\JoinCode.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\LocalNetwork.cs">
<Link>Backend\LocalNetwork.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\LocalOverrides.cs">
<Link>Backend\LocalOverrides.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\ReleaseDownloader.cs">
<Link>Backend\ReleaseDownloader.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\ServerProcess.cs">
<Link>Backend\ServerProcess.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\TunneltoTunnel.cs">
<Link>Backend\TunneltoTunnel.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\TunneltoInstaller.cs">
<Link>Backend\TunneltoInstaller.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\LocaltunnelTunnel.cs">
<Link>Backend\LocaltunnelTunnel.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\LocaltunnelInstaller.cs">
<Link>Backend\LocaltunnelInstaller.cs</Link>
</Compile>
<Compile Include="..\..\launcher\Backend\VersionsManifest.cs">
<Link>Backend\VersionsManifest.cs</Link>
</Compile>
</ItemGroup>
<!-- Pull versions.json next to the binary so dev checkouts work
without env-var overrides. Same trick the launcher uses. -->
<ItemGroup>
<None Include="..\..\versions.json" Condition="Exists('..\..\versions.json')">
<Link>versions.json</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>