ADFA-943: Strip leftover top-level cruft from the release APK - #1593
Conversation
The protobuf gradle plugin bundles project-models/aapt2-proto/profiler/
jvm-symbol-models' raw .proto sources into their own resources by
default, and several third-party jars (protobuf-javalite, httpclient,
google-http-client, google-auth-library, unbescape, jgit, the Kotlin
compiler embeddable's shaded log4j/OpenTelemetry) drop inert version
metadata or IntelliJ-only descriptors at the APK root. None of this is
read at runtime, so exclude it via packaging.resources in app/build.gradle.kts.
assets/templates/xml/{drawable,layout,menu}.xml, also flagged in the
ticket, turned out to be wired to the file-tree "new file" action
(ProjectWriter.createMenu/createDrawable/createLayout) and were left alone.
Verified by building :app:assembleV8Release and diffing the APK's
top-level entries before/after.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Android packaging configuration revises protobuf exclusions and adds exclusions for build-time metadata from several third-party libraries while retaining the public suffix list exclusion. ChangesPackaging exclusions
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
packaging.resources.excludesentries inapp/build.gradle.ktsto strip:.protosources leaked by the protobuf gradle plugin's default resource bundling (project-models, aapt2-proto, profiler, jvm-symbol-models), plus protobuf's own well-known-type sources and edition feature-default descriptors — none of these are read at runtime, only by protoc/codegen.intellij.java.frontback.psi[.impl].xml) and the shaded log4jNOTICEfrom the Kotlin compiler embeddable jar.OSGI-INF/l10n/plugin.properties).assets/templates/xml/{drawable,layout,menu}.xml, also flagged in the ticket, turned out to be actively used (ProjectWriter.createMenu/createDrawable/createLayout, wired to the file-tree "new file" action) — left alone.Test plan
flox activate -d flox/local -- ./gradlew :app:assembleV8Release --parallel --max-workers=6builds successfully.🤖 Generated with Claude Code
Summary by CodeRabbit