Files
Daybreak/Daybreak.API/Daybreak.API.csproj
T
2026-06-29 22:36:44 +02:00

126 lines
5.7 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>$(TargetFrameworkVersionWindows)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x86</RuntimeIdentifier>
<StripSymbols>true</StripSymbols>
<InteropExports>true</InteropExports>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>
<PublishAot>true</PublishAot>
<SelfContained>true</SelfContained>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<UseAppHost>false</UseAppHost>
<EnableIISSupport>false</EnableIISSupport>
<InvariantGlobalization>true</InvariantGlobalization>
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
<Platforms>x86</Platforms>
<!-- Prevent static web asset conflicts -->
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
<GenerateStaticWebAssetsManifest>false</GenerateStaticWebAssetsManifest>
<ResolveStaticWebAssetsInputsDependsOn>RemoveDuplicateStaticWebAssets;$(ResolveStaticWebAssetsInputsDependsOn)</ResolveStaticWebAssetsInputsDependsOn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<!-- Remove duplicate static web assets coming from referenced projects -->
<Target Name="RemoveDuplicateStaticWebAssets" BeforeTargets="ResolveStaticWebAssetsInputs;GenerateStaticWebAssetsManifest">
<ItemGroup>
<!-- Remove all blazor webview static assets since this is a Web API project, not a Blazor Hybrid app -->
<StaticWebAsset Remove="@(StaticWebAsset)"
Condition="$([System.String]::new('%(RelativePath)').Contains('blazor.modules')) Or $([System.String]::new('%(RelativePath)').Contains('blazor.webview'))" />
</ItemGroup>
</Target>
<PropertyGroup>
<!--Ignore trim warnings. NativeAOT support is still experimental so it should be tested with a Publish build generated from Daybreak build-->
<NoWarn>IL2104</NoWarn>
<NoWarn>IL3053</NoWarn>
<!--MinHook.NET does not contain sources for .NET, only .Net Framework. This has no impact on the functionality of the project-->
<NoWarn>NU1701</NoWarn>
</PropertyGroup>
<ItemGroup>
<Using Include="Daybreak.Generators" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Configuration\appsettings.Debug.json" />
<EmbeddedResource Include="Configuration\appsettings.json" />
<EmbeddedResource Include="Configuration\appsettings.Release.json" />
</ItemGroup>
<ItemGroup>
<!-- gwca.dll is a build-time codegen input only (PE exports + headers feed the binding generator); it is not copied or linked. -->
<AdditionalFiles Include="..\Dependencies\GWCA\gwca.dll" />
</ItemGroup>
<ItemGroup>
<!-- Statically link GWCA into the NativeAOT image instead of P/Invoking gwca.dll at runtime. -->
<DirectPInvoke Include="gwca.dll" />
<NativeLibrary Include="..\Dependencies\GWCA\gwca_static.lib" />
<NativeLibrary Include="..\Dependencies\GWCA\minhook.lib" />
<NativeLibrary Include="..\Dependencies\GWCA\d3d9.lib" />
<NativeLibrary Include="..\Dependencies\GWCA\d3dx9.lib" />
</ItemGroup>
<ItemGroup>
<!-- GWCA pulls in system imports beyond NativeAOT's default SDK lib set:
shell32 (CommandLineToArgvW, ShellExecuteW) and dbghelp (ImageNtHeader). -->
<SdkNativeLibrary Include="shell32.lib" />
<SdkNativeLibrary Include="dbghelp.lib" />
</ItemGroup>
<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<!--
NativeAOT win-x86 statically links GWCA via DirectPInvoke. NativeAOT decorates
cdecl P/Invoke targets with a leading underscore (_?Foo@GW@@...), but MSVC C++
exports have none (?Foo@GW@@...). The GWCA binding generator emits a matching
set of /ALTERNATENAME directives (Interop/GWCA.alternatenames.rsp) during
CoreCompile; feed them to lld-link before it runs.
-->
<Target Name="_AddGwcaAlternateNames"
BeforeTargets="LinkNative"
Condition="Exists('$(MSBuildProjectDirectory)/Interop/GWCA.alternatenames.rsp')">
<ReadLinesFromFile File="$(MSBuildProjectDirectory)/Interop/GWCA.alternatenames.rsp">
<Output TaskParameter="Lines" ItemName="LinkerArg" />
</ReadLinesFromFile>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="MinHook.NET" />
<PackageReference Include="Net.Sdk.Web.Extensions" />
<PackageReference Include="Net.Sdk.Web.Extensions.SourceGenerators" />
<PackageReference Include="PeNet" />
<PackageReference Include="Serilog" />
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Settings.Configuration" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Scalar.AspNetCore" />
<PackageReference Include="SystemExtensions.NetStandard.Generators" PrivateAssets="all" />
<PackageReference Include="ZLinq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Daybreak.Shared\Daybreak.Shared.csproj" />
<ProjectReference Include="..\Daybreak.Generators\Daybreak.Generators.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
UndefineProperties="RuntimeIdentifier;PublishAot;SelfContained;TargetFramework" />
</ItemGroup>
</Project>