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.
This commit is contained in:
Ludy87
2026-07-06 09:28:07 +02:00
parent ca48361d26
commit 153dde8291
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -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
@@ -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(