Skip to content

Update jacoco config to support kmp modules#3607

Merged
andreia-ferreira merged 3 commits into
masterfrom
andreia/add-jacoco-kmp
Mar 12, 2026
Merged

Update jacoco config to support kmp modules#3607
andreia-ferreira merged 3 commits into
masterfrom
andreia/add-jacoco-kmp

Conversation

@andreia-ferreira

Copy link
Copy Markdown
Collaborator

The current Jacoco config was not taking the new modules into account. This PR updates it to support Kotlin Multiplatform modules.

Note: KMP modules require a jvm() target for Jacoco to work, since it cannot process other non-JVM targets. After the migration is complete, we can consider switching to the official kotlinx-kover coverage plugin

@shobhitagarwal1612 PTAL?

@auto-assign auto-assign Bot requested a review from gino-m March 11, 2026 14:59
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the Jacoco configuration to correctly handle Kotlin Multiplatform modules, which were previously not included in code coverage reports. It introduces logic to detect module types (Android or KMP) and applies specific configurations accordingly. Additionally, it defines an exclusion list to prevent generated code from affecting coverage metrics.

Highlights

  • Jacoco Configuration Update: The Jacoco configuration has been updated to support Kotlin Multiplatform (KMP) modules, ensuring code coverage reports include these modules.
  • Module Detection: The configuration now dynamically detects Android and KMP modules to apply the appropriate settings.
  • Exclusion List: An exclusion list has been defined to exclude generated code and other irrelevant files from coverage reports.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • config/jacoco/jacoco.gradle
    • Updated Jacoco config to support KMP modules
  • core/domain/build.gradle.kts
    • Applied Jacoco config to KMP module
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Jacoco configuration to support Kotlin Multiplatform (KMP) modules, which is a great improvement for ensuring code quality across the entire project. The changes in config/jacoco/jacoco.gradle to dynamically configure paths based on module type are well-implemented. I have a couple of suggestions to enhance the robustness and maintainability of the Gradle script.

Comment thread config/jacoco/jacoco.gradle
Comment thread config/jacoco/jacoco.gradle
@codecov

codecov Bot commented Mar 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.80%. Comparing base (4d10715) to head (a102b26).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3607      +/-   ##
============================================
- Coverage     69.47%   68.80%   -0.68%     
- Complexity     1812     1825      +13     
============================================
  Files           347      355       +8     
  Lines          9583     8577    -1006     
  Branches       1028     1076      +48     
============================================
- Hits           6658     5901     -757     
+ Misses         2296     2038     -258     
- Partials        629      638       +9     

see 227 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shobhitagarwal1612

Copy link
Copy Markdown
Member

Are you able to verify that new paths are visible in codecov?

@andreia-ferreira

andreia-ferreira commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

@shobhitagarwal1612 good catch. The new reports were not being uploaded to Codecov. I updated the ci step to search and upload all jacoco reports of the project

@andreia-ferreira andreia-ferreira merged commit 747e85c into master Mar 12, 2026
11 of 13 checks passed
@andreia-ferreira andreia-ferreira deleted the andreia/add-jacoco-kmp branch March 12, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants