Commit fe1db3e
authored
0.9.0: dist-apk takes a manifest template and several Java roots, dist-web copies through the engine (#20)
* dist-apk: a project manifest template with six tokens, and java_sources as an array
options::manifest_template renders a project AndroidManifest.xml through
six tokens substituted verbatim: {{application_id}}, {{label}},
{{activity}}, {{lib_name}}, {{min_sdk}}, {{target_sdk}}. Three are
required, not merely substituted, because their value is also written
to assets/mcpp-run.json, which adb-run reads to start the application:
{{application_id}} and {{activity}} always, {{lib_name}} at level 0. A
missing required token or an unknown {{...}} token is refused at plan
time, naming it. The built-in default is 0.8.0's manifest_xml output
expressed with these tokens, so level 0 with no template renders
byte-identical to 0.8.0's.
options::java_sources becomes std::vector<std::string>: one javac over
every root's .java files and one d8 over the result. rerun_if_changed_glob
is declared only for a root under mcpp::manifest_dir(); a root outside
it (a dependency's own Java tree) is not walked by the glob fingerprint
regardless, and its files are already inputs of the javac action while
its version is already in the build's fingerprint.
Design record: .agents/docs/2026-09-13-four-upstream-asks-from-a-ui-framework.md, §3.
* dist-web: copy through ${mcpp.self} stage instead of cp
The two copy steps become argv { "${mcpp.self}", "stage", "--verify",
"content", "--output", dst, src }, the same copier every stage_file edge
in build.ninja already runs: it creates the destination's parent,
compares content and writes only on a difference. Plan-time
create_directories is removed with it. The POSIX-only note leaves the
header; this member's floor rises to the mcpp release that carries
${mcpp.self} and mcpp stage's argument shape as an engine contract.
Design record: .agents/docs/2026-09-13-four-upstream-asks-from-a-ui-framework.md, §4.
* tests: dist-apk's manifest-template and Java-root criteria, dist-web's idempotent pack
tests/apk-consumer: build.mcpp reads APK_CONSUMER_TEMPLATE and
APK_CONSUMER_LEVEL1 to reach five configurations without a second
fixture. check-apk-features.sh runs all five: (a) level 0 with no
template, byte-identical to the 0.8.0 manifest fixture; (b) a template
naming a uses-permission and a receiver, both present in aapt2 dump
xmltree on the linked base.apk; (c) a template missing
{{application_id}}, refused naming the token and assets/mcpp-run.json;
(d) a template naming {{bogus}}, refused naming it; (e) two Java roots,
one under the project (tests/apk-consumer/java) and one a sibling
directory reached by an absolute path (tests/apk-consumer-external-java),
producing one classes.dex with classes from both. (c) and (d) read
build.mcpp's own stdout/stderr by re-invoking the compiled binary
directly with the documented MCPP_* contract, because mcpp discards a
build program's captured output on a plan-time refusal's exit code of 0.
tests/web-consumer/check-web-idempotent.sh: a second, no-op
mcpp pack --format web changes no staged file's mtime, the criterion
${mcpp.self} stage gives for free and cp never could. A sibling of
check-web-plan.sh, which keeps passing unchanged.
.github/workflows/ci.yml: both wired in beside the existing
"dist-apk produces a signed APK, level 0 and level 1" and
"dist-web produces a static directory, and node runs it" steps;
MCPP_VERSION raised to 2026.9.13.1, the release both P1-P3 need.
Design record: .agents/docs/2026-09-13-four-upstream-asks-from-a-ui-framework.md, §3.5, §4.3, §9.2.
* 0.9.0: raise the floor of dist-apk and dist-web to 2026.9.13.1
README rows for dist-apk and dist-web state the new floor and why:
dist-web needs ${mcpp.self} and mcpp stage's argument shape as an
engine contract; dist-apk's own manifest-template and Java-array
changes ask nothing new of the engine, but this collection publishes
one package at one version, and this is the release CI verifies it
under from here on.
mcpp.toml and src/plugins.cppm: version 0.9.0.
The mcpp 2026.9.13.1 release this depends on does not exist yet, so
CI is red on the fetch step until it does (see the pull request body).
* dist-apk: a java_sources root's rerun glob must be manifest-relative
mcpp::rerun_if_changed_glob((root + "/**/*.java").c_str()) declared an
ABSOLUTE pattern for a root under mcpp::manifest_dir(), because
opt.java_sources's own roots (manifest_dir() composed with a
subdirectory) are absolute. The engine matches a glob by comparing the
candidate file made relative to the package root against the pattern
(modules/manifest/src/glob.cppm, path_matches_glob); an absolute
pattern is compared against a relative candidate and never matches
anything, so the fingerprint is always the empty set and a .java file
appearing under the project root never changes it -- "a .java added
under the project root re-runs the build program" was not true.
root_in_project now returns the manifest-relative form (std::optional
<std::string>) instead of a bool, and the glob is declared with that
relative path.
Measured directly on the recorded cache fingerprint (build.mcpp.cache's
"glob <hash> java/**/*.java" line), which is the precise evidence: with
the pre-fix absolute pattern, the recorded hash was identical
(cbf29ce484222325) whether or not a .java file existed under the
project root; with the fix, the hash changes (78b24cb88185e8c9 ->
4cd5de0f1766a171) when one is added. tests/apk-consumer/
check-apk-features.sh's new leg (f) asserts this directly, plus the
external root's continuing absence from any recorded glob, plus (as a
functional sanity check, not a caching claim -- this engine reruns
build.mcpp on every `mcpp pack` of this fixture regardless of any
glob, so a dex-content check alone cannot distinguish the two) that
classes.dex picks up a class added under either root.1 parent db16e27 commit fe1db3e
15 files changed
Lines changed: 706 additions & 70 deletions
File tree
- .github/workflows
- dist
- src
- tests
- apk-consumer-external-java/org/mcpp/apkconsumer
- apk-consumer
- fixtures
- java/org/mcpp/apkconsumer
- web-consumer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
1130 | | - | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1131 | 1135 | | |
1132 | 1136 | | |
1133 | 1137 | | |
| |||
1137 | 1141 | | |
1138 | 1142 | | |
1139 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1140 | 1152 | | |
1141 | 1153 | | |
1142 | 1154 | | |
| |||
1195 | 1207 | | |
1196 | 1208 | | |
1197 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1198 | 1224 | | |
1199 | 1225 | | |
1200 | 1226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments