How avito-tech/avito-android works
Primary layers and components
• Build System Infrastructure – at the top-level you have the Gradle build scripts (settings.gradle.kts, build.gradle.kts, gradle folder, etc.). This layer coordinates the entire multi–project structure.
• Build Logic / Plugins – a large portion of the repository is dedicated to custom Gradle plugins and build logic (“build-logic” directories, “build-logic/android”, “build-logic/checks”, “build-logic/dependency-locking”, “build-logic/publication”, etc.). These components provide:
– Dependency resolution and locking
– Code checks (lint, detekt, build checks)
– Publication and version catalog management
• Subprojects – the “subprojects” directory contains multiple modules that are either Android libraries, test modules (e.g. “android-test”, “ui-testing-compose”, “android-lib”), or components related to running and reporting tests.
• CI & Runner Infrastructure – several modules under “ci” and “test-runner” (device-provider, instrumentation runner, report generators, etc.) are responsible for coordinating tests on devices/emulators in CI. They handle:
– Device provisioning and reservation (using local, Kubernetes, or other providers)
– Test execution via instrumented runners, parsing instrumentation outputs, and providing aggregated reports
• Reporting and Metrics – there are several components (report-processor, teamcity-metrics-collector, test-report modules) that collect data from tests and build metrics, as well as generate reports.
Relationships
• Gradle Build System (the build scripts and the multi–project structure) at the top that orchestrates the build.
– Device Provider Components: responsible for finding, reserving, and managing devices (e.g. local device provider, Kubernetes devices).
– Test Runner / Instrumentation Runner components that execute tests using these provided devices.
– Communication with external CI systems and metric collectors (TeamCity integration, reports upload).
Significant architectural patterns
• The project follows the multi-module Gradle project pattern. Each module is self-contained and built via custom plugins.
• Separation of concerns: Build logic modules encapsulate functionality such as dependency resolution and build checks, allowing subprojects to remain relatively simple.
• Data flow patterns: Test output is parsed (by instrumentation output parsers in the test-runner modules) then aggregated into reports, while device providers and test runners interact via defined APIs.
• Extensibility: The infrastructure is designed to be open and modular so that additional plugins or modules (for new testing frameworks or reporting mechanisms) can be added.
• Use of dependency injection patterns is apparent in some plugins where “factories” and “provider” classes abstract creation of components (e.g., for network clients, logger factories, etc.).