From eac58c0bbaabe309c49296583c88db0c5dc65515 Mon Sep 17 00:00:00 2001 From: danil Date: Sat, 13 Apr 2024 20:32:23 +0300 Subject: [PATCH] Add android documentation for use Flaker with multiple build variants change build type, remove example with product flavor --- docs/android-build-variants.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/android-build-variants.md diff --git a/docs/android-build-variants.md b/docs/android-build-variants.md new file mode 100644 index 0000000..0174970 --- /dev/null +++ b/docs/android-build-variants.md @@ -0,0 +1,27 @@ +# Usage + +## Setting Up Flaker with Multiple Variants on Android + +When integrating Flaker into an Android project that includes more than just the standard debug and release variants, it's essential to configure Flaker to handle these additional variants properly. +One crucial aspect of this configuration is using matchingFallbacks in your project's build.gradle file. Here's why and how you should do it: + +### Why Use matchingFallbacks? + +Android projects often include custom build types or flavors, which may not directly match those of the dependencies they rely on. When Flaker attempts to match variants between your app and its dependencies, it may encounter situations where a direct match is not possible due to differences in build types or flavors. In such cases, matchingFallbacks provides a mechanism to specify alternative matches, ensuring proper variant resolution. + +### Adding matchingFallbacks to Your Project + +To ensure Flaker handles multiple variants correctly in your project, you should add matchingFallbacks to your project's build.gradle file, specifying fallback build types or flavors that Flaker should try when direct matches are unavailable. Here's how you can do it: + +#### 1) Build Type +```kotlin + android { + buildTypes { + release { + } + qa { + matchingFallbacks = ['debug', 'release'] + } + } + } +``` \ No newline at end of file