Support ABI splits#281
Conversation
| testedVariant.outputs | ||
| .matching { it.isExpectedAbiOutput(flankGradleExtension) } | ||
| .configureEach app@{ | ||
| if (addedTestsForModule) { |
There was a problem hiding this comment.
Moving this check inside of the testedVariant.outputs loop was the key to not adding each split APK to additional-app-test-apks.
| } else { | ||
| // Otherwise, let's just add it to the list. | ||
| if (project.isAndroidAppModule) { | ||
| yml.appendln("- app: ${[email protected]}") |
There was a problem hiding this comment.
appendln is deprecated in favor of appendLine.
|
@runningcode Can you help with reviewing and approving this change. Thanks! |
runningcode
left a comment
There was a problem hiding this comment.
Looks good. It would be nice to also add this to the documentation. docs/configuration.md and the release notes docs/changelog.md.
For my understanding this allows you to test one split at a time. If you want to configure mulitple splits, you could do by using separate configs.
| withAbiSplit: Boolean = false, | ||
| withFladleConfig: String = "", | ||
| withTask: String = "runFlank", | ||
| dryRun: Boolean = true, |
There was a problem hiding this comment.
i like this addition! thanks.
| } | ||
|
|
||
| @Test | ||
| fun testAbiSplitsWithVariants() { |
There was a problem hiding this comment.
thanks for the test with variants as well!
| @Test | ||
| fun testAbiSplitsWithVariants() { | ||
| val result = setUpDependOnAssemble(true, withFlavors = true, withAbiSplit = true, withTask = "printYml", dryRun = false) | ||
| // app: /private/var/folders/m2/7q9pbw453p19bpl150ntdfr40000gp/T/junit6930313466230424292/build/outputs/apk/chocolate/debug/junit6930313466230424292-chocolate-x86-debug.apk |
There was a problem hiding this comment.
i think this comment isn't necessary
| buildscript { | ||
| repositories { | ||
| google() | ||
| jcenter() |
There was a problem hiding this comment.
can we remove jcenter() here?
There was a problem hiding this comment.
Thanks for removing this everywhere 👍
Background
The Android Gradle Plugin has a feature called "APK splits": it can generate multiple APKs for a single build variant based on a few well-defined dimensions, such as device ABI or screen density. When APK splits are enabled, the collection returned by
BaseVariant#getOutputs()contains multiple APK files.Currently, an app that uses APK splits will experience two issues:
Fladleplugin, if thedebugApkpath is not specified and instead derived from the specified variant, the APK split that is selected is unspecified -- it will be the first in theBaseVariant#getOutputs()collection.Fulladleplugin, each split APK for an application module will be added toadditional-app-test-apksseparately. Here's what the generated flank yml looks like on our project:(Note that all APK splits of
app-internal-<ABI>-debug.apkare being tested.)Supporting ABI splits
This PR adds an
abiproperty toFladleConfigto allow users to choose which ABI to use when splits are enabled. (Note that this doesn't add a screen density option -- hopefully people aren't using those as often 😅 ).With this change, the resulting
Fulladleyml in our project no longer contains the additional APK splits.