-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat: override sdk name and version #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2b9c0bd
override sdk versions
buenaflor 8370595
introduce kmm buildconfig
buenaflor 4a1e606
Merge branch 'main' into feat/adoption
buenaflor cff5fd2
add common sdk version class
buenaflor ae3af5c
improve sdkVersion
buenaflor d7238b4
remove options that are default
buenaflor 39793dc
apply formatting
buenaflor 53ddc99
add comments to SdkVersion
buenaflor df6bce7
use buildconfig
buenaflor 15c390e
improve SdkVersion
buenaflor 3a0e362
format code with spotless
buenaflor 3362091
include cinterop PrivateSentrySDKOnly header to set the sdk
buenaflor 0eba0fb
set event sdk on cocoa
buenaflor 5fcca14
make name and version required in SdkVersion
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...rc/commonJvmMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SdkVersionExtensions.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package io.sentry.kotlin.multiplatform.extensions | ||
|
|
||
| import io.sentry.kotlin.multiplatform.protocol.SdkVersion | ||
| import io.sentry.protocol.SdkVersion as JvmSdkVersion | ||
|
|
||
| fun SdkVersion.toJvmSdkVersion(): JvmSdkVersion { | ||
| val sdk = JvmSdkVersion(this.name, this.version) | ||
| packages?.forEach { pkg -> | ||
| sdk.addPackage(pkg.name, pkg.version) | ||
| } | ||
| return sdk | ||
| } |
7 changes: 7 additions & 0 deletions
7
...commonJvmMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/protocol/SdkVersion.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package io.sentry.kotlin.multiplatform.protocol | ||
|
|
||
| /** The SDK Interface describes the Sentry SDK and its configuration used to capture and transmit an event. */ | ||
| data class SdkVersion( | ||
| /** The name of the SDK. */ | ||
| val name: String, | ||
|
|
||
| /** The version of the SDK. */ | ||
| val version: String | ||
| ) { | ||
| /** Packages used by the SDK. */ | ||
| var packages: List<Package>? = mutableListOf() | ||
| private set | ||
|
|
||
| fun addPackage(name: String, version: String) { | ||
| val mutableList = packages?.toMutableList() | ||
| mutableList?.add(Package(name, version)) | ||
| packages = mutableList | ||
| } | ||
| } | ||
|
|
||
| data class Package( | ||
| val name: String, | ||
| val version: String | ||
| ) |
2 changes: 2 additions & 0 deletions
2
sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.PrivateSentrySDKOnly.def
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| language = Objective-C | ||
| headers = PrivateSentrySDKOnly.h |
25 changes: 25 additions & 0 deletions
25
...ultiplatform/src/nativeInterop/cinterop/SentryPrivateSentrySDKOnly/PrivateSentrySDKOnly.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #import <Foundation/Foundation.h> | ||
|
|
||
| @interface PrivateSentrySDKOnly : NSObject | ||
|
|
||
| /** | ||
| * Override SDK information. | ||
| */ | ||
| + (void)setSdkName:(NSString *)sdkName andVersionString:(NSString *)versionString; | ||
|
|
||
| /** | ||
| * Override SDK information. | ||
| */ | ||
| + (void)setSdkName:(NSString *)sdkName; | ||
|
|
||
| /** | ||
| * Retrieves the SDK name | ||
| */ | ||
| + (NSString *)getSdkName; | ||
|
|
||
| /** | ||
| * Retrieves the SDK version string | ||
| */ | ||
| + (NSString *)getSdkVersionString; | ||
|
|
||
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.