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

Simplify selection of kotlin.test capability #1535

Merged
merged 1 commit into from
Sep 29, 2023
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
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ve
kotlin-serializationPlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }

kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Expand Down
7 changes: 1 addition & 6 deletions redwood-treehouse-host/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ dependencies {

// The kotlin.test library provides JVM variants for multiple testing frameworks. The Kotlin
// plugin does not apply the capability to configurations created by the Android plugin.
androidTestImplementation(libs.kotlin.test) {
capabilities {
requireCapability(
"org.jetbrains.kotlin:kotlin-test-framework-junit:${libs.versions.kotlin.get()}")
}
}
androidTestImplementation libs.kotlin.test.junit
}

android {
Expand Down
31 changes: 14 additions & 17 deletions redwood-widget-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@ kotlin {
api projects.redwoodWidget
}
}
}
}

dependencies {
// The kotlin.test library provides JVM variants for multiple testing frameworks. When used
// as a test dependency this selection is transparent. But since we are publishing a library
// we need to select one ourselves at compilation time.
def configurationNames = [
"jvmMainImplementation",
"debugImplementation",
"releaseImplementation",
]
for (configurationName in configurationNames) {
add(configurationName, libs.kotlin.test) {
capabilities {
requireCapability(
"org.jetbrains.kotlin:kotlin-test-framework-junit:${libs.versions.kotlin.get()}")
androidMain {
dependencies {
// The kotlin.test library provides JVM variants for multiple testing frameworks. When used
// as a test dependency this selection is transparent. But since we are publishing a library
// we need to select one ourselves at compilation time.
api libs.kotlin.test.junit
}
}
jvmMain {
dependencies {
// The kotlin.test library provides JVM variants for multiple testing frameworks. When used
// as a test dependency this selection is transparent. But since we are publishing a library
// we need to select one ourselves at compilation time.
api libs.kotlin.test.junit
}
}
}
Expand Down