mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-07-12 06:15:55 -04:00
build: bump the repo toolchain to JDK 25 (#6208)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
# Local Flatpak Verification
|
||||
|
||||
Replicates vid's `org.meshtastic.MeshtasticDesktop` GHA flatpak build on your machine so you
|
||||
can validate `flatpak-sources.json` end-to-end without round-tripping through his repo.
|
||||
Replicates the official `flathub/org.meshtastic.MeshtasticDesktop` flatpak build on your machine
|
||||
so you can validate `flatpak-sources.json` end-to-end without round-tripping through that repo's CI.
|
||||
|
||||
## What it tests that our CI doesn't
|
||||
|
||||
Our CI (`:desktopApp:packageUberJarForCurrentOS :captureFlatpakSources`) only proves the manifest can be *generated*.
|
||||
Vid's CI is where the manifest actually gets *consumed* by `flatpak-builder`. This script
|
||||
Flathub's CI is where the manifest actually gets *consumed* by `flatpak-builder`. This script
|
||||
runs that step locally:
|
||||
|
||||
1. Clones `vidplace7/org.meshtastic.MeshtasticDesktop`.
|
||||
1. Clones `flathub/org.meshtastic.MeshtasticDesktop` (the official Flathub packaging repo).
|
||||
2. Overlays a patched manifest that:
|
||||
- Swaps the `meshtastic/Meshtastic-Android.git` source for a `type: dir` pointing at
|
||||
**your local checkout** (so you can test uncommitted changes).
|
||||
@@ -17,10 +17,10 @@ runs that step locally:
|
||||
- Drops `--share=network` from the build-args (true offline — what Flathub requires).
|
||||
- Adds `--offline` to the Gradle invocation (belt + suspenders).
|
||||
3. Runs `flatpak-builder` in a Docker container with the same Freedesktop 25.08 SDK
|
||||
vid's GHA image uses.
|
||||
the upstream flatpak CI image uses.
|
||||
|
||||
If your `flatpak-sources.json` has the wrong URL, wrong sha256, or a missing entry,
|
||||
the build fails with the same error vid would see. You can iterate in ~5–15 min loops
|
||||
the build fails with the same error Flathub CI would see. You can iterate in ~5–15 min loops
|
||||
instead of waiting on cross-repo CI.
|
||||
|
||||
## Prerequisites
|
||||
@@ -45,7 +45,7 @@ scripts/verify-flatpak/verify.sh --download-only
|
||||
scripts/verify-flatpak/verify.sh --skip-regen
|
||||
|
||||
# Tight iteration loop after a failed run: refresh overlay yaml + manifest
|
||||
# only, then re-run flatpak-builder. Skips Gradle regen, vid-repo fetch,
|
||||
# only, then re-run flatpak-builder. Skips Gradle regen, upstream-repo fetch,
|
||||
# and Meshtastic-Android rsync. Use when you've just patched the YAML
|
||||
# overlay or regenerated flatpak-sources.json by hand.
|
||||
scripts/verify-flatpak/verify.sh --rebuild-only
|
||||
@@ -76,6 +76,6 @@ executing the Gradle build, or run the full script on a Linux host.
|
||||
## Files
|
||||
|
||||
- `verify.sh` — entry point. Idempotent: re-running just re-syncs the overlay and re-runs flatpak-builder.
|
||||
- `desktop-offline.yaml` — patched manifest. Kept in sync manually with vid's upstream;
|
||||
diff against `https://raw.githubusercontent.com/vidplace7/org.meshtastic.MeshtasticDesktop/main/org.meshtastic.MeshtasticDesktop.yaml`
|
||||
if vid changes something material.
|
||||
- `desktop-offline.yaml` — patched manifest. Kept in sync manually with the upstream packaging;
|
||||
diff against `https://raw.githubusercontent.com/flathub/org.meshtastic.MeshtasticDesktop/master/org.meshtastic.MeshtasticDesktop.yaml`
|
||||
if upstream changes something material.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Local offline verification of org.meshtastic.MeshtasticDesktop.
|
||||
# Differences from vid's upstream manifest (vidplace7/org.meshtastic.MeshtasticDesktop):
|
||||
# Differences from the official Flathub manifest (flathub/org.meshtastic.MeshtasticDesktop):
|
||||
# 1. Meshtastic-Android source: `type: dir` pointing at our local checkout instead of `type: git`.
|
||||
# 2. flatpak-sources.json is INCLUDED (uncommented) so Gradle resolves from the offline-repository.
|
||||
# 3. Build uses `--offline` for Gradle — true Flathub-style offline compilation.
|
||||
@@ -11,7 +11,11 @@ runtime: org.freedesktop.Platform
|
||||
runtime-version: '25.08'
|
||||
sdk: org.freedesktop.Sdk
|
||||
sdk-extensions:
|
||||
- org.freedesktop.Sdk.Extension.openjdk21
|
||||
# Single JDK: openjdk25 runs the Gradle daemon (gradle/gradle-daemon-jvm.properties pins
|
||||
# toolchainVersion=25) and satisfies every module's jvmToolchain (25). The offline build
|
||||
# disables toolchain auto-provisioning, so bumping either pin means updating this extension
|
||||
# and the /usr/lib/sdk/openjdk* paths below — a miss fails at daemon startup or compileJava.
|
||||
- org.freedesktop.Sdk.Extension.openjdk25
|
||||
command: meshtastic-wrapper.sh
|
||||
|
||||
finish-args:
|
||||
@@ -56,13 +60,13 @@ modules:
|
||||
- name: meshtastic-desktop
|
||||
buildsystem: simple
|
||||
build-options:
|
||||
append-path: "/usr/lib/sdk/openjdk21/bin"
|
||||
append-path: "/usr/lib/sdk/openjdk25/bin"
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/sdk/openjdk21/jvm/openjdk-21
|
||||
JAVA_HOME: /usr/lib/sdk/openjdk25/jvm/openjdk-25
|
||||
# Point Gradle at the offline mirror produced by flatpak-sources.json
|
||||
GRADLE_USER_HOME: /run/build/meshtastic-desktop/.gradle
|
||||
build-commands:
|
||||
# Install desktop metadata from the in-repo packaging sources (mirrors vid's upstream manifest,
|
||||
# Install desktop metadata from the in-repo packaging sources (mirrors the upstream Flathub manifest,
|
||||
# which stopped shipping standalone root-level copies as of 2026-05-30).
|
||||
- install -Dm644 desktopApp/packaging/icons/icon.svg /app/share/icons/hicolor/scalable/apps/org.meshtastic.MeshtasticDesktop.svg
|
||||
- install -Dm644 -t /app/share/applications desktopApp/packaging/linux/org.meshtastic.MeshtasticDesktop.desktop
|
||||
@@ -73,7 +77,7 @@ modules:
|
||||
- sed -i 's|distributionUrl=.*|distributionUrl=gradle-all.zip|' gradle/wrapper/gradle-wrapper.properties
|
||||
- echo "org.gradle.java.installations.auto-detect=false" >> gradle.properties
|
||||
- echo "org.gradle.java.installations.auto-download=false" >> gradle.properties
|
||||
- echo "org.gradle.java.installations.paths=/usr/lib/sdk/openjdk21/jvm/openjdk-21" >> gradle.properties
|
||||
- echo "org.gradle.java.installations.paths=/usr/lib/sdk/openjdk25/jvm/openjdk-25" >> gradle.properties
|
||||
- >
|
||||
sed -i
|
||||
's/^\(\s*\)vendor\.set(JvmVendorSpec\.JETBRAINS)/\1\/\/ vendor.set(JvmVendorSpec.JETBRAINS)/'
|
||||
@@ -92,8 +96,8 @@ modules:
|
||||
- type: file
|
||||
# Must match the version in gradle/wrapper/gradle-wrapper.properties.
|
||||
# Bumping the wrapper? Update both the URL and sha256 here.
|
||||
url: https://services.gradle.org/distributions/gradle-9.6.0-all.zip
|
||||
sha256: 87a2216cc1f9122192d4e0fe905ffdf1b4c72cff797e9f733b174e157cadd396
|
||||
url: https://services.gradle.org/distributions/gradle-9.6.1-all.zip
|
||||
sha256: 61ba77b3ff7167e60962763eb4bae79db7120c189b9544358d0ade3c1e712a83
|
||||
dest: "gradle/wrapper"
|
||||
dest-filename: "gradle-all.zip"
|
||||
- flatpak-sources.json
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Local replica of vid's flatpak CI (vidplace7/org.meshtastic.MeshtasticDesktop,
|
||||
# .github/workflows/build-flatpak.yml) but flipped to true-offline mode: our
|
||||
# flatpak-sources.json is included and --share=network is removed from the
|
||||
# build phase.
|
||||
# Local replica of the official Flathub packaging build (flathub/org.meshtastic.MeshtasticDesktop)
|
||||
# but flipped to true-offline mode: our flatpak-sources.json is included and
|
||||
# --share=network is removed from the build phase.
|
||||
#
|
||||
# Goal: validate flatpak-sources.json end-to-end (download + verify sha256s +
|
||||
# offline Gradle build) without bugging vid to push & re-run his workflow.
|
||||
# offline Gradle build) without round-tripping through the Flathub repo's CI.
|
||||
#
|
||||
# Requirements:
|
||||
# - Docker (Docker Desktop on macOS works for --download-only mode; full builds
|
||||
@@ -18,12 +17,12 @@
|
||||
# scripts/verify-flatpak/verify.sh --download-only # URLs+sha256 only (works on macOS)
|
||||
# scripts/verify-flatpak/verify.sh --arch aarch64 # cross-arch via QEMU emulation
|
||||
# scripts/verify-flatpak/verify.sh --shell # drop into builder container shell
|
||||
# scripts/verify-flatpak/verify.sh --skip-regen # reuse flatpak-sources.json; still re-clone vid + re-rsync source
|
||||
# scripts/verify-flatpak/verify.sh --skip-regen # reuse flatpak-sources.json; still re-clone upstream + re-rsync source
|
||||
# scripts/verify-flatpak/verify.sh --rebuild-only # tight loop: refresh overlay+manifest only, then re-run flatpak-builder
|
||||
#
|
||||
# Iteration tip: after a build fails partway, fix the overlay YAML (or the
|
||||
# Meshtastic-Android source) and re-run with --rebuild-only — Gradle regen,
|
||||
# vid-repo fetch, and full source rsync are all skipped, so you get straight
|
||||
# upstream-repo fetch, and full source rsync are all skipped, so you get straight
|
||||
# back to flatpak-builder in seconds.
|
||||
|
||||
set -euo pipefail
|
||||
@@ -56,9 +55,9 @@ WORK="$REPO_ROOT/build/flatpak-verify"
|
||||
OVERLAY="$REPO_ROOT/scripts/verify-flatpak/desktop-offline.yaml"
|
||||
SOURCES_JSON="$REPO_ROOT/flatpak-sources.json"
|
||||
GRADLE_HOME_ISOLATED="$REPO_ROOT/build/flatpak-gradle-home"
|
||||
VID_REPO="https://github.com/vidplace7/org.meshtastic.MeshtasticDesktop.git"
|
||||
FLATHUB_REPO="https://github.com/flathub/org.meshtastic.MeshtasticDesktop.git"
|
||||
|
||||
# bilelmoussaoui's image is what vid's CI uses; freedesktop-24.08 is the latest
|
||||
# bilelmoussaoui's image is what the upstream flatpak CI uses; freedesktop-24.08 is the latest
|
||||
# tag available. The 25.08 runtime declared in the manifest is pulled from
|
||||
# flathub at build time inside the container.
|
||||
BUILDER_IMAGE="bilelmoussaoui/flatpak-github-actions:freedesktop-24.08"
|
||||
@@ -95,10 +94,10 @@ else
|
||||
step "Preparing workspace at $WORK"
|
||||
mkdir -p "$WORK"
|
||||
if [[ ! -d "$WORK/org.meshtastic.MeshtasticDesktop/.git" ]]; then
|
||||
git clone --depth 1 --recurse-submodules "$VID_REPO" "$WORK/org.meshtastic.MeshtasticDesktop"
|
||||
git clone --depth 1 --recurse-submodules "$FLATHUB_REPO" "$WORK/org.meshtastic.MeshtasticDesktop"
|
||||
else
|
||||
git -C "$WORK/org.meshtastic.MeshtasticDesktop" fetch --depth 1 origin main
|
||||
git -C "$WORK/org.meshtastic.MeshtasticDesktop" reset --hard origin/main
|
||||
git -C "$WORK/org.meshtastic.MeshtasticDesktop" fetch --depth 1 origin master
|
||||
git -C "$WORK/org.meshtastic.MeshtasticDesktop" reset --hard origin/master
|
||||
git -C "$WORK/org.meshtastic.MeshtasticDesktop" submodule update --init --recursive --depth 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user