Hi, question about coroutines. I’m a bit confused ...
# announcements
j
Hi, question about coroutines. I’m a bit confused about kolinx.couroutines vs kotlin.coroutines. What is the difference? docs (https://kotlinlang.org/docs/reference/coroutines-overview.html) are the former. Gradle kotlin-dsl example the later for example
a
My guess is
x
is for Kotlin pre-1.3 and without
x
is 1.3 and later
j
Nope
Copy code
kotlin.coroutines
is also present in 1.2. On contrary if I enable coroutines support in gradle kotlin-dsl then
Copy code
kotlinx.coutrines.experimental
is still not importable within the project
s
kotlin.coroutines is barebones included in the stdlib. kotlinx.coroutines extends on that as a separate library
j
Ok… I suspected something like that. Any idea how to add kotlinx couroutines to Gradle project?
I’m using the koltin-dsl. Well I suppose I can “manually” add it
s
g
You can add them as any other build script dependency: as dependency of Gradle plugin or add to
buildscript { dependencies {} }
block