Files
Nemera/plugins/Lumina.Plugins.Pdf/Lumina.Plugins.Pdf.csproj
T

48 lines
2.9 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\src\AssemblyInfo_Shared.cs" Link="Properties\AssemblyInfo_Shared.cs" />
</ItemGroup>
<Target Name="CopyToPluginsFolder" AfterTargets="Build">
<MakeDir Directories="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<!-- The native libraries of the dependencies ship for every platform and architecture under a runtimes\&lt;rid&gt;\native
subdirectory of the plugin output; only the ones of the runtime the host runs on are deployed, flattened into the plugins
directory, so that a wrong-architecture native library (for example the x86 pdfium next to a 64-bit host) is never copied. -->
<ItemGroup>
<_CurrentRidNatives Include="$(OutDir)runtimes\$(NETCoreSdkRuntimeIdentifier)\native\*" />
</ItemGroup>
<!-- The native libraries are what make the PDF reader work at runtime, so a build that produced none is a build that would deploy
a silently broken plugin; failing here makes a missing RuntimeIdentifier visible at build time instead of as a runtime
DllNotFoundException. -->
<Error Condition="'@(_CurrentRidNatives)' == ''" Text="No native libraries were produced under '$(OutDir)runtimes\$(NETCoreSdkRuntimeIdentifier)\native'. Build the Lumina.Plugins.Pdf project with an explicit runtime identifier (for example: dotnet build -r win-x64) so the PDF reader ships its native rendering libraries." />
<Copy SourceFiles="@(_CurrentRidNatives)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
</Target>
<ItemGroup>
<ProjectReference Include="..\..\src\Lumina.Plugins.Contracts\Lumina.Plugins.Contracts.csproj">
<Private>false</Private><!--Do not copy this assembly in the output directory, it's loaded from somewhere else.-->
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="PdfPig" />
<PackageReference Include="PDFtoImage" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>