Skip to content

0.24.0: dist-apk packs on Windows and macOS hosts as on Linux - #58

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/apk-windows-host
Nov 18, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
feat/apk-windows-host

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

dist-apk could not pack on a Windows host: it named aapt2/zipalign without .exe, ran apksigner/d8 through the POSIX wrappers xim:android-build-tools writes under bin/, and ran four #!/bin/sh helpers as action programs, which CreateProcess cannot start. HuxerUI's conformance suite packs an APK with mcpp on a Windows host and stopped at aapt2 was not found at …\aapt2. The Windows NDK's missing libc++ module sources, the reason this collection's CI gave for having no Windows Android row, were supplied by openxlings/xim-pkgindex#1188.

  • dist/apk.cppm
    • d8, apksigner, bundletool, the Kotlin compiler and coursier run from their jars on the JDK's java, with the command and default heap each tool's own launcher uses (build-tools 37.0.0's d8 and apksigner, java -jar for bundletool and coursier as their xim launchers do, and JetBrains' kotlinc/bin/kotlinc for the JVM compiler). A .bat launcher would need cmd.exe, and mcpp refuses one as an action program when an argument carries a cmd.exe metacharacter.
    • aapt2, zipalign, java, javac, jar and jarsigner carry the host's executable suffix, and a class path is joined with the host's separator.
    • copy-then-jar.sh, run-and-stamp.sh, run-d8.sh and make-module.sh are replaced by one Java source file, DistApk.java, written at plan time and run by that java as a single-file program (JEP 330). Its commands do what the scripts did; run-d8's operands are now <d8 command>... --inputs <input>... --options <option>..., because the d8 command is several tokens.
    • The same command lines run on every host, so the Linux fixtures exercise the code a Windows host runs.
  • .github/workflows/ci.yml: the macOS and Windows rows pack tests/apk-consumer at level 0 and level 1 and check the debug signature, the archive's entries, aapt2 dump badging, and MainActivity and GeneratedHelper in the dex. This replaces the comment that explained why those rows had no Android step.
  • docs/dist-apk.md: the build-host paragraph and the 0.24.0 entry. The version is 0.24.0 in mcpp.toml, src/plugins.cppm, the README and plugin-development.

Measured locally on Linux (x86_64-linux-android), with mcpp 2026.11.17.1:

  • tests/apk-consumer: the level-0 checks of the Linux job pass, and so does check-apk-features.sh, all criteria.
  • tests/apk-consumer-shared check-apk-closure.sh and tests/apk-consumer-graph check-apk-graph.sh pass.
  • tests/apk-consumer-libraries check-apk-libraries.sh passes criteria 1–4: Kotlin and Java, unsigned, App Bundle, and the library refusal. Criterion 5, the Maven update, could not reach maven.google.com from this machine (ConnectException: Connection timed out, also when coursier runs by hand), so it is left to CI.

The macOS and Windows rows have not run anywhere yet; this PR's CI is their first run.

The member ran its tools through POSIX launchers and four /bin/sh helpers,
which a Windows host cannot start. d8, apksigner, bundletool, the Kotlin
compiler and coursier now run from their jars on the JDK's java, with the
command each tool's own launcher runs; aapt2, zipalign and the JDK tools are
named with the host's executable suffix; a class path is joined with the
host's separator; and the four helpers are one Java source file, DistApk.java,
which that java runs as a single-file program. One command line on every
host, so the Linux fixtures exercise what a Windows host runs.

CI packs tests/apk-consumer at level 0 and level 1 on the macOS and Windows
rows, checking the signature, the archive's entries, aapt2's reading of it
and the activity in the dex.
…xe on a Windows host

Its generator action was gen.sh, a shell script a Windows host cannot start
as an action's program; there the same copy is cmd.exe's copy.
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