Skip to content
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

Add android documentation for use Flaker with multiple build variants #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/android-build-variants.md
Original file line number Diff line number Diff line change
@@ -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']
}
}
}
```