You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-31
Original file line number
Diff line number
Diff line change
@@ -145,19 +145,6 @@ plugins {
145
145
146
146
Make sure that you have either `jcenter()` or `mavenCentral()` in the list of repositories.
147
147
148
-
### Multiplatform
149
-
150
-
Core modules of `kotlinx.coroutines` are also available for
151
-
[Kotlin/JS](#js) and [Kotlin/Native](#native).
152
-
In common code that should get compiled for different platforms, you can add dependency to `kotlinx-coroutines-core` right to the `commonMain` source set:
This gives you access to Android [Dispatchers.Main]
171
158
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
172
-
exception is logged before crashing Android application, similarly to the way uncaught exceptions in
173
-
threads are handled by Android runtime.
159
+
exception is logged before crashing Android application, similarly to the way uncaught exceptions in
160
+
threads are handled by Android runtime.
174
161
175
162
#### R8 and ProGuard
176
163
177
164
R8 and ProGuard rules are bundled into the [`kotlinx-coroutines-android`](ui/kotlinx-coroutines-android) module.
178
-
For more details see ["Optimization" section for Android](ui/kotlinx-coroutines-android/README.md#optimization).
165
+
For more details see ["Optimization" section for Android](ui/kotlinx-coroutines-android/README.md#optimization).
179
166
180
167
#### Avoiding including the debug infrastructure in the resulting APK
181
168
@@ -188,27 +175,40 @@ packagingOptions {
188
175
}
189
176
```
190
177
191
-
### JS
178
+
### Multiplatform
179
+
180
+
Core modules of `kotlinx.coroutines` are also available for
181
+
[Kotlin/JS](https://kotlinlang.org/docs/reference/js-overview.html) and [Kotlin/Native](https://kotlinlang.org/docs/reference/native-overview.html).
182
+
183
+
In common code that should get compiled for different platforms, you can add dependency to `kotlinx-coroutines-core` right to the `commonMain` source set:
(follow the link to get the dependency declaration snippet).
196
-
197
-
You can also use [`kotlinx-coroutines-core`](https://www.npmjs.com/package/kotlinx-coroutines-core) package via NPM.
200
+
(follow the link to get the dependency declaration snippet) and as [`kotlinx-coroutines-core`](https://www.npmjs.com/package/kotlinx-coroutines-core) NPM package.
198
201
199
-
### Native
202
+
####Native
200
203
201
-
[Kotlin/Native](https://kotlinlang.org/docs/native-overview.html) version of `kotlinx.coroutines` is published as
(follow the link to get the dependency declaration snippet).
204
+
Kotlin/Native version of `kotlinx.coroutines` is published as
205
+
[`kotlinx-coroutines-core-$platform`](https://mvnrepository.com/search?q=kotlinx-coroutines-core-) where `$platform` is
206
+
the target Kotlin/Native platform. [List of currently supported targets](https://github.com/Kotlin/kotlinx.coroutines/blob/master/gradle/compile-native-multiplatform.gradle#L16).
204
207
205
-
Only single-threaded code (JS-style) on Kotlin/Native is currently supported.
206
-
Kotlin/Native supports only Gradle version 4.10 and you need to enable Gradle metadata in your
207
-
`settings.gradle` file:
208
208
209
-
```groovy
210
-
enableFeaturePreview('GRADLE_METADATA')
211
-
```
209
+
Only single-threaded code (JS-style) on Kotlin/Native is supported in stable versions.
210
+
Additionally, special `-native-mt` version is released on a regular basis, for the state of multi-threaded coroutines support
211
+
please follow the [corresponding issue](https://github.com/Kotlin/kotlinx.coroutines/issues/462) for the additional details.
212
212
213
213
Since Kotlin/Native does not generally provide binary compatibility between versions,
214
214
you should use the same version of Kotlin/Native compiler as was used to build `kotlinx.coroutines`.
0 commit comments