Adds bundled plugin trust and cross-platform native deployment

- 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
This commit is contained in:
BinaryAlley committed 2026-11-28 18:00:00 +02:00
1 parent 3fb8912c7f
commit b30cbd6b9e
114 files changed
+2708 -243

No files matched your search

+5
View File
@@ -1,6 +1,11 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..'))" />
<!-- Shared warning and documentation policy for every plugin project under plugins. -->
<PropertyGroup>
<BaseOutputPath>$(RepoRoot)bin/plugins/</BaseOutputPath>
<!-- The real runtime identifiers the release artifact supports. Every bundled plugin with native dependencies must provide its libraries for each of them. The OS family fallback folders, such as osx, are kept automatically. -->
<BundledPluginRuntimeIdentifiers>win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;osx-x64;osx-arm64</BundledPluginRuntimeIdentifiers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>$(WarningsAsErrors);CS1591</WarningsAsErrors><!--Public members must have XML documentation.-->
+18
View File
@@ -0,0 +1,18 @@
<Project>
<!-- The release orchestrator passes the plugin deployment destination. The default is used by solution builds and plugin tests. -->
<Target Name="SetPluginsDestination" BeforeTargets="CopyToPluginsFolder">
<PropertyGroup>
<_PluginsDestination Condition="'$(NemeraPluginsOutputDirectory)' != ''">$(NemeraPluginsOutputDirectory)</_PluginsDestination>
<_PluginsDestination Condition="'$(NemeraPluginsOutputDirectory)' == ''">$(RepoRoot)bin/api/$(Configuration)/$(TargetFramework)/plugins/</_PluginsDestination>
</PropertyGroup>
</Target>
<!-- Deploys the dependency manifest next to the plugin, so the host native resolver can use it. The PDF plugin prunes the native runtime folders to the supported list after the copy. -->
<Target Name="PreparePluginsCopy" BeforeTargets="CopyToPluginsFolder" DependsOnTargets="SetPluginsDestination">
<ItemGroup>
<_PluginsReferenceCopyLocalPath Include="@(ReferenceCopyLocalPaths)" />
</ItemGroup>
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetDir)$(TargetName).deps.json" DestinationFolder="$(_PluginsDestination)" Condition="Exists('$(TargetDir)$(TargetName).deps.json')" />
</Target>
</Project>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
@@ -12,8 +11,8 @@
</ItemGroup>
<Target Name="CopyToPluginsFolder" AfterTargets="Build">
<MakeDir Directories="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@@ -13,9 +12,9 @@
</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\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
<Copy SourceFiles="@(_PluginsReferenceCopyLocalPath)" DestinationFolder="$(_PluginsDestination)%(_PluginsReferenceCopyLocalPath.DestinationSubDirectory)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
@@ -12,8 +11,8 @@
</ItemGroup>
<Target Name="CopyToPluginsFolder" AfterTargets="Build">
<MakeDir Directories="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@@ -13,9 +12,9 @@
</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\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
<Copy SourceFiles="@(_PluginsReferenceCopyLocalPath)" DestinationFolder="$(_PluginsDestination)%(_PluginsReferenceCopyLocalPath.DestinationSubDirectory)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@@ -13,9 +12,9 @@
</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\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
<Copy SourceFiles="@(_PluginsReferenceCopyLocalPath)" DestinationFolder="$(_PluginsDestination)%(_PluginsReferenceCopyLocalPath.DestinationSubDirectory)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@@ -13,9 +12,9 @@
</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\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
<Copy SourceFiles="@(_PluginsReferenceCopyLocalPath)" DestinationFolder="$(_PluginsDestination)%(_PluginsReferenceCopyLocalPath.DestinationSubDirectory)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
@@ -12,8 +11,8 @@
</ItemGroup>
<Target Name="CopyToPluginsFolder" AfterTargets="Build">
<MakeDir Directories="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SolutionDir)..\bin\api\$(Configuration)\$(TargetFramework)\plugins\" />
<MakeDir Directories="$(_PluginsDestination)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(_PluginsDestination)" />
</Target>
<ItemGroup>
@@ -3,7 +3,6 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)..\bin\plugins\</BaseOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@@ -12,21 +11,71 @@
<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. -->
<!-- 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>
<_CurrentRidNatives Include="$(OutDir)runtimes\$(NETCoreSdkRuntimeIdentifier)\native\*" />
<_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>
<!-- 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 Nemera.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>
<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>