Skip to content

Commit 2645856

Browse files
committed
update: align multiplatform docs to {} block style
1 parent 42e9463 commit 2645856

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

docs/topics/multiplatform/multiplatform-add-dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Every program requires a set of libraries to operate successfully. A Kotlin Mult
44
multiplatform libraries that work for all target platforms, platform-specific libraries, and other multiplatform projects.
55

66
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)
88
block:
99

1010
<tabs group="build-script">

docs/topics/multiplatform/multiplatform-android-dependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Moving what was a top-level dependency in an Android project to a specific sourc
3636
might be difficult if the top-level dependency had a non-trivial configuration name. For example, to move
3737
a `debugImplementation` dependency from the top level of an Android project, you'll need to add an implementation
3838
dependency to the source set named `androidDebug`. To minimize the effort you have to put in to deal with migration
39-
problems like this, you can add a `dependencies` block inside the `android` block:
39+
problems like this, you can add a `dependencies {}` block inside the `android {}` block:
4040

4141
<tabs group="build-script">
4242
<tab title="Kotlin" group-key="kotlin">
@@ -68,7 +68,7 @@ android {
6868
Dependencies declared here will be treated exactly the same as dependencies from the top-level block, but declaring them
6969
this way will also separate Android dependencies visually in your build script and make it less confusing.
7070

71-
Putting dependencies into a standalone `dependencies` block at the end of the script, in a way that is idiomatic to
71+
Putting dependencies into a standalone `dependencies {}` block at the end of the script, in a way that is idiomatic to
7272
Android projects, is also supported. However, we strongly recommend **against** doing this because configuring a build
7373
script with Android dependencies in the top-level block and other target dependencies in each source set is likely to
7474
cause confusion.

docs/topics/multiplatform/multiplatform-compatibility-guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ with available Gradle, Xcode, and Android Gradle plugin versions:
2222

2323
**What's changed?**
2424

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
2626
the `findByName("targetName")` method instead.
2727

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`.
2929

3030
**What's the best practice now?**
3131

@@ -66,7 +66,7 @@ kotlin {
6666

6767
**When do the changes take effect?**
6868

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.
7070

7171
For more information, see the [corresponding issue in YouTrack](https://youtrack.jetbrains.com/issue/KT-47047).
7272

@@ -367,7 +367,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
367367
**What's the best practice now?**
368368

369369
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:
371371

372372
<tabs>
373373
<tab title="kotlin-js">
@@ -412,13 +412,13 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
412412
2. Move your source files from the `main` and `test` folders to the `jsMain` and `jsTest` folders in the same directory.
413413
3. Adjust dependency declarations:
414414

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.
417417
See [Adding dependencies](multiplatform-add-dependencies.md) for more details.
418418
* However, if you want to declare your dependencies in a top-level block,
419419
change declarations from `api("group:artifact:1.0")` to `add("jsMainApi", "group:artifact:1.0")` and so on.
420420

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".
422422
>
423423
{type="note"}
424424

@@ -459,7 +459,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
459459
// ...
460460
}
461461

462-
// Option #1. Declare dependencies in the sourceSets block:
462+
// Option #1. Declare dependencies in the sourceSets {} block:
463463
sourceSets {
464464
val jsMain by getting {
465465
dependencies {
@@ -479,7 +479,7 @@ load on the Kotlin team. We encourage you to migrate to the `kotlin-multiplatfor
479479
</tab>
480480
</tabs>
481481

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,
483483
if you were referring to low-level Gradle entities, like tasks and configurations, by names, you now need to adjust them,
484484
usually by adding the `js` prefix. For example, you can find the `browserTest` task under the name `jsBrowserTest`.
485485

docs/topics/multiplatform/multiplatform-native-artifacts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ artifact with new DSL.
2525

2626
## Declare binaries
2727

28-
The `kotlinArtifacts` element is the top-level block for artifact configuration in the Gradle build script. Use
29-
the following kinds of binaries to declare elements of the `kotlinArtifacts` DSL:
28+
`kotlinArtifacts {}` is the top-level block for artifact configuration in the Gradle build script. Use
29+
the following kinds of binaries to declare elements of the `kotlinArtifacts {}` DSL:
3030

3131
| Factory method | Binary kind | Available for |
3232
|----------------|-------------------------------------------------------------------------------------------|----------------------------------------------|

0 commit comments

Comments
 (0)