Closed uKetki closed 3 years ago
macos_test_integration
test failed with the below reason which seems unrelated to the changes:
FAILURE com.facebook.buck.testrunner.RunWithDefaultTimeoutIntegrationTest testRunWithHonorsDefaultTimeoutOnTestThatRunsLong: Should fail due to exceeding timeout. Expected exit code 32 but was 0.
java.lang.AssertionError: Should fail due to exceeding timeout. Expected exit code 32 but was 0.
Looks like all of the automated CI has passed, I haven't fully had a chance to review this yet but don't want to hold this up too long. This is ready to go @uKetki?
Thanks, @rajyengi. This PR is completed from my side, I am planning to create a separate PR with the testdata and related Buck.fixture
files.
Sounds good, since CI looks fine for now and the feature is behind useDynamicFeature
flag, I'll go ahead and merge this. Looking forward to seeing the test data PR though.
The complete implementation is divided into 5 commits with detailed description are as follows:
[1/n Dynamic Feature Support] Create Android Optimiser layer and segregate responsibility of AndroidBinaryBuildable and AndroidBinaryOptimizer
Looking at the buck code for generating apk and aab, it is evident that
AndroidBinaryBuildable
is bloated with a lot of responsibilities ranging from apk/aab generation, signing to optimization.The overview of current buck architecture:
The suggestion is to refactor existing code and create two separate layers: Optimizers and Buildable which can re-use the common logic for binary generation and offload the specific implementation to the respective layers:![Buildable](https://user-images.githubusercontent.com/39046660/108714938-3572ba00-7540-11eb-92af-38b54b6e727c.png)
![Optimizer](https://user-images.githubusercontent.com/39046660/108714999-458a9980-7540-11eb-89c6-166a6e7ca330.png)
This approach will later help to add changes needed to support dynamic feature delivery.
[2/n Dynamic Feature Support] Update documentation of android_bundle rule to include changes required for dynamic features
[3/n Dynamic Feature Support] Add new configuration flag useDynamicFeature to support dynamic features related attributes
useDynamicFeature
to support backward compatibility of AndroidBundle and AndroidBinary rule. Later this flag is used to include any specific changes related to dynamic features.[4/n Dynamic Feature Support] Define new configuration application_modules_with_manifest to decouple the manifest behavior from the resources
application_modules_with_manifest
to make base module Manifest aware of the feature's manifest.[5/n Dynamic Feature Support] Enable buck to support dynamic features with native libraries
lib.xzs
files and therefore ensures the resultantaab
file is exactly the same as if it was done by Gradle.Resulted App Bundle overview (before changes in buck):
libs.xzs
file irrespective of the state if the feature has any native library or notinitialInstall
module has 4 sub-directories withlibs.xzs
copied acrossResulted App Bundle overview (after changes in buck):
Closes #2586 | _Tested feature by including custom buck pex file in PlayFeatureDelivery sample._