K2GO-437 feat(maven-offline): offline Maven repository producer tool - #611
Merged
Merged
Conversation
added 6 commits
October 1, 2026 11:40
Builds one Maven2 repository with the build dependencies of Knowledge to Go, Code on the Go and the add-ons, served static for offline builds on the K2Go network. Uses direct Gradle resolution (the suggested yubyf plugin writes no artifacts on our Gradle versions); adds aapt2 and brotli4j for Linux and Windows build hosts.
…s-buildscript, AGP 9.3.1 Reshape now also materializes each artifact under its Gradle Module Metadata url (KMP androidx -android AARs are served under a url that differs from the cache name; without this an offline fetch 404s). The offline smoke init now redirects the settings-level buildscript repositories too (beforeSettings), so the AGP + Kotlin plugin classpath resolves offline. Correct the add-ons AGP to 9.3.1 (R8/D8 ships inside builder:9.3.1, so no separate r8 to pin).
…repo, no hardcoded list The aapt2 set now follows the com.android.tools.build:gradle versions the resolve actually produced, so a project changing its AGP (e.g. K2Go 8.4 -> 8.8) needs no edit: re-running the tool adjusts the toolchains and the aapt2 set automatically.
…, reuse-resolve mode The config TSVs were space-aligned but read with IFS tab, so projects.tsv and extra-artifacts.tsv parsed into one field (a full-tool run sent malformed extra URLs). Use real tabs. materialize_module_urls now normalizes a relative GMM url (a relocation like guava -android -> ../<ver>-jre) and creates its parent dir before copying. Add --no-resolve (rebuild the repo from existing Gradle homes) and --out, and point the add-ons gradle_root at plugins/ (the real addons repo layout). A full --no-resolve run reproduces the repo with zero artifacts missing.
Degrade (not abort under set -e) when the aapt2 metadata fetch fails; make a missing per-build gradlew a loud WARN skip instead of a swallowed failure; guard --out/--only against a missing value; iterate AGP dirs with a glob instead of parsing ls; rename derive_aapt2_r8 to fetch_aapt2 (R8/D8 ships inside builder).
…nto feat/K2GO-437-maven-offline-builder
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.
Adds a producer tool (static/maven-offline/) that builds one offline Maven2
repository with the build dependencies of Knowledge to Go, Code on the Go, and
the add-ons, so a device or a laptop on the K2Go network can build those projects
with the network off. First of three tickets: the K2Go role that serves the repo
and the Code on the Go consumer setting are separate.
How: direct Gradle resolution into an isolated Gradle home, reshaped to Maven2
layout, plus aapt2 (Linux and Windows) and brotli4j. Versions come from each
project, not a hardcoded list, so a re-run follows an AGP migration with no edit.
The io.github.yubyf.maven-offline plugin writes no artifacts on our Gradle
versions, so it is not used. The 1.2 to 1.7 GiB repo is served static by nginx
and is generated, not committed.
Build hosts in scope: Android (ARM), Linux, Windows. MacOS is deferred.
Verification: Knowledge to Go and Code on the Go resolve every dependency offline
against the repo (network off). All 28 published add-ons resolve offline and 23 of
28 build offline; the other 5 fail only for non-Maven reasons outside the repo (a
stale libs jar, a CDN asset). A full re-run reproduces the repo with zero
artifacts missing.