Skip to content

Commit d7a3887

Browse files
committed
update
1 parent 3f35874 commit d7a3887

File tree

3 files changed

+112
-55
lines changed

3 files changed

+112
-55
lines changed

docs/platforms/kotlin-multiplatform/index.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,18 @@ The table below lists supported platforms and their corresponding presets.
5757
- Native crash reporting for iOS, macOS, tvOS, and watchOS, leveraging our [Cocoa SDK](/platforms/apple)
5858
- Automatic breadcrumbs for app lifecycle and UI events
5959

60-
## Apple Installation Methods
60+
## Plugin Configuration
6161

62-
### Swift Package Manager (SPM)
62+
The Sentry Kotlin Multiplatform Plugin can be configured in the `build.gradle.kts` file of your shared module.
6363

64-
Swift Package Manager (SPM) is a powerful tool for managing dependencies in Swift that allows developers to enjoy a more native integration experience with Xcode.
65-
If you already use SPM or prefer it over other package managers on Apple platforms, this guide will show you how to install the Kotlin Multiplatform SDK while using Swift Package Manager.
64+
```kotlin {filename:shared/build.gradle.kts}
65+
sentryKmp {
66+
autoInstall {
67+
// Configure auto installation
68+
}
6669

67-
#### Install
68-
69-
In order to install the Sentry Kotlin Multiplatform SDK, you need to use Cocoapods and Swift Package Manager simultaneously which might seem unconventional at first, especially if you're accustomed to using SPM for all your dependencies. However, you can achieve a smooth integration by using the Kotlin Cocoapods plugin specifically for compiling and building the shared framework. You can then continue to manage all other dependencies with SPM as usual.
70-
71-
Follow the steps for our primary installation method [Cocoapods](/platforms/kotlin-multiplatform/#install) to install the Sentry Kotlin Multiplatform SDK.
72-
73-
After you've consumed the shared framework in your application via Cocoapods, you can continue with SPM for other dependencies without disrupting your existing workflow.
70+
linker {
71+
// Configure the linker (only relevant if you are using SPM)
72+
}
73+
}
74+
```
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Manual Setup
3+
sidebar_order: 1
4+
description: "Learn how to set up the SDK manually."
5+
---
6+
7+
If you can't (or prefer not to) run the [automatic setup](/platforms/kotlin-multiplatform/#install), you can follow the instructions below to configure your application manually.
8+
9+
## Install
10+
11+
Sentry captures data by using an SDK within your application’s runtime.
12+
13+
To install the Kotlin Multiplatform SDK, you need to add the following to your `build.gradle.kts` file in your shared module:
14+
15+
```kotlin {filename:shared/build.gradle.kts}
16+
plugins {
17+
kotlin("multiplatform")
18+
kotlin("native.cocoapods")
19+
// .. your other plugins
20+
}
21+
22+
kotlin {
23+
android()
24+
iosX64()
25+
iosArm64()
26+
iosSimulatorArm64()
27+
28+
sourceSets {
29+
val commonMain by getting {
30+
dependencies {
31+
implementation("io.sentry:sentry-kotlin-multiplatform:{{@inject packages.version('sentry.kotlin.kmp', '0.0.1-alpha.2') }}")
32+
}
33+
}
34+
35+
// Android target
36+
val androidMain by getting {
37+
dependsOn(commonMain)
38+
}
39+
40+
// Apple targets:
41+
val iosMain by getting {
42+
dependsOn(commonMain)
43+
}
44+
}
45+
46+
cocoapods {
47+
summary = "Some description for the Shared Module"
48+
homepage = "Link to the Shared Module homepage"
49+
ios.deploymentTarget = "14.1"
50+
podfile = project.file("../iosApp/Podfile")
51+
// Make sure you use the proper version according to our Cocoa SDK Version Compatibility Table.
52+
pod("Sentry") {
53+
version = "~> 8.25"
54+
linkOnly = true
55+
extraOpts += listOf("-compiler-option", "-fmodules")
56+
}
57+
framework {
58+
baseName = "shared"
59+
}
60+
}
61+
}
62+
```
63+
64+
## Configure
65+
66+
Configuration should happen as early as possible in your application's lifecycle.
67+
68+
<PlatformContent includePath="getting-started-config" />
69+
70+
## Verify
71+
72+
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
73+
74+
<PlatformContent includePath="getting-started-verify" />
75+
76+
<Note>
77+
78+
Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.
79+
80+
</Note>
81+
82+
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
83+
84+
## Apple Installation Methods
85+
86+
### Swift Package Manager (SPM)
87+
88+
Swift Package Manager (SPM) is a powerful tool for managing dependencies in Swift that allows developers to enjoy a more native integration experience with Xcode.
89+
If you already use SPM or prefer it over other package managers on Apple platforms, this guide will show you how to install the Kotlin Multiplatform SDK while using Swift Package Manager.
90+
91+
#### Install
92+
93+
In order to install the Sentry Kotlin Multiplatform SDK, you need to use Cocoapods and Swift Package Manager simultaneously which might seem unconventional at first, especially if you're accustomed to using SPM for all your dependencies. However, you can achieve a smooth integration by using the Kotlin Cocoapods plugin specifically for compiling and building the shared framework. You can then continue to manage all other dependencies with SPM as usual.
94+
95+
Follow the steps for our primary installation method [Cocoapods](/platforms/kotlin-multiplatform/manual-setup/#install) to install the Sentry Kotlin Multiplatform SDK.
96+
97+
After you've consumed the shared framework in your application via Cocoapods, you can continue with SPM for other dependencies without disrupting your existing workflow.

platform-includes/getting-started-install/kotlin-multiplatform.mdx

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,8 @@ To install the Kotlin Multiplatform SDK, you need to add the following to your `
22

33
```kotlin {filename:shared/build.gradle.kts}
44
plugins {
5-
kotlin("multiplatform")
6-
kotlin("native.cocoapods")
7-
// .. your other plugins
8-
}
9-
10-
kotlin {
11-
android()
12-
iosX64()
13-
iosArm64()
14-
iosSimulatorArm64()
15-
16-
sourceSets {
17-
val commonMain by getting {
18-
dependencies {
19-
implementation("io.sentry:sentry-kotlin-multiplatform:{{@inject packages.version('sentry.kotlin.kmp', '0.0.1-alpha.2') }}")
20-
}
21-
}
22-
23-
// Android target
24-
val androidMain by getting {
25-
dependsOn(commonMain)
26-
}
27-
28-
// Apple targets:
29-
val iosMain by getting {
30-
dependsOn(commonMain)
31-
}
32-
}
33-
34-
cocoapods {
35-
summary = "Some description for the Shared Module"
36-
homepage = "Link to the Shared Module homepage"
37-
ios.deploymentTarget = "14.1"
38-
podfile = project.file("../iosApp/Podfile")
39-
// Make sure you use the proper version according to our Cocoa SDK Version Compatibility Table.
40-
pod("Sentry") {
41-
version = "~> 8.25"
42-
linkOnly = true
43-
extraOpts += listOf("-compiler-option", "-fmodules")
44-
}
45-
framework {
46-
baseName = "shared"
47-
}
48-
}
5+
id("io.sentry.kotlin.multiplatform.gradle") version "{{@inject packages.version('sentry.kotlin.kmp.gradle-plugin', '0.9.0') }}"
496
}
507
```
8+
9+
The plugin installs the Sentry KMP dependency and if you are using the Cocoapods plugin it will also install the Sentry Cocoa dependency.

0 commit comments

Comments
 (0)