build(flatpak): overhaul offline source generation with native cache scanner#5533
Merged
jamesarich merged 5 commits intoMay 20, 2026
Merged
Conversation
This was referenced May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR completely overhauls, simplifies, and modernizes the Flatpak offline source/dependency generation for the Meshtastic Android desktop builds.
It retires the buggy third-party
io.github.jwharm.flatpak-gradle-generatorplugin and its high-maintenance configuration bypass workaround, replacing them with a highly performant, zero-configuration JVM-native Gradle task (generateFlatpakSourcesFromCache) written in pure Kotlin DSL.🛠️ Summary of Overhaul & Improvements
1. Complete Retirement of Third-Party Plugin & Configuration Bloat
io.github.jwharm.flatpak-gradle-generatorand its 7 obsolete version catalog entries.flatpakOfflineDeps,flatpakOfflineEmbeddedDeps,flatpakOfflineOlderDeps) frombuild-logic.core:databaseanddesktopApp, ensuring dependencies are managed cleanly and standardly.2. Native, High-Availability Cache Scanner (
gradle/flatpak.gradle.kts)Rather than relying on third-party resolution scraping (which frequently triggered Gradle configuration-cache alignment conflicts and omitted critical compiler plugins/parent POMs), we introduced a native cache scanner:
~/.gradle/caches/modules-2/files-2.1) after compile tasks have naturally resolved and warm-cached 100% of the build footprint.DirectoryProperty/RegularFileProperty) and marks the index cache directory as@Internalto bypass slow up-to-date checks.linux-x64,linux-arm64) using path/filename heuristics, and dynamically adds"only-arches": ["x86_64"]or"only-arches": ["aarch64"]back to the generated manifest elements. This ensures Flatpak builders download only the binaries needed for the host architecture, maintaining perfect optimization.3. Streamlined CI Workflows
jqJSON mergers in GitHub Actions with standard Gradle tasks.🧪 Verification & Results
1. Spotless & Detekt Compliance
All project formatting and static analysis checks pass cleanly without a single lint regression:
2. End-to-End Cache Generation
💎 Key Architectural Benefits