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: docs/topics/multiplatform/multiplatform-add-dependencies.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Every program requires a set of libraries to operate successfully. A Kotlin Mult
4
4
multiplatform libraries that work for all target platforms, platform-specific libraries, and other multiplatform projects.
5
5
6
6
To add a dependency on a library, update your `build.gradle(.kts)` file in the directory of your project containing shared code. Set a
7
-
dependency of the required [type](gradle-configure-project.md#dependency-types) (for example, `implementation`) in the [`dependencies`](multiplatform-dsl-reference.md#dependencies)
7
+
dependency of the required [type](gradle-configure-project.md#dependency-types) (for example, `implementation`) in the [`dependencies {}`](multiplatform-dsl-reference.md#dependencies)
Copy file name to clipboardExpand all lines: docs/topics/multiplatform/multiplatform-compatibility-guide.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,10 @@ with available Gradle, Xcode, and Android Gradle plugin versions:
22
22
23
23
**What's changed?**
24
24
25
-
Target accessors auto-generated by Gradle are no longer available inside the `kotlin.targets` block. Use
25
+
Target accessors auto-generated by Gradle are no longer available inside the `kotlin.targets {}` block. Use
26
26
the `findByName("targetName")` method instead.
27
27
28
-
Note that such accessors are still available in the `kotlin.targets` case, for example, `kotlin.targets.linuxX64`.
28
+
Note that such accessors are still available in the `kotlin.targets {}` case, for example, `kotlin.targets.linuxX64`.
29
29
30
30
**What's the best practice now?**
31
31
@@ -66,7 +66,7 @@ kotlin {
66
66
67
67
**When do the changes take effect?**
68
68
69
-
In Kotlin 1.7.20, an error is introduced when using target accessors in the `kotlin.targets` block.
69
+
In Kotlin 1.7.20, an error is introduced when using target accessors in the `kotlin.targets {}` block.
70
70
71
71
For more information, see the [corresponding issue in YouTrack](https://youtrack.jetbrains.com/issue/KT-47047).
72
72
@@ -367,7 +367,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
367
367
**What's the best practice now?**
368
368
369
369
1. Remove the `kotlin-js` Gradle plugin from your project and apply `kotlin-multiplatform` in the `settings.gradle.kts` file
370
-
if you're using the `pluginManagement` block:
370
+
if you're using the `pluginManagement {}` block:
371
371
372
372
<tabs>
373
373
<tabtitle="kotlin-js">
@@ -412,13 +412,13 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
412
412
2. Move your source files from the `main` and `test` folders to the `jsMain` and `jsTest` folders in the same directory.
413
413
3. Adjust dependency declarations:
414
414
415
-
* We recommend using the `sourceSets` block and configuring dependencies of respective source sets,
416
-
`jsMain` for production dependencies and `jsTest` for test dependencies.
415
+
* We recommend using the `sourceSets {}` block and configuring dependencies of respective source sets,
416
+
`jsMain {}` for production dependencies and `jsTest {}` for test dependencies.
417
417
See [Adding dependencies](multiplatform-add-dependencies.md) for more details.
418
418
* However, if you want to declare your dependencies in a top-level block,
419
419
change declarations from `api("group:artifact:1.0")` to `add("jsMainApi", "group:artifact:1.0")` and so on.
420
420
421
-
> In this case, make sure that the top-level `dependencies` block comes **after** the `kotlin` block. Otherwise, you'll get an error "Configuration not found".
421
+
> In this case, make sure that the top-level `dependencies {}` block comes **after** the `kotlin {}` block. Otherwise, you'll get an error "Configuration not found".
422
422
>
423
423
{type="note"}
424
424
@@ -459,7 +459,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
459
459
// ...
460
460
}
461
461
462
-
// Option #1. Declare dependencies in the sourceSets block:
462
+
// Option #1. Declare dependencies in the sourceSets {} block:
463
463
sourceSets {
464
464
val jsMain by getting {
465
465
dependencies {
@@ -479,7 +479,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
479
479
</tab>
480
480
</tabs>
481
481
482
-
4. The DSL provided by the Kotlin Gradle plugin inside the `kotlin` block remains unchanged in most cases. However,
482
+
4. The DSL provided by the Kotlin Gradle plugin inside the `kotlin {}` block remains unchanged in most cases. However,
483
483
if you were referring to low-level Gradle entities, like tasks and configurations, by names, you now need to adjust them,
484
484
usually by adding the `js` prefix. For example, you can find the `browserTest` task under the name `jsBrowserTest`.
0 commit comments