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

Move the current functionality of Kover Gradle Plugin to Kotlin Gradle Plugin #724

Open
shanshin opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@shanshin
Copy link
Collaborator

shanshin commented Jan 3, 2025

From now on, we will begin integrating the Kotlin Coverage into the Kotlin Gradle Plugin.

This is a task to implement the ideas mentioned in #608.
Motivation remains, but the implementation steps have been slightly modified.

Motivation

Disadvantages of the current approach:

  • the complexity of the concepts used in Kover Gradle Plugin: it introduces its own concepts of artifacts, coverage measurement options, report variants, its own rules for combining variants, its own rules for merging reports. All these concepts do not fit well with Kotlin, and its look like an artificial pile-up
  • after creating a minimal Kotlin application, it is not obvious that you need to use a third-party utility to measure coverage
  • some Kover plugin settings duplicate existing settings, for example, the need to add an kover dependency when a implementation dependency has already been declared - this complicates the configuration for builds with a large number of subprojects
  • unobvious to configure Kover as a separate Gradle plugin that is not related to Kotlin in any way
  • difficulty of supporting two Gradle plugins in the IDE - it is easier to support one Kotlin Gradle Plugin than two plugins with different versions
  • the current plugin DSL is specific to Java or JaCoCo in many respects
  • complicated integration with the Kotlin compiler
  • different lifecycle of Kover Gradle Plugin and Kotlin Gradle Plugin potentially complicates delivering support for new compiler features

Continued development of the current separate Kover Gradle Plugin

There will be no new features, changes, or improvements to Gradle DSL.

The only feature that will be added to Kover Gradle Plugin is the integration with Android Gradle Plugin.

Incompatibility bugs with future versions of Gradle will also be fixed until Coverage in Kotlin Gradle Plugin becomes stable.

Migration steps

Phase 1

Phase 2

Phase 3

  • implement prototype of Kotlin Coverage in Kotlin Gradle Plugin for JVM and Android platforms

Phase 4

  • collect feedback
  • stabilize prototype functional and Gradle DSL
  • add Kotlin Coverage to Kotlin Maven Plugin

Phase 5

  • release stable Kotlin Coverage as part of Kotlin Gradle Plugin and Kotlin Maven Plugin (for JVM and Android)
  • end support for the separate Kover Gradle Plugin
  • decide on the implementation of the compiler plug-in to support other platforms (Add instrumentation support to Kotlin/Native targets  #293)
  • these steps are not final and may be changed during the design of the Kotlin Coverage architecture, as well as for technical reasons.

Open issues analysis

The bugs and suggestions listed below should be taken into account in Kotlin Coverage for Kotlin Gradle Plugin (or Maven)

Kotlin-specific Coverage Report

It is necessary to develop a report that will allow exporting information about code coverage.
This report should contain complete information that will be sufficient to transfer to external utilities, merge with each other, and convert to other universal formats.

Reports filtering

Kotlin Coverage HTML Report

External report formats

Integration with external tools

Integration with external tools will be performed after initial stabilization of DSL for Kotlin Coverge in KGP

IDE

Instrumentation

Gradle

Functional tests

Functional tests should be easy to read, and error messages should help you understand the root cause of the error.
Different versions of Gradle should be checked, as well as possibly different versions of Android.

Compiler plugin

@shanshin shanshin added Feature Feature request issue type S: untriaged Status: issue reported but unprocessed labels Jan 3, 2025
@shanshin shanshin self-assigned this Jan 3, 2025
This was referenced Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant