Allegro Mar 1, 2016

Integrating Android Projects with Codecov for Coverage Tracking

Article Summary

Still manually checking code coverage on Android PRs? There's a better way that turns coverage tracking into an automated gatekeeper for your codebase.

This technical guide walks through integrating Codecov with Android projects using GitHub and Travis CI. It covers the full setup from generating coverage reports across different project types to automating checks on every pull request.

Key Takeaways

Critical Insight

Codecov integration transforms code coverage from a manual check into an automated CI gate that reviews every pull request.

The article reveals why Codecov might be more elegant than SonarQube for open source projects, despite having fewer features.

About This Article

Problem

Android projects don't have built-in Gradle report tasks for unit test coverage. Developers need to manually configure tools or use external plugins to generate jacoco reports across different application variants and library modules.

Solution

Artur Stępniewski created a guide that uses jacoco-android-gradle-plugin version 0.1.1. This plugin automatically sets up coverage tasks and outputs XML files that Codecov can process.

Impact

Multi-module Android projects can now send multiple coverage report files to Codecov at the same time without merging them first. Codecov can then add coverage comments directly to pull requests in the CI pipeline.

Recent from Allegro

Related Articles