Trim verbose comments across JPDFium integration

This commit is contained in:
Anthony Stirling
2026-05-21 19:03:31 +01:00
parent 007c8e17de
commit 29ccbf7ae6
12 changed files with 116 additions and 395 deletions
+2 -6
View File
@@ -256,9 +256,7 @@ jobs:
if: matrix.platform == 'macos-15'
env:
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
# universal-mac transitively triggers jlink:jar; pin the JPDFium
# natives to both darwin arches so the x86_64 half of the
# universal bundle has dlopen-able libs at runtime.
# Both darwin arches for the universal bundle.
JPDFIUM_PLATFORMS: ${{ matrix.jpdfium_platforms }}
run: task desktop:jlink:universal-mac
@@ -268,9 +266,7 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLIC_URL: ${{ secrets.MAVEN_PUBLIC_URL }}
DISABLE_ADDITIONAL_FEATURES: true
# Tell jlink:jar to bundle only this matrix entry's JPDFium natives
# into the bootJar — saves ~45 MB out of the ~58 MB JPDFium overhead
# per Tauri bundle vs shipping all 5 OSes.
# Bundle only this matrix entry's natives; saves ~45 MB per Tauri bundle.
JPDFIUM_PLATFORMS: ${{ matrix.jpdfium_platforms }}
run: task desktop:prepare
+10 -27
View File
@@ -47,17 +47,13 @@ jobs:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
PLATFORM: ${{ inputs.platform }}
run: |
# jpdfium_platforms: comma-separated subset of JPDFium natives to bundle into
# the per-matrix bootJar — Tauri bundles only run on the OS they were built
# for, so shipping foreign-OS natives wastes ~45 MB. macOS uses both
# darwin-arm64 + darwin-x64 because the --target universal-apple-darwin
# bundle is fat (both archs in one .app).
# jpdfium_platforms: subset of JPDFium natives to bundle into this matrix entry's bootJar.
# macOS gets both darwin arches because universal-apple-darwin is a fat bundle.
WINDOWS='{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64","jpdfium_platforms":"windows-x64"}'
MACOS='{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal","jpdfium_platforms":"darwin-arm64,darwin-x64"}'
LINUX='{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64","jpdfium_platforms":"linux-x64"}'
# Resolve requested platform — populated by either workflow_dispatch
# or workflow_call inputs; both paths default to "all".
# Resolve requested platform (workflow_dispatch or workflow_call inputs; default "all").
case "$PLATFORM" in
windows) ENTRIES=("$WINDOWS") ;;
macos) ENTRIES=("$MACOS") ;;
@@ -117,10 +113,8 @@ jobs:
toolchain: stable
targets: ${{ matrix.platform == 'macos-15' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
# x86_64 JDK is set up first so the aarch64 step below can leave its
# JAVA_HOME as the active one. The macOS universal JRE build needs
# jmods from both arches; the x64 path is captured into the env
# before the second setup-java overwrites JAVA_HOME.
# Capture x86_64 JAVA_HOME before the next setup-java overwrites it; the universal
# JRE build needs jmods from both arches.
- name: Set up x86_64 JDK 25 (macOS universal JRE)
if: matrix.platform == 'macos-15'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
@@ -147,16 +141,12 @@ jobs:
- name: Setup Task
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0
# Build the universal JRE before desktop:prepare so the jlink:runtime
# task short-circuits on its `test -d runtime/jre` status check.
# Build the universal JRE before desktop:prepare so jlink:runtime short-circuits.
- name: Build universal macOS JRE
if: matrix.platform == 'macos-15'
env:
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
# universal-mac calls jlink:jar transitively → bootJar build needs
# both darwin natives. Without this it'd default to host-arch only
# and the x86_64 half of the universal bundle would crash on ICU
# / qpdf / harfbuzz dlopen at startup.
# Both darwin arches for the universal bundle.
JPDFIUM_PLATFORMS: ${{ matrix.jpdfium_platforms }}
run: task desktop:jlink:universal-mac
@@ -166,9 +156,7 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLIC_URL: ${{ secrets.MAVEN_PUBLIC_URL }}
DISABLE_ADDITIONAL_FEATURES: true
# Tell jlink:jar (called transitively) to bundle only this matrix
# entry's natives into the bootJar — saves ~45 MB out of the
# ~58 MB JPDFium overhead per bundle vs shipping all 5 OSes.
# Bundle only this matrix entry's natives; saves ~45 MB per Tauri bundle.
JPDFIUM_PLATFORMS: ${{ matrix.jpdfium_platforms }}
run: task desktop:prepare
@@ -284,13 +272,8 @@ jobs:
echo "Certificate imported successfully."
- name: Sign JPDFium dylibs inside bootJar (macOS only)
# JPDFium's publish workflow has no Apple Developer credentials, so
# the .dylibs it ships in jpdfium-natives-darwin-*.jar are unsigned.
# Apple's notarytool walks into nested .jars inside the .app and
# rejects unsigned binaries. Tauri's own codesign walk doesn't open
# .jars, so we have to re-sign them here, between cert import and
# tauri-action, using this build's Developer ID identity (set in
# GITHUB_ENV by the Verify Certificate step above).
# JPDFium ships unsigned dylibs; notarytool rejects them inside the .app.
# APPLE_SIGNING_IDENTITY is exported by the Verify Certificate step above.
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
run: bash frontend/scripts/sign-jpdfium-dylibs-in-bootjar.sh