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

Kotlin DSL accessors are not available for Kover tasks #394

Closed
aSemy opened this issue May 31, 2023 · 2 comments · Fixed by #406
Closed

Kotlin DSL accessors are not available for Kover tasks #394

aSemy opened this issue May 31, 2023 · 2 comments · Fixed by #406
Assignees
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch

Comments

@aSemy
Copy link
Contributor

aSemy commented May 31, 2023

Describe the bug

I would like to be able to use type-safe Kotlin DSL accessors for accessing Kover tasks

It appears that Kover is using afterEvaluate {}

target.afterEvaluate {
applier.onAfterEvaluate()
}

which means that Gradle will not be able to generate the DSL accessors.

Reproducer

// build.gradle.kts

plugins {
  id("org.jetbrains.kotlinx.kover") version "0.7.0"
  kotlin("jvm") version "1.8.21"
}


val myCustomTask by tasks.registering {
  dependsOn(tasks.koverHtmlReport) // ERROR Unresolved reference: koverHtmlReport
}

Reports
If applicable, report files or screenshots.

Environment

  • Kover Gradle Plugin version: 0.7.0
  • Gradle version: 8.1.1
  • Kotlin project type: Kotlin/JVM
  • Coverage Toolset: n/a
  • Other context important for this bug: n/a
@aSemy aSemy added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels May 31, 2023
@shanshin shanshin added S: confirmed Status: bug is reproduced or present and removed S: untriaged Status: issue reported but unprocessed labels May 31, 2023
@shanshin
Copy link
Collaborator

Relates #338

shanshin added a commit that referenced this issue Jun 9, 2023
Now the search for build variants takes place in the `afterEvaluate` action, which is added when `finalizeDsl` is called - thus the Kover code is guaranteed to be executed after creating variants.

Additional changes:
* added DSL accessors for Kover Default report tasks
* added descriptions for Kover report tasks
* added functions for getting Kover Android report task names

Fixes #362
Fixes #394
Fixes #400
@shanshin shanshin reopened this Jun 16, 2023
@shanshin shanshin added S: ready for release Status: merged in the main branch and removed S: confirmed Status: bug is reproduced or present labels Jun 16, 2023
@shanshin
Copy link
Collaborator

Fixed in 0.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants