File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,17 +28,20 @@ application {
2828}
2929
3030val Project .hasFunTests
31- // Do not dig into sourceSets to avoid coupling between projects.
32- get() = projectDir.resolve(" src/funTest" ).isDirectory
31+ // Registering a feature automatically creates several configurations, see
32+ // https://docs.gradle.org/current/userguide/how_to_create_feature_variants_of_a_library.html#sec::declare_feature_variants
33+ get() = configurations.findByName(" funTestRuntimeElements" ) != null
3334
34- dependencies {
35- rootProject.subprojects.filter { it.hasFunTests }.forEach {
36- implementation(project(it.path)) {
37- capabilities {
38- // Note that this uses kebab-case although "registerFeature()" uses camelCase, see
39- // https://github.com/gradle/gradle/issues/31362.
40- @Suppress(" UnstableApiUsage" )
41- requireFeature(" fun-test" )
35+ gradle.projectsEvaluated {
36+ dependencies {
37+ rootProject.subprojects.filter { it.hasFunTests }.forEach {
38+ runtimeOnly(project(it.path)) {
39+ capabilities {
40+ // Note that this uses kebab-case although "registerFeature()" uses camelCase, see
41+ // https://github.com/gradle/gradle/issues/31362.
42+ @Suppress(" UnstableApiUsage" )
43+ requireFeature(" fun-test" )
44+ }
4245 }
4346 }
4447 }
You can’t perform that action at this time.
0 commit comments