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

Design proposal: move the current functionality of Kover Gradle Plugin to Kotlin Gradle Plugin #608

Open
shanshin opened this issue May 15, 2024 · 0 comments
Assignees
Labels
Feature Feature request issue type S: untriaged Status: issue reported but unprocessed

Comments

@shanshin
Copy link
Collaborator

Abstract

Calculating code coverage for applications written in Kotlin is a basic functionality closely related to the language itself.

Now this functionality is supplied separately in the form of a Gradle plugin, which is in no way related to the Kotlin compiler used.
Enabling coverage measurement requires a number of additional actions, using a plugin, and configuring scripts through extensions unrelated to Kotlin.

The Kotlin coverage settings have nothing to do with the Kotlin settings, which makes these settings less obvious.

For a smoother use of Kotlin, we decided to move the DSL coverage collection settings to Kotlin Gradle Plugin.

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

Among the additional advantages, integration with Kotlin Gradle Plugin will allow to add the functionality of native targets instrumentation more smoothly

Continued development of Kover Gradle Plugin

We will continue to maintain the current plugin and also add some small but convenient functionality.

Planned changes:

However, the development of new big features will be suspended within this plugin, DSL will no longer be redesigned.

Products and naming

Functionality of coverage measurement settings will move to Kotlin Gradle Plugin and Kotlin Maven Plugin.

The word Kover will denote a variety of tools that will be published for general use, designed to work with the coverage of applications written in Kotlin.
Such tools will solve highly specialized tasks, and it is assumed that they will be used in custom pipelines: called from CLI scripts or from other build systems.

Examples of these tools:

  • JVM agent
  • generating human-readable reports
  • verification of coverage values
  • working with the Kotlin code coverage export format

Development milestones

  • finalizing the tasks specified in section
  • develop a temporary kover settings plugin as prototype of configuring coverage in Kotlin Gradle Plugin to test new ideas
  • after the stabilization of the design and processing of the main user cases collected on the basis of settings plugin feedback, integration with Kotlin Gradle Plugin will begin
  • full integration with Kotlin Gradle Plugin and alignment of workflow and lifecycles, new HTML and export reports
  • implementation of coverage measurement support in the Kotlin compiler
@shanshin shanshin added Feature Feature request issue type S: untriaged Status: issue reported but unprocessed labels May 15, 2024
@shanshin shanshin self-assigned this May 15, 2024
qwwdfsad added a commit that referenced this issue May 16, 2024
* It is here to stay
* We would live to maintain it in its current form and have a clear vision for future development (#608) with a straightforward migration plan
qwwdfsad added a commit that referenced this issue May 16, 2024
* It is here to stay
* We would live to maintain it in its current form and have a clear vision for future development (#608) with a straightforward migration plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type S: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

No branches or pull requests

1 participant