Skip to content

K2GO-437 feat(maven-offline): offline Maven repository producer tool - #611

Merged
luisguzman-adfa merged 6 commits into
mainfrom
feat/K2GO-437-maven-offline-builder
Oct 1, 2026
Merged

luisguzman-adfa merged 6 commits into
mainfrom
feat/K2GO-437-maven-offline-builder

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

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.

Your Name 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
@luisguzman-adfa
luisguzman-adfa merged commit ad2ac6e into main Oct 1, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-437-maven-offline-builder branch October 1, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant