Skip to content

Commit 2342c07

Browse files
authored
Fixed Gradle 9.0 migration issue
`attributes` block shouldn't be used in dependency configurations Fixes #716 PR #723
1 parent d9b5f4d commit 2342c07

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2017-2025 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
package kotlinx.kover.gradle.plugin.test.functional.cases
6+
7+
import kotlinx.kover.gradle.plugin.test.functional.framework.configurator.BuildConfigurator
8+
import kotlinx.kover.gradle.plugin.test.functional.framework.starter.GeneratedTest
9+
import kotlin.test.assertFalse
10+
11+
internal class CompatibilityTests {
12+
13+
@GeneratedTest
14+
fun BuildConfigurator.testGradle9Compatibility() {
15+
addProjectWithKover {
16+
sourcesFrom("simple")
17+
}
18+
19+
run("test") {
20+
assertFalse(output.contains("Deprecated Gradle features were used in this build"), "There should be no deprecated Gradle features")
21+
}
22+
23+
}
24+
}

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/aggregation/settings/KoverSettingsGradlePlugin.kt

-6
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class KoverSettingsGradlePlugin: Plugin<Settings> {
5252

5353
val agentDependency = configurations.create(SettingsNames.DEPENDENCY_AGENT) {
5454
asDependency()
55-
attributes {
56-
attribute(Usage.USAGE_ATTRIBUTE, objects.named(KoverUsageAttr.VALUE))
57-
}
5855
}
5956
dependencies.add(agentDependency.name, rootProject)
6057

@@ -78,9 +75,6 @@ public class KoverSettingsGradlePlugin: Plugin<Settings> {
7875

7976
val dependencyConfig = configurations.create(KOVER_DEPENDENCY_NAME) {
8077
asDependency()
81-
attributes {
82-
attribute(Usage.USAGE_ATTRIBUTE, objects.named(KoverUsageAttr.VALUE))
83-
}
8478
}
8579

8680
val eachProjectRules = mutableMapOf<String, List<ProjectVerificationRuleSettingsImpl>>()

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/plugin/appliers/PrepareKover.kt

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ import org.gradle.kotlin.dsl.register
2323
internal fun prepare(project: Project): KoverContext {
2424
val koverBucketConfiguration = project.configurations.create(KOVER_DEPENDENCY_NAME) {
2525
asBucket()
26-
attributes {
27-
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(KoverUsageAttr.VALUE))
28-
}
2926
}
3027

3128
// Project always consumes its own artifacts

0 commit comments

Comments
 (0)