mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
- embeds the append-only historical and deny trust lists in the API and marks matching bundled plugins as Official without blocking loading - builds and records the current plugin manifest only for official release builds - deploys the PDF native libraries for the supported Linux, macOS and Windows runtimes from the plugin dependency manifest - records release hashes by appending only missing entries to master's manifest and rejects any diff that removes a line - documents the release flow, the supported runtimes and the plugin installer limits
97 lines
7.6 KiB
XML
97 lines
7.6 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<ImplicitUsings>disable</ImplicitUsings>
|
|
<Nullable>enable</Nullable>
|
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<Compile Include="..\..\src\AssemblyInfo_Shared.cs" Link="Properties\AssemblyInfo_Shared.cs" />
|
|
</ItemGroup>
|
|
|
|
<!-- The supported runtimes come from the shared bundled plugin property. Each runtime also uses an OS family fallback folder, where the native dependency packages keep the libraries shared by every architecture of that operating system. -->
|
|
<Target Name="DefinePdfRuntimeLibraries">
|
|
<ItemGroup>
|
|
<_SupportedPdfRuntime Include="$(BundledPluginRuntimeIdentifiers)" />
|
|
<_WindowsPdfRuntime Include="@(_SupportedPdfRuntime)" Condition="$([System.String]::Copy('%(Identity)').StartsWith('win-'))">
|
|
<PdfFamily>win</PdfFamily>
|
|
</_WindowsPdfRuntime>
|
|
<_LinuxPdfRuntime Include="@(_SupportedPdfRuntime)" Condition="$([System.String]::Copy('%(Identity)').StartsWith('linux-'))">
|
|
<PdfFamily>linux</PdfFamily>
|
|
</_LinuxPdfRuntime>
|
|
<_MacOsPdfRuntime Include="@(_SupportedPdfRuntime)" Condition="$([System.String]::Copy('%(Identity)').StartsWith('osx-'))">
|
|
<PdfFamily>osx</PdfFamily>
|
|
</_MacOsPdfRuntime>
|
|
<_UnknownPdfRuntime Include="@(_SupportedPdfRuntime)" />
|
|
<_UnknownPdfRuntime Remove="@(_WindowsPdfRuntime);@(_LinuxPdfRuntime);@(_MacOsPdfRuntime)" />
|
|
<_PdfFamilyRuntime Include="win" Condition="'@(_WindowsPdfRuntime)' != ''" />
|
|
<_PdfFamilyRuntime Include="linux" Condition="'@(_LinuxPdfRuntime)' != ''" />
|
|
<_PdfFamilyRuntime Include="linux-musl" Condition="'@(_LinuxPdfRuntime)' != ''" />
|
|
<_PdfFamilyRuntime Include="osx" Condition="'@(_MacOsPdfRuntime)' != ''" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="CopyToPluginsFolder" AfterTargets="Build">
|
|
<MakeDir Directories="$(_PluginsDestination)" />
|
|
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
|
|
<Copy SourceFiles="@(_PluginsReferenceCopyLocalPath)" DestinationFolder="$(_PluginsDestination)%(_PluginsReferenceCopyLocalPath.DestinationSubDirectory)" />
|
|
</Target>
|
|
|
|
<!-- Keeps the native runtime folders of every supported runtime and of its OS family fallback, and removes the flat native copies so the dependency manifest selects the right library for the host. The plugins folder is shared with the other bundled plugins, so only folders that contain the PDF native libraries are pruned. -->
|
|
<Target Name="PrunePdfNativeRuntimes" AfterTargets="Build" DependsOnTargets="DefinePdfRuntimeLibraries;SetPluginsDestination;CopyToPluginsFolder">
|
|
<ItemGroup>
|
|
<_CopiedRuntimeDirectory Include="$([System.IO.Directory]::GetDirectories('$(_PluginsDestination)runtimes'))" />
|
|
<_CopiedPdfRuntimeDirectory Include="@(_CopiedRuntimeDirectory)" Condition="Exists('%(Identity)/native/pdfium.dll') Or Exists('%(Identity)/native/libpdfium.so') Or Exists('%(Identity)/native/libpdfium.dylib') Or Exists('%(Identity)/native/libSkiaSharp.dll') Or Exists('%(Identity)/native/libSkiaSharp.so') Or Exists('%(Identity)/native/libSkiaSharp.dylib')" />
|
|
<_CopiedPdfRuntimeDirectory Remove="@(_SupportedPdfRuntime)" MatchOnMetadata="Filename" />
|
|
<_CopiedPdfRuntimeDirectory Remove="@(_PdfFamilyRuntime)" MatchOnMetadata="Filename" />
|
|
<_RootPdfNativeFile Include="$(_PluginsDestination)pdfium.dll;$(_PluginsDestination)libpdfium.so;$(_PluginsDestination)libpdfium.dylib;$(_PluginsDestination)libSkiaSharp.dll;$(_PluginsDestination)libSkiaSharp.so;$(_PluginsDestination)libSkiaSharp.dylib" />
|
|
</ItemGroup>
|
|
<RemoveDir Directories="@(_CopiedPdfRuntimeDirectory)" />
|
|
<Delete Files="@(_RootPdfNativeFile)" TreatErrorsAsWarnings="true" />
|
|
</Target>
|
|
|
|
<!-- The PDF plugin needs both native libraries for every supported runtime. A library satisfies the requirement when it is in the runtime's own folder or in its OS family fallback folder, which is how the macOS packages split SkiaSharp from pdfium. Deriving the list from the shared property makes adding a runtime without the matching package libraries fail the build. -->
|
|
<Target Name="ValidatePdfNativeLibraries" AfterTargets="Build" DependsOnTargets="PrunePdfNativeRuntimes">
|
|
<Error Condition="'@(_UnknownPdfRuntime)' != ''" Text="The bundled plugin runtime identifiers must be real runtime identifiers starting with win-, linux- or osx-, and must not list OS family fallback folders: @(_UnknownPdfRuntime)" />
|
|
<ItemGroup>
|
|
<_MissingPdfNativeLibrary Include="@(_WindowsPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/pdfium.dll') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/pdfium.dll')">
|
|
<PdfNativeLibrary>pdfium.dll</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
<_MissingPdfNativeLibrary Include="@(_WindowsPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/libSkiaSharp.dll') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/libSkiaSharp.dll')">
|
|
<PdfNativeLibrary>libSkiaSharp.dll</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
<_MissingPdfNativeLibrary Include="@(_LinuxPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/libpdfium.so') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/libpdfium.so')">
|
|
<PdfNativeLibrary>libpdfium.so</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
<_MissingPdfNativeLibrary Include="@(_LinuxPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/libSkiaSharp.so') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/libSkiaSharp.so')">
|
|
<PdfNativeLibrary>libSkiaSharp.so</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
<_MissingPdfNativeLibrary Include="@(_MacOsPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/libpdfium.dylib') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/libpdfium.dylib')">
|
|
<PdfNativeLibrary>libpdfium.dylib</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
<_MissingPdfNativeLibrary Include="@(_MacOsPdfRuntime)" Condition="!Exists('$(_PluginsDestination)runtimes/%(Identity)/native/libSkiaSharp.dylib') And !Exists('$(_PluginsDestination)runtimes/%(PdfFamily)/native/libSkiaSharp.dylib')">
|
|
<PdfNativeLibrary>libSkiaSharp.dylib</PdfNativeLibrary>
|
|
</_MissingPdfNativeLibrary>
|
|
</ItemGroup>
|
|
<Error Condition="'@(_MissingPdfNativeLibrary)' != ''" Text="The PDF plugin is missing required native libraries (runtime: library): @(_MissingPdfNativeLibrary->'%(Identity): %(PdfNativeLibrary)')" />
|
|
</Target>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\..\src\Nemera.Plugins.Contracts\Nemera.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>
|