Skip to content

Commit 67fd7be

Browse files
authored
update: readme and contributing (#36)
* Update shared initializer in README * Add supported platforms to README * Update Sentry Cocoa version reminder * Update contributing * Try out dynamic github pic change based on theme * Update sentry logo based on theme color * Add width to sentry logo
1 parent f21f102 commit 67fd7be

File tree

2 files changed

+61
-40
lines changed

2 files changed

+61
-40
lines changed

CONTRIBUTING.md

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
# Contributing
22

3-
This SDK still needs a lot of love.
3+
This is still an experimental SDK so we're more than happy to discuss feedback and receive pull requests!
44

5-
## Cocoa
5+
# Code style
6+
The project uses `ktlint` and `spotless` to make sure the code is formatted properly.
7+
We recommend that you setup a `pre-commit` hook that runs a spotless check when you try to commit.
68

7-
[sentry-cocoa](https://github.com/getsentry/sentry-cocoa) is included via the [CocoaPods plugin of Gradle](https://kotlinlang.org/docs/reference/native/cocoapods.html).
8-
Libraries integrated with CocoaPods in an Kotlin Multiplatform module can only be built with Xcode, because the infrastracture of Kotlin [can't resolve CocoaPods](https://kotlinlang.org/docs/reference/native/cocoapods.html#current-limitations).
9-
This means that we have to use an Xcode project like [ios-cocoa](./Samples/ios-cocoa) to be able to test this library on Cocoa.
10-
Building for iOS or MacOS with Gradle results in the following error:
9+
# Git commit hook
1110

12-
```
13-
Undefined symbols for architecture x86_64:
14-
"_OBJC_CLASS_$_SentrySDK", referenced from:
15-
objc-class-ref in result.o
16-
"_OBJC_CLASS_$_SentryOptions", referenced from:
17-
objc-class-ref in result.o
18-
ld: symbol(s) not found for architecture x86_64
11+
Navigate to the root folder and install the hook:
12+
13+
```shell
14+
git config core.hooksPath .hooks/
1915
```
2016

21-
Publishing to Maven works tough.
17+
To run the build and tests:
18+
19+
```shell
20+
make compile
21+
```
2222

23-
**Help appreciated**: There exists the possibilty to include Objective-C frameworks with using [`cinterop`](https://kotlinlang.org/docs/reference/native/gradle_plugin.html#using-cinterop).
24-
The advantage with this would be that sentry-cocoa is directly integrated in
25-
the Kotlin Multiplatform library. It could happen that the CocoaPods plugin is extended to not depend on Xcode so using `cinterop` could become obsolete.
23+
# CI
2624

27-
## JVM
25+
Build and tests are automatically run against branches and pull requests
26+
via GH Actions.

README.md

+44-22
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
<p align="center">
2-
<a href="https://sentry.io" target="_blank" align="center">
3-
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4-
</a>
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-white.png">
4+
<source media="(prefers-color-scheme: light)" srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png">
5+
<img alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png" width="280">
6+
</picture>
57
<br/>
68
<h1>Experimental Sentry SDK for Kotlin Multiplatform</h1>
79
</p>
810

911
This project is an experimental SDK for Kotlin Multiplatform.
10-
This SDK is a wrapper around different platforms such as JVM, Android, Cocoa that can be used on Kotlin Multiplatform.
12+
This SDK is a wrapper around different platforms such as JVM, Android, iOS, macOS, watchOS, tvOS that can be used on Kotlin Multiplatform.
1113

12-
## Installation
14+
## Supported Platforms
1315

14-
Clone or fork this repo. This SDK is under construction and therefore we only currently publish it to maven local:
16+
| Target Platform | Target preset |
17+
|:-------------:|-------------|
18+
| Android | <ul><li>`android`</li></ul> |
19+
| Kotlin/JVM | <ul><li>`jvm`</li></ul>
20+
| iOS | <ul><li>`iosArm64`</li><li>`iosX64`</li><li>`iosSimulatorArm64`</li></ul>|
21+
| macOS | <ul><li>`macosArm64`</li><li>`macosX64`</ul>|
22+
| watchOS | <ul><li>`watchosArm32`</li><li>`watchosArm64`</li><li>`watchosX64`</li><li>`watchosSimulatorArm64`</li></ul>|
23+
| tvOS | <ul><li>`tvosArm64`</li><li>`tvosX64`</li><li>`tvosSimulatorArm64`</li></ul>|
1524

16-
```sh
17-
./gradlew publishToMavenLocal
18-
```
25+
## Configure Repository
1926

20-
### Shared Module
21-
In your `build.gradle` of your shared module
27+
The Kotlin Multiplatform SDK is available in the Maven central repository. You can declare this repository in your build script as follows:
2228

2329
```gradle
2430
repositories {
25-
// Because we only publish to maven local
26-
mavenLocal()
31+
mavenCentral()
2732
}
2833
```
2934

30-
Add this to your `commonMain` sourceSet.
35+
## Add dependency
36+
For a multiplatform project, you need to add the sentry-kotlin-multiplatform artifact to the `commonMain` source set:
3137

32-
```gradle
33-
// Add this dependency to your commonMain sourceSet
34-
dependencies {
35-
api("io.sentry:sentry-kotlin-multiplatform:0.0.1")
38+
```Kotlin
39+
val commonMain by getting {
40+
dependencies {
41+
api("io.sentry:sentry-kotlin-multiplatform:0.0.1")
42+
}
3643
}
37-
3844
```
3945

4046
### Cocoa
4147

42-
For iOS, iPadOS, MacOS, tvOS or watchOS we use CocoaPods to include [sentry-cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK.
43-
One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension.
48+
If you are targeting Apple platforms (iOS, macOS, watchOS, tvOS), then you need to use CocoaPods to include [Sentry Cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK.
49+
One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension. Be aware that your Sentry Cocoa version has to match the SDK's version. Currently the supported version is `~> 7.21.0`
4450

4551
```gradle
4652
cocoapods {
4753
// ...
4854
49-
// Make sure this is the same version as the one used in the SDK
55+
// Make sure Sentry Cocoa in your project matches this version
5056
pod("Sentry", "~> 7.21.0")
5157
5258
framework {
@@ -150,3 +156,19 @@ class AppDelegate: NSObject, UIApplicationDelegate {
150156
}
151157
}
152158
```
159+
160+
## Debug Symbols for Apple targets
161+
162+
A dSYM upload is required for Sentry to symbolicate your crash logs for viewing. The symbolication process unscrambles Apple’s crash logs to reveal the function, variables, file names, and line numbers of the crash. The dSYM file can be uploaded through the sentry-cli tool or through a Fastlane action. Please visit our [sentry.io guide](https://docs.sentry.io/clients/cocoa/dsym/) to get started on uploading debug symbols.
163+
164+
## Troubleshooting
165+
166+
`WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
167+
Consider adding the following to ~/.profile:
168+
export LANG=en_US.UTF-8`
169+
170+
This is a known problem and can easily be fixed as described in this [Stack Overflow post](https://stackoverflow.com/a/69395720)
171+
172+
## Contribution
173+
174+
Please see the [contribution guide](https://github.com/getsentry/sentry-kotlin-multiplatform/blob/main/CONTRIBUTING.md) before contributing

0 commit comments

Comments
 (0)