feat(phase-1/m5.3): packaging wired — derived version, icon/.desktop, image smoke, HiDPI+Wayland verdicts
packageVersion derived from app versionName (0.4.2.0 -> 0.4.2; printPackageVersion task). packaging/icon.png + packaging/incido.desktop template ship the icon (1.7.3 DSL exposes no iconFile — recorded). Image smoke caught a REAL bug: jlink runtime lacked jdk.unsupported, DataStore protobuf died on sun/misc.Unsafe only inside the image; fixed via modules.add. createDistributable re-verified: 171 MB image, bin/incido --self-test inside it rc=0. HiDPI: sun.java2d.uiScale=2 doubles requested geometry (screen-clamp proves it). Native Wayland: AWT probe on JDK17 AND 27 both resolve X11 XToolkit — stays XWayland; JBR bundling is Phase 2. New §3 traps + M5.3 run log recorded. Verify: :desktopApp:createDistributable (SUCCESSFUL, 171 MB); image bin/incido --data-dir /tmp/incido-img-smoke --self-test --exit-after 6 (SELFTEST id=1, RENDER notes=1, rc=0); :desktopApp:run --keys-smoke KEYS ALL-OK; :core:data-jvm:smoke M1a PASS; assembleDebug SUCCESSFUL.
This commit is contained in:
1 parent
0cad7729aa
commit
c894321fdf
5 files changed
+117
-4
No files matched your search
@@ -46,18 +46,44 @@ dependencies {
|
|||||||
implementation(project(":composeApp"))
|
implementation(project(":composeApp"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Packaging works (proven in Phase 0), but per-OS installers and icons are
|
// Packaging works (proven in Phase 0), M5 wires it: version derived from
|
||||||
// milestone M5. Version is pinned numerically here because jpackage only
|
// the app's versionName, distribution icon shipped, per-OS installers need
|
||||||
// accepts major.minor.patch; M5 wires it to the app's version scheme.
|
// per-OS runners (§7: jpackage cannot cross-compile — CI matrix, M5.4).
|
||||||
|
// jpackage accepts major.minor.patch ONLY, so the app's 4-segment
|
||||||
|
// versionName (0.4.2.0 — validator in app/build.gradle.kts is the source of
|
||||||
|
// truth) maps to its first three segments; the emergency segment lives in
|
||||||
|
// the git tag, exactly like the APK release flow.
|
||||||
|
val appVersionName: String = run {
|
||||||
|
val appBuild = rootProject.file("app/build.gradle.kts").readText()
|
||||||
|
Regex("versionName\\s*=\\s*\"([0-9.]+)\"").find(appBuild)?.groupValues?.get(1)
|
||||||
|
?: error("M5.3: could not read versionName from app/build.gradle.kts")
|
||||||
|
}
|
||||||
|
|
||||||
compose.desktop {
|
compose.desktop {
|
||||||
application {
|
application {
|
||||||
mainClass = "org.incido.desktop.MainKt"
|
mainClass = "org.incido.desktop.MainKt"
|
||||||
nativeDistributions {
|
nativeDistributions {
|
||||||
targetFormats(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
|
targetFormats(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
|
||||||
packageName = "incido"
|
packageName = "incido"
|
||||||
packageVersion = "0.4.2"
|
packageVersion = appVersionName.split(".").take(3).joinToString(".")
|
||||||
vendor = "Incido"
|
vendor = "Incido"
|
||||||
description = "Incido — offline-first notes (desktop)."
|
description = "Incido — offline-first notes (desktop)."
|
||||||
|
// The jlink runtime needs jdk.unsupported: DataStore's bundled
|
||||||
|
// protobuf touches sun.misc.Unsafe (M5.3 image smoke caught it —
|
||||||
|
// :desktopApp:run never notices, the host JDK has the module).
|
||||||
|
modules.add("jdk.unsupported")
|
||||||
|
// API delta (M5.3): the 1.7.3 Compose DSL exposes NO iconFile
|
||||||
|
// property (jpackage's --icon is unreachable from here). The
|
||||||
|
// icon vehicle is packaging/incido.desktop (app-image) and the
|
||||||
|
// CI install step (deb/rpm, M5.4) — packaging/icon.png ships
|
||||||
|
// beside them.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Derivation is visible (and CI-readable) without parsing jpackage logs.
|
||||||
|
tasks.register("printPackageVersion") {
|
||||||
|
doLast {
|
||||||
|
println("PACKAGE-VERSION ${appVersionName.split(".").take(3).joinToString(".")}")
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 489 KiB |
@@ -0,0 +1,28 @@
|
|||||||
|
# Incido desktop entry — M5.3.
|
||||||
|
#
|
||||||
|
# deb/rpm installs get their own auto-generated .desktop from jpackage;
|
||||||
|
# this file is for the app-image directory (build/compose/binaries/main/
|
||||||
|
# app/incido). Install with the Exec/Icon paths pointed at wherever the
|
||||||
|
# image lives, e.g.:
|
||||||
|
#
|
||||||
|
# mkdir -p ~/.local/share/applications ~/apps/incido
|
||||||
|
# cp -r build/compose/binaries/main/app/incido/* ~/apps/incido/
|
||||||
|
# cp desktopApp/packaging/icon.png ~/apps/incido/icon.png
|
||||||
|
# sed -e "s|@PREFIX@|$HOME/apps/incido|" desktopApp/packaging/incido.desktop \
|
||||||
|
# > ~/.local/share/applications/incido.desktop
|
||||||
|
#
|
||||||
|
# StartupWMClass=incido groups the AWT window (class "incido" under the
|
||||||
|
# jpackage launcher) with its taskbar entry.
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Version=1.0
|
||||||
|
Name=Incido
|
||||||
|
GenericName=Notes
|
||||||
|
Comment=Offline-first private notes
|
||||||
|
Exec=@PREFIX@/bin/incido %U
|
||||||
|
Icon=@PREFIX@/icon.png
|
||||||
|
Terminal=false
|
||||||
|
Categories=Office;TextEditor;Utility;
|
||||||
|
Keywords=notes;offline;private;markdown;
|
||||||
|
StartupNotify=true
|
||||||
|
StartupWMClass=incido
|
||||||
@@ -896,6 +896,57 @@ M5.2 suite:
|
|||||||
`.desktop` entry, createDistributable re-verify + size, Wayland/HiDPI
|
`.desktop` entry, createDistributable re-verify + size, Wayland/HiDPI
|
||||||
verdict.
|
verdict.
|
||||||
|
|
||||||
|
**M5.3 — packaging: DONE.**
|
||||||
|
|
||||||
|
- **Version wiring:** `packageVersion` now DERIVED — desktopApp's build
|
||||||
|
script regexes `versionName` out of `app/build.gradle.kts` (the
|
||||||
|
validator-protected source of truth) and maps 0.4.2.0 → 0.4.2 for
|
||||||
|
jpackage (4th segment lives in the tag, like the APK flow).
|
||||||
|
`:desktopApp:printPackageVersion` prints `PACKAGE-VERSION 0.4.2`.
|
||||||
|
- **Icons/.desktop:** `packaging/icon.png` (1024, from
|
||||||
|
`incido_flat_icon.png`) + `packaging/incido.desktop` template
|
||||||
|
(@PREFIX@ substitution; StartupWMClass=incido). API delta found: the
|
||||||
|
1.7.3 Compose DSL has NO `iconFile` property — the .desktop template
|
||||||
|
(app-image) and the CI install step (deb) are the icon vehicles.
|
||||||
|
- **The image run found a REAL packaging bug:** `NoClassDefFoundError:
|
||||||
|
sun/misc/Unsafe` from DataStore's bundled protobuf — the jlink runtime
|
||||||
|
lacked `jdk.unsupported` (invisible under the full JDK that
|
||||||
|
`:desktopApp:run` uses; the spike never hit it because it had no
|
||||||
|
DataStore). Fixed with `modules.add("jdk.unsupported")`. **New §3
|
||||||
|
trap: any new JVM module a dependency secretly needs only shows up
|
||||||
|
inside the image — smoke the image, not just the run task.**
|
||||||
|
- **createDistributable re-verified:** BUILD SUCCESSFUL, app-image
|
||||||
|
**171 MB** (168 → 169 → 171 MB across the phase: metadata-extractor +
|
||||||
|
M5 code); `bin/incido --data-dir … --self-test --exit-after 6`
|
||||||
|
INSIDE the image: `SELFTEST wrote note id=1 → RENDER notes=1`, rc=0.
|
||||||
|
- **HiDPI verdict:** `-Dsun.java2d.uiScale=2.0` (via `JAVA_TOOL_OPTIONS`,
|
||||||
|
respected by the jpackage launcher) doubles the requested window
|
||||||
|
geometry — 1090x730 → clamped at 1920x1016 by the screen (requested
|
||||||
|
2180px-wide; the compositor's cap PROVES the scale applied). Font
|
||||||
|
crispness at scale not machine-verified; that part is pending-manual.
|
||||||
|
- **Native-Wayland verdict:** A probe compiled+run on BOTH installed
|
||||||
|
JDKs (Arch 17.0.20.1 and 27) with `WAYLAND_DISPLAY=wayland-0`
|
||||||
|
present resolves `sun.awt.X11.XToolkit` either way — this stack has no
|
||||||
|
native-Wayland AWT backend; skiko stays on XWayland. Real fix =
|
||||||
|
bundling JetBrains Runtime (Wayland-capable) in the distribution →
|
||||||
|
Phase 2 (needs Compose ≥1.8 `runtimeDirs` work + a JBR to verify
|
||||||
|
against).
|
||||||
|
|
||||||
|
```
|
||||||
|
M5.3 suite:
|
||||||
|
:desktopApp:printPackageVersion PACKAGE-VERSION 0.4.2
|
||||||
|
:desktopApp:createDistributable BUILD SUCCESSFUL — 171 MB image
|
||||||
|
image bin/incido … --self-test SELFTEST id=1 → RENDER notes=1, rc=0
|
||||||
|
(pre-fix image run) NoClassDefFoundError sun/misc/Unsafe → fixed
|
||||||
|
uiScale 1 vs 2 window geometry 1090x730 → 1920x1016 (clamp) = scaling applied
|
||||||
|
AwtProbe on JDK17 / JDK27 (Wayland env) both sun.awt.X11.XToolkit (no native Wayland here)
|
||||||
|
:desktopApp:run … --keys-smoke KEYS ALL-OK
|
||||||
|
:core:data-jvm:smoke RESULT: M1a PASS
|
||||||
|
assembleDebug BUILD SUCCESSFUL
|
||||||
|
```
|
||||||
|
|
||||||
|
**Next up: M5.4** — CI packaging job on the Gitea runner.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,14 @@ app version `0.4.2.0` (code 38).
|
|||||||
* KWin under Wayland drops xdotool XTEST keys aimed at the XWayland window even
|
* KWin under Wayland drops xdotool XTEST keys aimed at the XWayland window even
|
||||||
when focus probes show it focused — desktop key handling can't be injected
|
when focus probes show it focused — desktop key handling can't be injected
|
||||||
headless here; verify real keypresses by hand.
|
headless here; verify real keypresses by hand.
|
||||||
|
* The jlink runtime inside the app-image lacks `jdk.unsupported`; DataStore's
|
||||||
|
protobuf crashes with `NoClassDefFoundError: sun/misc/Unsafe` ONLY inside the
|
||||||
|
image (`:desktopApp:run` on a full JDK never sees it). Shipped via
|
||||||
|
`modules.add("jdk.unsupported")` — smoke the IMAGE after adding any dep that
|
||||||
|
might want a hidden JVM module.
|
||||||
|
* Compose 1.7.3's `nativeDistributions` DSL has no `iconFile` property; icons
|
||||||
|
travel through `packaging/incido.desktop` (app-image) or the deb install
|
||||||
|
step, not the DSL.
|
||||||
|
|
||||||
## 4. M2 — the backup bridge (next up; the product's reason to exist)
|
## 4. M2 — the backup bridge (next up; the product's reason to exist)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user