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

Add composite build support #487

Open
shanshin opened this issue Oct 11, 2023 · 3 comments
Open

Add composite build support #487

shanshin opened this issue Oct 11, 2023 · 3 comments
Assignees
Labels
Feature Feature request issue type Implement in KGP

Comments

@shanshin
Copy link
Collaborator

It is necessary to understand whether it is possible to add support for composite builds in Kover.

If this is feasible, then it is necessary to think through the ways of implementation.

@gmazzo
Copy link

gmazzo commented Apr 24, 2024

Elaborating on this, what I meant at #598:

Variants are there, it's seems to a matter of the internal plugin resolution strategy.

By this, what I meant is that you are already exposing an outgoingVariant per module with the totals of the module, that you later use for the aggregation report (similar to that JaCoCo Report Aggregation works).

The issue to me, based on a quick source code inspection, as that you are managing dependencies linking by hand, instead of letting these artifacts to expose them.

I'm assuming this is some kind of intentional, as you also have some kind of dual behavior of "this module only" or "this module and its dependencies" when collecting the overage data.

Assuming my assessment is correct, what I'd suggestyou is to:

  1. Let outgoingVariant artifacts to properly expose they builder dependencies .builtBy(test) for instance.
  2. Expose two "total" outgoingVariants, one with dependencies and another without it to keep supporting the dual behavior, each one with an extra attribute to distinguish them: i.e. kotlinx.kover.withDependencies: true|false

@shanshin
Copy link
Collaborator Author

shanshin commented Apr 24, 2024

I'm assuming this is some kind of intentional, as you also have some kind of dual behavior of "this module only" or "this module and its dependencies" when collecting the overage data.

This is not quite true, this is done for the reason that the report options in the projects may vary. For example, in the current project there has variant debug, and dependency has only jvm. Hence, when creating custom options, a duality appears: look for this option only in the current module, or in all kover dependencies.
If there is no report variant in dependency, then a dependency resolution error may occur, so for simplicity, this approach is used.

Let outgoingVariant artifacts to properly expose they builder dependencies .builtBy(test) for instance.

It's already exposed, artifact is built by koverGenerateArtifact task (koverGenerateArtifactFoo), and it, in turn, depends on test tasks.


The problem of composite build support is more design-based, because Kover artifacts were invented to work within a single build.
They contain relative paths to all the necessary data, but we need to get the data itself from another build: the contents of binary reports, all the application class-files, all the sources.

@shanshin shanshin added S: postponed Status: work on the issue is not in the short term plans and removed S: untriaged Status: issue reported but unprocessed labels Apr 24, 2024
@shanshin shanshin added Feature Feature request issue type Implement in KGP and removed S: postponed Status: work on the issue is not in the short term plans labels Jan 3, 2025
@shanshin
Copy link
Collaborator Author

shanshin commented Jan 3, 2025

This task will be taken into account when migrating to Kotlin Gradle Plugin.

In the future, it will be moved to the Kotlin task tracker, or closed if it loses relevance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type Implement in KGP
Projects
None yet
Development

No branches or pull requests

2 participants