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

Fix breaking configuration cache #538

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ package kotlinx.kover.gradle.plugin.test.functional.cases
import kotlinx.kover.gradle.plugin.test.functional.framework.checker.checkNoAndroidSdk
import kotlinx.kover.gradle.plugin.test.functional.framework.runner.buildFromTemplate
import kotlinx.kover.gradle.plugin.test.functional.framework.runner.runWithParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import kotlin.test.assertContains
import kotlin.test.assertFalse

/**
* Tests on dependency check https://github.com/Kotlin/kotlinx-kover/issues/478.
*
* Temporary disabled
*/
@Disabled
class NoDependencyTests {
@Test
fun testJvmNotApplied() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class KoverGradlePlugin : Plugin<Project> {
val applier = ProjectApplier(target)
applier.onApply()

target.addDependencyListener()
target.addDeprecations()
}

Expand All @@ -55,18 +54,4 @@ class KoverGradlePlugin : Plugin<Project> {
this.extensions.create<KoverTaskExtension>("kover")
}
}

private fun Project.addDependencyListener() {
/*
The plugin is applied for each project, but different projects in the same build have the same `gradle` object
In order not to add the listener again, it is necessary to check whether we added it earlier.

The most reliable way is to use the extra properties extension,
because it is always present and tied to a specific instance of the `Gradle`.
*/
if (gradle.extraProperties.properties[LISTENER_ADDED_PROPERTY_NAME] == null) {
gradle.extraProperties.properties[LISTENER_ADDED_PROPERTY_NAME] = true
gradle.addListener(DependencyCheckListener())
}
}
}