Ume Channel
11/06/2023, 4:02 PMJoffrey
11/06/2023, 4:03 PMkotlinx-coroutines-core
) to your build script (build.gradle.kts
)?Ume Channel
11/06/2023, 4:05 PMJoffrey
11/06/2023, 4:10 PMdependencies { ... }
block. Something like:
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
testImplementation(kotlin("test"))
}
If you look it up, you will find the kotlinx.coroutines repository, and there are instructions on how to add the dependency:
https://github.com/Kotlin/kotlinx.coroutines#gradle
(This is the case for any well-documented library)
This is where you can find the coordinates in the form groupId:artifactId:version
. For coroutines 1.7.3, the coordinates are org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
. This is why we add the line implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
.Joffrey
11/06/2023, 4:12 PMimplementation(...)
configuration. testImplementation
is for dependencies that are only used in your tests (this is why kotlin("test")
is added with testImplementation(...)
).
You can learn more about these configuration in the documentation of the Gradle build tool, which is what you're using here.
https://docs.gradle.org/current/userguide/declaring_dependencies.htmlUme Channel
11/06/2023, 4:13 PM