-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Size Metrics: add support for Android Universal APKs #365
Conversation
3464735
to
40b5c58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb
Outdated
Show resolved
Hide resolved
# Keys used by the metrics payload | ||
AAB_FILE_SIZE_KEY = 'AAB File Size'.freeze # value from `File.size` of the `.aab` | ||
UNIVERSAL_APK_FILE_SIZE_KEY = 'Universal APK File Size'.freeze # value from `File.size` of the Universal `.apk` | ||
UNIVERSAL_APK_SPLIT_NAME = 'Universal'.freeze # pseudo-name of the split representing the Universal `.apk` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: Why is at "pseudo-name"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because for all the other splits, the name (i.e. the value used for the split:
metadata) is provided by bundletool
(it's the basename of the .apk
produced by it in the <tmpdir>/splits/*.apk
); while for the universal APK it's just a name of our choosing and not some official name provided by the Android tooling, so it could be any name we want it to be.
In fact if we wanted to be pedantic, the Universal APK should probably not be considered a "split" per se — it's not the name of a CPU architecture after all. So it's a bit like if we said for iOS that the Universal .ipa
was a "thinned version for the device named 'Universal'": pseudo-name
because not really the name of a split/CPU-arch but one we made up to represent/mean "multiple archs in a single FAT file".
lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb
Outdated
Show resolved
Hide resolved
To use defaults instead of actually passing `nil` as a value
Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
…send_app_size_metrics.rb Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
a838422
to
4a15e07
Compare
This work is part of the App Metrics project [ref: paaHJt-37V-p2] and implements the fastlane actions necessary to send iOS and Android app size metrics [ref: paaHJt-3od-p2#comment-6098] to the App Metrics server.
What
This builds on top of #364 and adds support for including "Universal APKs" metrics for Android.
(I suggest to get #364 merged first before this #365, to keep the diffs of each PR separate and easier to review in isolation)
Why
This will mostly be useful if/when we want to send app size metrics for Installable Builds, which are build using
./gradlew assemble<app>JalapenoDebug
and thus produce a single, Universal.apk
— as opposed to an.aab
bundle like we do for beta and release builds that we upload to the Play Store)How
universal_apk_path
parameter for theandroid_send_app_size_metrics
actionaab_path
parameter is no longer mandatory, to allow the case where we only pass the universal APK but no.aab
. It's still required to have at least one ofuniversal_apk_path
oraab_path
(if not both) though."Optimized File Size"
for R8-optimized APKs (i.e.file-size
as reported byapkanalyzer
, as opposed to the.apk
file size on disk).apkanalyzer
", as opposed to "optimized for a specific device architecture", that latter being instead indicated by thesplit:
metadata)To Test
*-app-size-metrics.json
files in the "Artifacts" tab of the WPAndroid PR's CircleCI job look as expected.