From 153dde8291f2d9b6773fcf86670b7da38b052cf9 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Mon, 6 Jul 2026 09:28:07 +0200 Subject: [PATCH] Add Windows support to desktop JAR copy task Split the JAR copy command into platform-specific implementations. Unix systems (linux/darwin) use `cp`, while Windows uses PowerShell's Copy-Item with proper directory creation and glob handling. This fixes the desktop build on Windows by replacing the Unix-only `cp` command with a compatible PowerShell equivalent. --- .taskfiles/desktop.yml | 5 ++++- frontend/editor/scripts/verify-bundled-jre.mjs | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.taskfiles/desktop.yml b/.taskfiles/desktop.yml index abddf6f673..b745ed4cfd 100644 --- a/.taskfiles/desktop.yml +++ b/.taskfiles/desktop.yml @@ -166,7 +166,10 @@ tasks: - cmd: './gradlew bootJar --no-daemon -PjpdfiumPlatforms={{.JPDFIUM_PLATFORMS}}' platforms: [linux, darwin] - mkdir -p frontend/editor/src-tauri/libs - - cp app/core/build/libs/stirling-pdf-*.jar frontend/editor/src-tauri/libs/ + - cmd: cp app/core/build/libs/stirling-pdf-*.jar frontend/editor/src-tauri/libs/ + platforms: [linux, darwin] + - cmd: powershell -NoProfile -ExecutionPolicy Bypass -Command "New-Item -ItemType Directory -Force -Path 'frontend/editor/src-tauri/libs' | Out-Null; Copy-Item -Force (Get-ChildItem 'app/core/build/libs/stirling-pdf-*.jar' | Select-Object -First 1) 'frontend/editor/src-tauri/libs'" + platforms: [windows] status: - test -f frontend/editor/src-tauri/libs/stirling-pdf-*.jar diff --git a/frontend/editor/scripts/verify-bundled-jre.mjs b/frontend/editor/scripts/verify-bundled-jre.mjs index 91e89ebe90..1bffc378bb 100644 --- a/frontend/editor/scripts/verify-bundled-jre.mjs +++ b/frontend/editor/scripts/verify-bundled-jre.mjs @@ -16,7 +16,9 @@ const required = Number(process.env.REQUIRED_JAVA ?? "25"); const releasePath = process.argv[2] ?? "runtime/jre/release"; function rebuildRuntime(reason) { - console.warn(`${reason} Rebuilding runtime with 'task desktop:jlink:runtime'.`); + console.warn( + `${reason} Rebuilding runtime with 'task desktop:jlink:runtime'.`, + ); const isWindows = process.platform === "win32"; // Node does not reliably spawn the Task .cmd shim directly on Windows in @@ -88,7 +90,9 @@ if (!major || major < required) { major = parseMajor(raw); } -console.log(`Bundled JRE major: ${major || "unknown"} (required >= ${required})`); +console.log( + `Bundled JRE major: ${major || "unknown"} (required >= ${required})`, +); if (!major || major < required) { console.error(