Skip to content

Commit b5987c8

Browse files
authored
Update Kotlin SDK version constant (#3249)
## Pull Request Info Jira ticket: N/A - Update Kotlin SDK version snooty constant - [Install the Kotlin SDK](https://preview-mongodbcbullinger.gatsbyjs.io/realm/docsp-39290-kotlin-k2/sdk/kotlin/install): Formatting updates ### Reminder Checklist Before merging your PR, make sure to check a few things. - [x] Did you tag pages appropriately? - genre - meta.keywords - meta.description - [x] Describe your PR's changes in the Release Notes section - [x] Create a Jira ticket for related docs-app-services work, if any ### Release Notes - **Kotlin** SDK - Install: Update listed SDK version ### Review Guidelines [REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)
1 parent d0c1d17 commit b5987c8

File tree

2 files changed

+72
-61
lines changed

2 files changed

+72
-61
lines changed

snooty.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ atlas = "Atlas"
8383
admin-api-page = "/admin/api/v3/#"
8484
base-url = "https://www.mongodb.com/docs/realm"
8585
cpp-prefix = "https://www.mongodb.com/docs/realm-sdks/cpp/latest"
86-
kotlin-sdk-version = "1.11.0"
86+
kotlin-sdk-version = "1.16.0"
8787
kotlinx-coroutines-version = "1.7.0"
8888
kotlin-sync-prefix = "https://www.mongodb.com/docs/realm-sdks/kotlin/latest/library-sync/"
8989
kotlin-local-prefix = "https://www.mongodb.com/docs/realm-sdks/kotlin/latest/library-base/"
90-
java-sdk-version = "10.11.1"
90+
java-sdk-version = "10.18.0"
9191
max-graphql-resolvers = "ten"
9292
max-graphql-relationship-depth = "five"
9393
name-char-limit = "57"

source/sdk/kotlin/install.txt

Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ Install the Kotlin SDK
1010
:depth: 2
1111
:class: singlecol
1212

13+
.. meta::
14+
:description: Learn how to install the Atlas Device SDK for Kotlin in your Android and Kotlin Multiplatform (KMP) projects.
15+
:keywords: code example
1316

14-
The Kotlin SDK supports two platforms, each with its own installation
15-
method:
17+
.. facet::
18+
:name: genre
19+
:values: tutorial
20+
21+
The Atlas Device SDK for Kotlin supports the following platforms. Each has its own installation
22+
method and requirements:
1623

1724
- :ref:`Android <kotlin-install-android>`
1825
- :ref:`Kotlin Multiplatform (KMP) <kotlin-install-kotlin-multiplatform>`
@@ -28,19 +35,21 @@ meets the following prerequisites:
2835
- Kotlin Plugin for Android Studio, version 1.6.10 or higher.
2936
- An Android Virtual Device (AVD) using a supported CPU architecture.
3037

38+
For a list of supported target environments, refer to the :ref:`kotlin-supported-environments` section on this page.
39+
3140
Additionally, Kotlin Multiplatform (KMP) for mobile projects require the following:
3241

3342
- `Kotlin Multiplatform Mobile (KMM) Plugin
3443
<https://kotlinlang.org/docs/mobile/kmm-plugin-releases.html#release-details>`__
3544
for Android Studio, version 0.3.1 or higher.
36-
- A Kotlin Multiplatform (KMP) App created using the "Kotlin Multiplatform App"
37-
template in Android Studio. Follow the instructions in the
38-
`Kotlin Multiplatform documentation
45+
- A Kotlin Multiplatform (KMP) App created using the "Kotlin Multiplatform App"
46+
template in Android Studio. Follow the instructions in the
47+
`Kotlin Multiplatform documentation
3948
<https://kotlinlang.org/docs/mobile/create-first-app.html>`__.
4049

4150
For more details on setting up your KMP environment, refer to the `official Kotlin
42-
Kotlin Multiplatform for mobile documentation
43-
<https://kotlinlang.org/docs/multiplatform-mobile-setup.html>`__. To verify your
51+
Kotlin Multiplatform for mobile
52+
<https://kotlinlang.org/docs/multiplatform-mobile-setup.html>`__ documentation. To verify your
4453
environment setup, follow Kotlin's `guide to checking your
4554
environment
4655
<https://kotlinlang.org/docs/multiplatform-mobile-setup.html#check-your-environment>`__.
@@ -50,8 +59,8 @@ environment
5059
The Kotlin Multiplatform (KMP) ecosystem frequently changes. If you experience
5160
any issues installing the SDK, check your Kotlin Plugin version, since
5261
outdated plugins can lead to difficult to debug errors. To see which
53-
versions of the Kotlin Plugin are compatible with the SDK, see the
54-
`realm-kotlin changelog <https://github.com/realm/realm-kotlin/blob/master/CHANGELOG.md>`__.
62+
versions of the Kotlin Plugin are compatible with the SDK, refer to the
63+
`SDK changelog <https://github.com/realm/realm-kotlin/blob/master/CHANGELOG.md>`__.
5564

5665
.. _kotlin-install-kotlin-multiplatform:
5766
.. _kotlin-install-android:
@@ -72,32 +81,32 @@ Installation
7281

7382
.. tab:: Android
7483
:tabid: android
75-
76-
Add :file:`io.realm.kotlin`, specifying the library version and
77-
:file:`apply false`, to the list of plugins in your project-level Gradle
84+
85+
Add :file:`io.realm.kotlin`, specifying the library version and
86+
:file:`apply false`, to the list of plugins in your project-level Gradle
7887
build file, typically found at :file:`<project>/build.gradle`:
7988

8089
.. code-block:: kotlin
8190
:caption: Global build.gradle
82-
91+
8392
plugins {
8493
id 'io.realm.kotlin' version '{+kotlin-sdk-version+}' apply false
8594
}
86-
95+
8796
Add the following to your app-level Gradle build file, typically
8897
found at :file:`<project>/app/build.gradle`:
8998

9099
- Add :file:`io.realm.kotlin` to the list of plugins.
91100
- Add the following to the list of dependencies:
92-
101+
93102
- Add :file:`io.realm.kotlin:library-base` to the dependencies block.
94103
- If using Device Sync in your application, add :file:`io.realm.kotlin:library-sync` to the dependencies block.
95104

96105
- To use coroutines with the SDK, add :file:`org.jetbrains.kotlinx:kotlinx-coroutines-core` to the list of dependencies.
97106

98107
.. code-block:: kotlin
99108
:caption: Module build.gradle
100-
:emphasize-lines: 4, 12, 13, 14
109+
:emphasize-lines: 4, 12-16
101110

102111
plugins {
103112
id 'com.android.application'
@@ -110,84 +119,85 @@ Installation
110119
}
111120

112121
dependencies {
113-
implementation 'io.realm.kotlin:library-base:{+kotlin-sdk-version+}'
114-
implementation 'io.realm.kotlin:library-sync:{+kotlin-sdk-version+}'// If using Device Sync
115-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:{+kotlinx-coroutines-version+}' // If using coroutines with the SDK
122+
implementation 'io.realm.kotlin:library-base:{+kotlin-sdk-version+}'
123+
// If using Device Sync
124+
implementation 'io.realm.kotlin:library-sync:{+kotlin-sdk-version+}'
125+
// If using coroutines with the SDK
126+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:{+kotlinx-coroutines-version+}'
116127
}
117128

118129
.. tab:: Kotlin Multiplatform (KMP)
119130
:tabid: kmp
120131

121-
Add the following to your app-level Gradle build file, typically
122-
found at :file:`<project>/app/build.gradle`:
123-
124-
- Add :file:`io.realm.kotlin` to the list of plugins.
125-
- Add the following to the list of dependencies:
126-
127-
- Add :file:`io.realm.kotlin:library-base` to the dependencies block.
128-
- If using Device Sync in your application, add :file:`io.realm.kotlin:library-sync` to the dependencies block.
129-
130-
- To use coroutines with the SDK, add :file:`org.jetbrains.kotlinx:kotlinx-coroutines-core` to the list of dependencies.
132+
1. Add the following to your app-level Gradle build file, typically found at :file:`<project>/app/build.gradle`:
131133

132-
.. code-block:: kotlin
133-
:caption: Module build.gradle
134-
:emphasize-lines: 5, 18, 19, 20
134+
- Add :file:`io.realm.kotlin` to the list of plugins.
135+
- Add the following to the list of dependencies:
135136

136-
plugins {
137-
kotlin("multiplatform")
138-
kotlin("native.cocoapods")
139-
id("com.android.library")
140-
id("io.realm.kotlin") version "{+kotlin-sdk-version+}"
141-
}
137+
- Add :file:`io.realm.kotlin:library-base` to the dependencies block.
138+
- If using Device Sync in your application, add :file:`io.realm.kotlin:library-sync` to the dependencies block.
142139

143-
version = "1.0"
140+
- To use coroutines with the SDK, add :file:`org.jetbrains.kotlinx:kotlinx-coroutines-core` to the list of dependencies.
144141

145-
kotlin {
146-
android()
147-
iosX64()
148-
iosArm64()
142+
.. code-block:: kotlin
143+
:caption: App build.gradle
144+
:emphasize-lines: 5, 18-22
145+
146+
plugins {
147+
kotlin("multiplatform")
148+
kotlin("native.cocoapods")
149+
id("com.android.library")
150+
id("io.realm.kotlin") version "{+kotlin-sdk-version+}"
151+
}
149152

150-
sourceSets {
151-
val commonMain by getting {
152-
dependencies {
153-
implementation("io.realm.kotlin:library-base:{+kotlin-sdk-version+}")
154-
implementation("io.realm.kotlin:library-sync:{+kotlin-sdk-version+}") // If using Device Sync
155-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:{+kotlinx-coroutines-version+}") // If using coroutines with the SDK
153+
version = "1.0"
154+
155+
kotlin {
156+
android()
157+
iosX64()
158+
iosArm64()
159+
160+
sourceSets {
161+
val commonMain by getting {
162+
dependencies {
163+
implementation("io.realm.kotlin:library-base:{+kotlin-sdk-version+}")
164+
// If using Device Sync
165+
implementation("io.realm.kotlin:library-sync:{+kotlin-sdk-version+}")
166+
// If using coroutines with the SDK
167+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:{+kotlinx-coroutines-version+}")
168+
}
156169
}
157170
}
158171
}
159-
}
160172

161-
.. note:: Android Module Dependencies
162-
163-
If you use any part of the SDK inside the Android module, add the
164-
SDK's compile-time dependency to your Android module :file:`build.gradle.kts`:
173+
2. If you use any part of the SDK inside the Android module, add the following compile-time dependencies to your module-level Gradle build file, typically found at :file:`<project>/module/build.gradle`:
165174

166175
.. code-block:: kotlin
167-
:copyable: false
176+
:caption: Android Module build.gradle
168177

169178
dependencies {
170179
compileOnly("io.realm.kotlin:library-base:{+kotlin-sdk-version+}")
171180
}
172-
173181
// If using Device Sync
174182
dependencies {
175183
compileOnly("io.realm.kotlin:library-sync:{+kotlin-sdk-version+}")
176184
}
177185

178-
.. step:: Sync Gradle Files
186+
.. step:: Sync Gradle Files
179187

180188
After updating the Gradle configuration,
181189
resolve the dependencies by clicking :guilabel:`File` >
182190
:guilabel:`Sync Project with Gradle Files` in the Android Studio menu bar.
183191
You can now use the Kotlin SDK in your application.
184192

193+
.. _kotlin-supported-environments:
185194

186195
Supported Target Environments
187196
-----------------------------
188197

189-
Kotlin Multiplatform (KMP) supports a `wide range of application environments
190-
<https://kotlinlang.org/docs/multiplatform-dsl-reference.html#targets>`__.
198+
Kotlin Multiplatform (KMP) supports a wide range of application environments
199+
Refer also to Kotlin's `Multiplatform Gradle DSL reference: Targets
200+
<https://kotlinlang.org/docs/multiplatform-dsl-reference.html#targets>`__ documentation.
191201

192202
Supported Environments
193203
~~~~~~~~~~~~~~~~~~~~~~
@@ -239,3 +249,4 @@ The Kotlin SDK does *not* support the following environments:
239249
- :file:`watchosSimulatorArm64`
240250
- :file:`watchosX86`
241251
- :file:`watchosX64`
252+

0 commit comments

Comments
 (0)