diff --git a/.run/androidApp-cocoapods.run.xml b/.run/androidApp-cocoapods.run.xml
deleted file mode 100644
index 5ca5075e2..000000000
--- a/.run/androidApp-cocoapods.run.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.run/iosApp-cocoapods.run.xml b/.run/iosApp-cocoapods.run.xml
deleted file mode 100644
index a8eab2077..000000000
--- a/.run/iosApp-cocoapods.run.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 71b5662a7..29efd62fa 100644
--- a/Makefile
+++ b/Makefile
@@ -38,13 +38,9 @@ buildProject:
# Build Apple Samples
buildAppleSamples:
./gradlew build -p sentry-samples
- cd ./sentry-samples/kmp-app-cocoapods/iosApp/iosApp && touch iosApp.xcconfig
- # cd ./sentry-samples/kmp-app-mvvm-di/iosApp && touch iosApp.xcconfig
+ cd ./sentry-samples/kmp-app-spm/iosApp && touch iosApp.xcconfig
sudo xcode-select --switch /Applications/Xcode.app && /usr/bin/xcodebuild -version
- ./gradlew ":sentry-samples:kmp-app-cocoapods:shared:podInstall"
- cd ./sentry-samples/kmp-app-cocoapods/iosApp; pod update;
- xcodebuild -workspace ./sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
- # xcodebuild -project ./sentry-samples/kmp-app-mvvm-di/iosApp.xcodeproj -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
+ xcodebuild -project ./sentry-samples/kmp-app-spm/iosApp.xcodeproj -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
# Build all targets, run tests and checks api
diff --git a/build.gradle.kts b/build.gradle.kts
index 806c63087..7ce024a29 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,7 +10,6 @@ plugins {
id(Config.QualityPlugins.detekt).version(Config.QualityPlugins.detektVersion)
id(Config.dokka).version(Config.dokkaVersion)
kotlin(Config.multiplatform).version(Config.kotlinVersion).apply(false)
- kotlin(Config.cocoapods).version(Config.kotlinVersion).apply(false)
id(Config.spmForKmp).version(Config.spmForKmpVersion).apply(false)
id(Config.jetpackCompose).version(Config.composePluginVersion).apply(false)
id(Config.kotlinCompose).version(Config.kotlinVersion).apply(false)
diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt
index 8abb7f575..048882536 100644
--- a/buildSrc/src/main/java/Config.kt
+++ b/buildSrc/src/main/java/Config.kt
@@ -5,7 +5,6 @@ object Config {
val gradleMavenPublishPluginVersion = "0.30.0"
val multiplatform = "multiplatform"
- val cocoapods = "native.cocoapods"
val spmForKmp = "io.github.frankois944.spmForKmp"
val spmForKmpVersion = "1.9.3"
val jetpackCompose = "org.jetbrains.compose"
diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh
index d7d839707..59e6812f5 100755
--- a/scripts/bump-version.sh
+++ b/scripts/bump-version.sh
@@ -19,19 +19,17 @@ VERSION_NAME_PATTERN="versionName"
perl -pi -e "s/$VERSION_NAME_PATTERN=.*$/$VERSION_NAME_PATTERN=$NEW_VERSION/g" $GRADLE_FILEPATH
perl -pi -e "s/$VERSION_NAME_PATTERN=.*$/$VERSION_NAME_PATTERN=$NEW_VERSION/g" $PLUGIN_GRADLE_FILEPATH
-PODSPEC_FILEPATH='sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
-PODSPEC_CONTENT=$(cat $PODSPEC_FILEPATH)
+CONFIG_FILEPATH='buildSrc/src/main/java/Config.kt'
+CONFIG_CONTENT=$(cat $CONFIG_FILEPATH)
-PODSPEC_REGEX="('Sentry', *)'([0-9\.]+)'"
+COCOA_VERSION_REGEX='sentryCocoaVersion *= *"([0-9\.]+)"'
-if ! [[ $PODSPEC_CONTENT =~ $PODSPEC_REGEX ]]; then
- echo "Failed to find the Cocoa version in $PODSPEC_FILEPATH"
+if ! [[ $CONFIG_CONTENT =~ $COCOA_VERSION_REGEX ]]; then
+ echo "Failed to find the Cocoa version in $CONFIG_FILEPATH"
exit 1
fi
-PODSPEC_WHOLE_MATCH=${BASH_REMATCH[0]}
-PODSPEC_VAR_NAME=${BASH_REMATCH[1]}
-PODSPEC_VERSION=${BASH_REMATCH[2]}
+PODSPEC_VERSION=${BASH_REMATCH[1]}
# create a new table entry in readme with NEW_VERSION and PODSPEC_VERSION in the compatibility table
# Find the line number of the last entry in the compatibility table and insert the new entry after it
diff --git a/scripts/update-cocoa.sh b/scripts/update-cocoa.sh
index da0db50d3..73e330ccc 100755
--- a/scripts/update-cocoa.sh
+++ b/scripts/update-cocoa.sh
@@ -3,19 +3,19 @@
cd $(dirname "$0")/../
config_file='buildSrc/src/main/java/Config.kt'
-podspec_file='sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
plugin_properties_file='sentry-kotlin-multiplatform-gradle-plugin/gradle.properties'
-sample_podspec_file='sentry-samples/kmp-app-cocoapods/shared/shared.podspec'
-sample_ios_app_dir='sentry-samples/kmp-app-cocoapods/iosApp'
+spm_sample_pbxproj_file='sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj'
+spm_sample_project='sentry-samples/kmp-app-spm/iosApp.xcodeproj'
+spm_sample_scheme='iosApp'
config_content=$(cat $config_file)
-podspec_content=$(cat $podspec_file)
plugin_properties_content=$(cat $plugin_properties_file)
-sample_podspec_content=$(cat $sample_podspec_file)
+pbxproj_content=$(cat $spm_sample_pbxproj_file)
config_regex='(sentryCocoaVersion *= *)"([0-9\.]+)"'
-podspec_regex="('Sentry', *)'([0-9\.]+)'"
plugin_properties_regex='(sentryCocoaVersion *= *)([0-9\.]+)'
+# Matches the sentry-cocoa SwiftPM pin in the SPM sample, e.g. `version = 8.58.2;`
+pbxproj_regex='(version = )([0-9\.]+)(;)'
if ! [[ $config_content =~ $config_regex ]]; then
echo "Failed to find the Cocoa version in $config_file"
@@ -26,14 +26,6 @@ config_whole_match=${BASH_REMATCH[0]}
config_var_name=${BASH_REMATCH[1]}
config_version=${BASH_REMATCH[2]}
-if ! [[ $podspec_content =~ $podspec_regex ]]; then
- echo "Failed to find the Cocoa version in $podspec_file"
- exit 1
-fi
-
-podspec_whole_match=${BASH_REMATCH[0]}
-podspec_var_name=${BASH_REMATCH[1]}
-
if ! [[ $plugin_properties_content =~ $plugin_properties_regex ]]; then
echo "Failed to find the Cocoa version in $plugin_properties_file"
exit 1
@@ -42,13 +34,12 @@ fi
plugin_properties_whole_match=${BASH_REMATCH[0]}
plugin_properties_var_name=${BASH_REMATCH[1]}
-if ! [[ $sample_podspec_content =~ $podspec_regex ]]; then
- echo "Failed to find the Cocoa version in $sample_podspec_file"
+if ! [[ $pbxproj_content =~ $pbxproj_regex ]]; then
+ echo "Failed to find the sentry-cocoa SwiftPM version in $spm_sample_pbxproj_file"
exit 1
fi
-sample_podspec_whole_match=${BASH_REMATCH[0]}
-sample_podspec_var_name=${BASH_REMATCH[1]}
+pbxproj_whole_match=${BASH_REMATCH[0]}
case $1 in
get-version)
@@ -63,28 +54,21 @@ set-version)
newValue="${config_var_name}\"$2"\"
echo "${config_content/${config_whole_match}/$newValue}" >$config_file
- # Update the version in the podspec file
- newValue="${podspec_var_name}'$2'"
- echo "${podspec_content/${podspec_whole_match}/$newValue}" >$podspec_file
-
# Update the version in the plugin properties file
newValue="${plugin_properties_var_name}$2"
echo "${plugin_properties_content/${plugin_properties_whole_match}/$newValue}" >$plugin_properties_file
- # Update the version in the sample podspec file
- newValue="${sample_podspec_var_name}'$2'"
- echo "${sample_podspec_content/${sample_podspec_whole_match}/$newValue}" >$sample_podspec_file
-
- # Generate dummy framework first (required for pod update to work)
- echo "Generating dummy framework for shared module..."
- ./gradlew :sentry-samples:kmp-app-cocoapods:shared:generateDummyFramework
+ # Update the sentry-cocoa SwiftPM pin in the SPM sample Xcode project
+ newValue="version = $2;"
+ echo "${pbxproj_content/${pbxproj_whole_match}/$newValue}" >$spm_sample_pbxproj_file
- # Run pod update in the sample iOS app directory to update Podfile.lock
- echo "Running pod update in $sample_ios_app_dir..."
- (cd $sample_ios_app_dir && pod update)
+ # Refresh the SPM sample lockfiles (Package.resolved) so the pinned revision
+ # matches the new version.
+ echo "Resolving SwiftPM dependencies for the SPM sample..."
+ xcodebuild -resolvePackageDependencies -project $spm_sample_project -scheme $spm_sample_scheme
;;
*)
echo "Unknown argument $1"
exit 1
;;
-esac
\ No newline at end of file
+esac
diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec
deleted file mode 100644
index 251872b27..000000000
--- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec
+++ /dev/null
@@ -1,57 +0,0 @@
-Pod::Spec.new do |spec|
- spec.name = 'sentry_kotlin_multiplatform'
- spec.version = '0.0.1'
- spec.homepage = 'https://github.com/getsentry/sentry-kotlin-multiplatform'
- spec.source = { :http=> ''}
- spec.authors = ''
- spec.license = ''
- spec.summary = 'Official Sentry SDK Kotlin Multiplatform'
- spec.vendored_frameworks = 'build/cocoapods/framework/sentry_kotlin_multiplatform.framework'
- spec.libraries = 'c++'
- spec.ios.deployment_target = '11.0'
- spec.osx.deployment_target = '10.13'
- spec.tvos.deployment_target = '11.0'
- spec.watchos.deployment_target = '4.0'
- spec.dependency 'Sentry', '8.58.2'
-
- if !Dir.exist?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework') || Dir.empty?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework')
- raise "
-
- Kotlin framework 'sentry_kotlin_multiplatform' doesn't exist yet, so a proper Xcode project can't be generated.
- 'pod install' should be executed after running ':generateDummyFramework' Gradle task:
-
- ./gradlew :sentry-kotlin-multiplatform:generateDummyFramework
-
- Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
- end
-
- spec.xcconfig = {
- 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
- }
-
- spec.pod_target_xcconfig = {
- 'KOTLIN_PROJECT_PATH' => ':sentry-kotlin-multiplatform',
- 'PRODUCT_MODULE_NAME' => 'sentry_kotlin_multiplatform',
- }
-
- spec.script_phases = [
- {
- :name => 'Build sentry_kotlin_multiplatform',
- :execution_position => :before_compile,
- :shell_path => '/bin/sh',
- :script => <<-SCRIPT
- if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
- echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
- exit 0
- fi
- set -ev
- REPO_ROOT="$PODS_TARGET_SRCROOT"
- "$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
- -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
- -Pkotlin.native.cocoapods.archs="$ARCHS" \
- -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
- SCRIPT
- }
- ]
-
-end
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/build.gradle.kts b/sentry-samples/kmp-app-cocoapods/androidApp/build.gradle.kts
deleted file mode 100644
index 3b28133e5..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/build.gradle.kts
+++ /dev/null
@@ -1,73 +0,0 @@
-import org.jetbrains.kotlin.gradle.dsl.JvmTarget
-
-plugins {
- id("com.android.application")
- kotlin("android")
- id("io.sentry.android.gradle") version "4.0.0"
-}
-
-android {
- namespace = "sample.kmp.app.android"
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- compileSdk = Config.Android.compileSdkVersion
- defaultConfig {
- applicationId = "sample.kmp.app.android"
- minSdk = Config.Android.minSdkVersion
- targetSdk = Config.Android.targetSdkVersion
- versionCode = 1
- versionName = "1.0"
- }
- signingConfigs {
- create("release") {
- storeFile = file("sentry.keystore")
- storePassword = "sentry"
- keyAlias = "Sentry Android Key"
- keyPassword = "sentry"
- }
- }
- buildTypes {
- getByName("release") {
- isDefault = true
- isMinifyEnabled = true
- proguardFiles.add(getDefaultProguardFile("proguard-android-optimize.txt"))
- signingConfig = signingConfigs.getByName("release")
- }
- }
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
-
- toolchain {
- languageVersion.set(JavaLanguageVersion.of(11))
- }
-}
-
-kotlin {
- compilerOptions {
- jvmTarget = JvmTarget.JVM_11
- }
-}
-
-dependencies {
- implementation(rootProject.project(":sentry-samples:kmp-app-cocoapods:shared"))
- implementation("com.google.android.material:material:1.6.1")
- implementation("androidx.appcompat:appcompat:1.4.2")
- implementation("androidx.constraintlayout:constraintlayout:2.1.4")
-}
-
-// Prevent Sentry from being included in the Android app through the AGP.
-configurations {
- compileOnly {
- exclude(group = "io.sentry", module = "sentry")
- exclude(group = "io.sentry", module = "sentry-android")
- }
-}
-
-sentry {
- autoUploadProguardMapping.set(false)
-}
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/sentry.keystore b/sentry-samples/kmp-app-cocoapods/androidApp/sentry.keystore
deleted file mode 100644
index 3d6ddc7c1..000000000
Binary files a/sentry-samples/kmp-app-cocoapods/androidApp/sentry.keystore and /dev/null differ
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/AndroidManifest.xml b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/AndroidManifest.xml
deleted file mode 100644
index 9e4b74b77..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/java/sample/kmp/app/android/MainActivity.kt b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/java/sample/kmp/app/android/MainActivity.kt
deleted file mode 100644
index 388efb17a..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/java/sample/kmp/app/android/MainActivity.kt
+++ /dev/null
@@ -1,76 +0,0 @@
-package sample.kmp.app.android
-
-import android.app.Application
-import android.os.Bundle
-import android.widget.Button
-import androidx.appcompat.app.AppCompatActivity
-import io.sentry.kotlin.multiplatform.Attachment
-import io.sentry.kotlin.multiplatform.Sentry
-import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
-import sample.kmp.app.LoginImpl
-import sample.kmp.app.Platform
-import sample.kmp.app.configureSentryScope
-import sample.kmp.app.initializeSentry
-import java.io.FileOutputStream
-import java.io.IOException
-
-class MainActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
-
- val captureMessageBtn: Button = findViewById(R.id.captureMessageBtn)
- val captureExceptionBtn: Button = findViewById(R.id.captureExceptionBtn)
- val captureHardCrashBtn: Button = findViewById(R.id.captureHardCrash)
-
- captureMessageBtn.setOnClickListener {
- Sentry.captureMessage("From KMP Sample App: " + Platform().platform)
- }
-
- captureExceptionBtn.setOnClickListener {
- LoginImpl.login("MyUsername")
- }
-
- captureHardCrashBtn.setOnClickListener {
- LoginImpl.login()
- }
- }
-}
-
-class SentryApplication : Application() {
- override fun onCreate() {
- super.onCreate()
-
- // Initialize Sentry using shared code
- initializeSentry()
-
- // Shared scope across all platforms
- configureSentryScope()
-
- val imageFile = applicationContext.getFileStreamPath("sentry.png")
- try {
- applicationContext.resources.openRawResource(R.raw.sentry).use { inputStream ->
- FileOutputStream(imageFile).use { outputStream ->
- val bytes = ByteArray(1024)
- while (inputStream.read(bytes) !== -1) {
- // To keep the sample code simple this happens on the main thread. Don't do this in a
- // real app.
- outputStream.write(bytes)
- }
- outputStream.flush()
- }
- }
- } catch (e: IOException) {
- Sentry.captureException(e)
- }
-
- val imageAttachment = Attachment(imageFile.getAbsolutePath(), "sentry.png", "image/png")
-
- // Add platform specific scope in addition to the shared scope
- Sentry.configureScope {
- it.setContext("Android Context", mapOf("context1" to 12, "context2" to false))
- it.addBreadcrumb(Breadcrumb.debug("initialized Sentry on Android"))
- it.addAttachment(imageAttachment)
- }
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/layout/activity_main.xml b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 024e73437..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/raw/sentry.png b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/raw/sentry.png
deleted file mode 100644
index 2225be472..000000000
Binary files a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/raw/sentry.png and /dev/null differ
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/colors.xml b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/colors.xml
deleted file mode 100644
index 4faecfa80..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- #6200EE
- #3700B3
- #03DAC5
-
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/styles.xml b/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/styles.xml
deleted file mode 100644
index 1971a0a03..000000000
--- a/sentry-samples/kmp-app-cocoapods/androidApp/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/desktopApp/build.gradle.kts b/sentry-samples/kmp-app-cocoapods/desktopApp/build.gradle.kts
deleted file mode 100644
index 519005fef..000000000
--- a/sentry-samples/kmp-app-cocoapods/desktopApp/build.gradle.kts
+++ /dev/null
@@ -1,51 +0,0 @@
-import org.jetbrains.compose.desktop.application.dsl.TargetFormat
-import org.jetbrains.kotlin.gradle.dsl.JvmTarget
-
-plugins {
- kotlin("multiplatform")
- id("org.jetbrains.kotlin.plugin.compose")
- id("org.jetbrains.compose")
-}
-
-group = "com.example"
-version = "1.0-SNAPSHOT"
-
-repositories {
- google()
- mavenCentral()
- maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
-}
-
-java {
- toolchain {
- languageVersion.set(JavaLanguageVersion.of(11))
- }
-}
-
-kotlin {
- jvm {
- compilerOptions {
- jvmTarget = JvmTarget.JVM_11
- }
- }
- sourceSets {
- val jvmMain by getting {
- dependencies {
- implementation(rootProject.project(":sentry-samples:kmp-app-cocoapods:shared"))
- implementation(compose.desktop.currentOs)
- }
- }
- val jvmTest by getting
- }
-}
-
-compose.desktop {
- application {
- mainClass = "MainKt"
- nativeDistributions {
- targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
- packageName = "demo"
- packageVersion = "1.0.0"
- }
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/desktopApp/src/jvmMain/kotlin/sample.kmp.app.desktop/Main.kt b/sentry-samples/kmp-app-cocoapods/desktopApp/src/jvmMain/kotlin/sample.kmp.app.desktop/Main.kt
deleted file mode 100644
index 0f82c6675..000000000
--- a/sentry-samples/kmp-app-cocoapods/desktopApp/src/jvmMain/kotlin/sample.kmp.app.desktop/Main.kt
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package sample.kmp.app.desktop
-
-import androidx.compose.desktop.ui.tooling.preview.Preview
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.material.Button
-import androidx.compose.material.ButtonDefaults
-import androidx.compose.material.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.window.Window
-import androidx.compose.ui.window.application
-import io.sentry.kotlin.multiplatform.Sentry
-import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
-import sample.kmp.app.LoginImpl
-import sample.kmp.app.Platform
-import sample.kmp.app.configureSentryScope
-import sample.kmp.app.initializeSentry
-
-@Composable
-@Preview
-fun App() {
- Column(
- modifier = Modifier.fillMaxSize(),
- verticalArrangement = Arrangement.Center,
- horizontalAlignment = Alignment.CenterHorizontally
- ) {
- val btnBackgroundColor = Color(56, 31, 67)
- Button({
- Sentry.captureMessage("From KMP Sample App: " + Platform().platform)
- }, colors = ButtonDefaults.buttonColors(backgroundColor = btnBackgroundColor)) {
- Text("Capture Message", color = Color.White)
- }
- Button({
- LoginImpl.login("MyUsername")
- }, colors = ButtonDefaults.buttonColors(backgroundColor = btnBackgroundColor)) {
- Text("Capture Exception", color = Color.White)
- }
- Button({
- LoginImpl.login()
- }, colors = ButtonDefaults.buttonColors(backgroundColor = btnBackgroundColor)) {
- Text("Crash", color = Color.White)
- }
- }
-}
-
-fun main() = application {
- Window(onCloseRequest = ::exitApplication, title = "Jetpack Compose Desktop App (Cocoapods Sample Version)") {
- // Initialize Sentry using shared code
- initializeSentry()
-
- // Shared scope across all platforms
- configureSentryScope()
-
- // Add platform specific scope in addition to the shared scope
- Sentry.configureScope {
- it.setContext("JVM Desktop Context", mapOf("context1" to 12, "context2" to false))
- it.addBreadcrumb(Breadcrumb.debug("initialized Sentry on JVM Desktop"))
- }
-
- App()
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile b/sentry-samples/kmp-app-cocoapods/iosApp/Podfile
deleted file mode 100644
index aff9c517b..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile
+++ /dev/null
@@ -1,5 +0,0 @@
-target 'iosApp' do
- use_frameworks!
- platform :ios, '14.1'
- pod 'shared', :path => '../shared'
-end
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock b/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock
deleted file mode 100644
index ebcb988f3..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock
+++ /dev/null
@@ -1,25 +0,0 @@
-PODS:
- - Sentry (8.58.2):
- - Sentry/Core (= 8.58.2)
- - Sentry/Core (8.58.2)
- - shared (1.0):
- - Sentry (= 8.58.2)
-
-DEPENDENCIES:
- - shared (from `../shared`)
-
-SPEC REPOS:
- trunk:
- - Sentry
-
-EXTERNAL SOURCES:
- shared:
- :path: "../shared"
-
-SPEC CHECKSUMS:
- Sentry: de29b881e83bd91cf99a927f82f1fd86bfb39db2
- shared: 231af8f1be94bceff674026ca7dcacf0a666be6d
-
-PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756
-
-COCOAPODS: 1.16.2
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcodeproj/project.pbxproj b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcodeproj/project.pbxproj
deleted file mode 100644
index 8c4ca0d03..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,426 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 51;
- objects = {
-
-/* Begin PBXBuildFile section */
- 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
- 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
- 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
- 243652F129F3500B00FD902A /* sentry.png in Resources */ = {isa = PBXBuildFile; fileRef = 243652F029F3500B00FD902A /* sentry.png */; };
- 3D1664DC8EBDF25BA5271797 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EEA8758FDDDA81262859B40 /* Pods_iosApp.framework */; };
- 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
- 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
- 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; };
- 243652F029F3500B00FD902A /* sentry.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sentry.png; sourceTree = ""; };
- 24B0FC5D29F8273700434F1C /* iosApp.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = iosApp.xcconfig; sourceTree = ""; };
- 27764284A12D67D77B0D8962 /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; };
- 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
- 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 9EEA8758FDDDA81262859B40 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- D2E6F99EDC5C3622F933AA2F /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 15ED548C5D994C7F345A5039 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3D1664DC8EBDF25BA5271797 /* Pods_iosApp.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 058557D7273AAEEB004C7B11 /* Preview Content */ = {
- isa = PBXGroup;
- children = (
- 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */,
- );
- path = "Preview Content";
- sourceTree = "";
- };
- 1E09B7524956916C5D9D7D40 /* Pods */ = {
- isa = PBXGroup;
- children = (
- D2E6F99EDC5C3622F933AA2F /* Pods-iosApp.debug.xcconfig */,
- 27764284A12D67D77B0D8962 /* Pods-iosApp.release.xcconfig */,
- );
- path = Pods;
- sourceTree = "";
- };
- 7555FF72242A565900829871 = {
- isa = PBXGroup;
- children = (
- 7555FF7D242A565900829871 /* iosApp */,
- 7555FF7C242A565900829871 /* Products */,
- 1E09B7524956916C5D9D7D40 /* Pods */,
- C3B0B54580AA0124B27DF2B7 /* Frameworks */,
- );
- sourceTree = "";
- };
- 7555FF7C242A565900829871 /* Products */ = {
- isa = PBXGroup;
- children = (
- 7555FF7B242A565900829871 /* iosApp.app */,
- );
- name = Products;
- sourceTree = "";
- };
- 7555FF7D242A565900829871 /* iosApp */ = {
- isa = PBXGroup;
- children = (
- 243652F029F3500B00FD902A /* sentry.png */,
- 058557BA273AAA24004C7B11 /* Assets.xcassets */,
- 7555FF82242A565900829871 /* ContentView.swift */,
- 7555FF8C242A565B00829871 /* Info.plist */,
- 2152FB032600AC8F00CF470E /* iOSApp.swift */,
- 058557D7273AAEEB004C7B11 /* Preview Content */,
- 24B0FC5D29F8273700434F1C /* iosApp.xcconfig */,
- );
- path = iosApp;
- sourceTree = "";
- };
- C3B0B54580AA0124B27DF2B7 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 9EEA8758FDDDA81262859B40 /* Pods_iosApp.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 7555FF7A242A565900829871 /* iosApp */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
- buildPhases = (
- 0BFD73D9FC258ED49378CBD3 /* [CP] Check Pods Manifest.lock */,
- 7555FF77242A565900829871 /* Sources */,
- 7555FF79242A565900829871 /* Resources */,
- 15ED548C5D994C7F345A5039 /* Frameworks */,
- B9409BDB3577907681ECC50B /* [CP] Embed Pods Frameworks */,
- 24B0FC5C29F8270F00434F1C /* Upload Debug Symbols to Sentry */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = iosApp;
- productName = iosApp;
- productReference = 7555FF7B242A565900829871 /* iosApp.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 7555FF73242A565900829871 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastSwiftUpdateCheck = 1130;
- LastUpgradeCheck = 1130;
- ORGANIZATIONNAME = orgName;
- TargetAttributes = {
- 7555FF7A242A565900829871 = {
- CreatedOnToolsVersion = 11.3.1;
- };
- };
- };
- buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
- compatibilityVersion = "Xcode 9.3";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 7555FF72242A565900829871;
- productRefGroup = 7555FF7C242A565900829871 /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 7555FF7A242A565900829871 /* iosApp */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 7555FF79242A565900829871 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,
- 243652F129F3500B00FD902A /* sentry.png in Resources */,
- 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 0BFD73D9FC258ED49378CBD3 /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
- 24B0FC5C29F8270F00434F1C /* Upload Debug Symbols to Sentry */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",
- );
- name = "Upload Debug Symbols to Sentry";
- outputFileListPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "if which sentry-cli >/dev/null; then\nERROR=$(sentry-cli upload-dif \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n";
- };
- B9409BDB3577907681ECC50B /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 7555FF77242A565900829871 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
- 7555FF83242A565900829871 /* ContentView.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 7555FFA3242A565B00829871 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 24B0FC5D29F8273700434F1C /* iosApp.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 14.1;
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
- MTL_FAST_MATH = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- };
- name = Debug;
- };
- 7555FFA4242A565B00829871 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 24B0FC5D29F8273700434F1C /* iosApp.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 14.1;
- MTL_ENABLE_DEBUG_INFO = NO;
- MTL_FAST_MATH = YES;
- SDKROOT = iphoneos;
- SWIFT_COMPILATION_MODE = wholemodule;
- SWIFT_OPTIMIZATION_LEVEL = "-O";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 7555FFA6242A565B00829871 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = D2E6F99EDC5C3622F933AA2F /* Pods-iosApp.debug.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CODE_SIGN_STYLE = Automatic;
- DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
- ENABLE_PREVIEWS = YES;
- INFOPLIST_FILE = iosApp/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosApp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Debug;
- };
- 7555FFA7242A565B00829871 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 27764284A12D67D77B0D8962 /* Pods-iosApp.release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CODE_SIGN_STYLE = Automatic;
- DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
- ENABLE_PREVIEWS = YES;
- INFOPLIST_FILE = iosApp/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosApp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7555FFA3242A565B00829871 /* Debug */,
- 7555FFA4242A565B00829871 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7555FFA6242A565B00829871 /* Debug */,
- 7555FFA7242A565B00829871 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 7555FF73242A565900829871 /* Project object */;
-}
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/contents.xcworkspacedata b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index c009e7d7c..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
deleted file mode 100644
index ee7e3ca03..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "colors" : [
- {
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index fb88a396b..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "20x20"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "20x20"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "40x40"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "40x40"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "60x60"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "60x60"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "20x20"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "20x20"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "29x29"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "29x29"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "40x40"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "40x40"
- },
- {
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "76x76"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "76x76"
- },
- {
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "83.5x83.5"
- },
- {
- "idiom" : "ios-marketing",
- "scale" : "1x",
- "size" : "1024x1024"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/Contents.json b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/Contents.json
deleted file mode 100644
index 4aa7c5350..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Assets.xcassets/Contents.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/ContentView.swift b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/ContentView.swift
deleted file mode 100644
index 7e383a7aa..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/ContentView.swift
+++ /dev/null
@@ -1,28 +0,0 @@
-import SwiftUI
-import shared
-
-struct ContentView: View {
- var body: some View {
- Text("KMP Sample App " + Platform().platform)
- VStack() {
- Button("Capture Message") {
- Sentry.shared.captureMessage(message: "From KMP Sample App " + Platform().platform)
- }
- Button("Capture Exception") {
- LoginImpl().login(username: "MyUsername")
- }
- Button("Capture Http Client Error") {
- HttpClientKt.captureHttpClientError()
- }
- Button("Hard Crash") {
- LoginImpl().login(username: nil)
- }
- }
- }
-}
-
-struct ContentView_Previews: PreviewProvider {
- static var previews: some View {
- ContentView()
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Info.plist b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Info.plist
deleted file mode 100644
index 8044709cf..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Info.plist
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- $(PRODUCT_BUNDLE_PACKAGE_TYPE)
- CFBundleShortVersionString
- 1.0
- CFBundleVersion
- 1
- LSRequiresIPhoneOS
-
- UIApplicationSceneManifest
-
- UIApplicationSupportsMultipleScenes
-
-
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UILaunchScreen
-
-
-
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
deleted file mode 100644
index 4aa7c5350..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/iOSApp.swift b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/iOSApp.swift
deleted file mode 100644
index 5fc135d80..000000000
--- a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/iOSApp.swift
+++ /dev/null
@@ -1,35 +0,0 @@
-import SwiftUI
-import shared
-
-@main
-struct iOSApp: App {
- let sentry = Sentry.shared
-
- init() {
- // Initialize Sentry using shared code
- SentrySetupKt.initializeSentry(useNativeOptions: false)
-
- // Shared scope across all platforms
- SentrySetupKt.configureSentryScope()
-
- // Add platform specific scope in addition to the shared scope
- sentry.configureScope { scope in
- scope.setContext(key: "iOS Context", value: [
- "context1": 20,
- "context2": true
- ])
- let breadcrumb = Breadcrumb.companion.debug(message: "initialized Sentry on iOS")
- scope.addBreadcrumb(breadcrumb: breadcrumb)
- if let path = Bundle.main.path(forResource: "sentry", ofType: "png") {
- let imageAttachment = Attachment(pathname: path, filename: "sentry.png")
- scope.addAttachment(attachment: imageAttachment)
- }
- }
- }
-
- var body: some Scene {
- WindowGroup {
- ContentView()
- }
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/sentry.png b/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/sentry.png
deleted file mode 100644
index 8595392be..000000000
Binary files a/sentry-samples/kmp-app-cocoapods/iosApp/iosApp/sentry.png and /dev/null differ
diff --git a/sentry-samples/kmp-app-cocoapods/shared/build.gradle.kts b/sentry-samples/kmp-app-cocoapods/shared/build.gradle.kts
deleted file mode 100644
index ca5369fd3..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/build.gradle.kts
+++ /dev/null
@@ -1,79 +0,0 @@
-import org.jetbrains.kotlin.gradle.dsl.JvmTarget
-
-plugins {
- kotlin("multiplatform")
- kotlin("native.cocoapods")
- id("com.android.library")
- id("io.sentry.kotlin.multiplatform.gradle")
-}
-
-java {
- toolchain {
- languageVersion.set(JavaLanguageVersion.of(11))
- }
-}
-
-kotlin {
- applyDefaultHierarchyTemplate()
-
- androidTarget()
- jvm {
- compilerOptions {
- jvmTarget = JvmTarget.JVM_11
- }
- }
- iosX64()
- iosArm64()
- iosSimulatorArm64()
-
- cocoapods {
- summary = "Some description for the Shared Module"
- homepage = "Link to the Shared Module homepage"
- version = "1.0"
- ios.deploymentTarget = "14.1"
- podfile = project.file("../iosApp/Podfile")
-
- pod("Sentry") {
- version = Config.Libs.sentryCocoaVersion
- extraOpts += listOf("-compiler-option", "-fmodules")
- }
-
- framework {
- baseName = "shared"
- export(project(":sentry-kotlin-multiplatform"))
- }
- }
-
- sourceSets {
- all {
- languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
- }
-
- commonMain.dependencies {
- api(project(":sentry-kotlin-multiplatform"))
- }
-
- commonTest.dependencies {
- implementation(kotlin("test"))
- }
- }
-}
-
-android {
- namespace = "sample.kmp.app"
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- compileSdk = Config.Android.compileSdkVersion
- sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
- defaultConfig {
- minSdk = Config.Android.minSdkVersion
- }
-}
-
-// disabling autoInstall because we are using project(":sentry-kotlin-multiplatform") directly
-// for our sample apps
-sentryKmp {
- autoInstall.commonMain.enabled = false
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/shared.podspec b/sentry-samples/kmp-app-cocoapods/shared/shared.podspec
deleted file mode 100644
index d7c8354a3..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/shared.podspec
+++ /dev/null
@@ -1,54 +0,0 @@
-Pod::Spec.new do |spec|
- spec.name = 'shared'
- spec.version = '1.0'
- spec.homepage = 'Link to the Shared Module homepage'
- spec.source = { :http=> ''}
- spec.authors = ''
- spec.license = ''
- spec.summary = 'Some description for the Shared Module'
- spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
- spec.libraries = 'c++'
- spec.ios.deployment_target = '14.1'
- spec.dependency 'Sentry', '8.58.2'
-
- if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
- raise "
-
- Kotlin framework 'shared' doesn't exist yet, so a proper Xcode project can't be generated.
- 'pod install' should be executed after running ':generateDummyFramework' Gradle task:
-
- ./gradlew :sentry-samples:kmp-app-cocoapods:shared:generateDummyFramework
-
- Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
- end
-
- spec.xcconfig = {
- 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
- }
-
- spec.pod_target_xcconfig = {
- 'KOTLIN_PROJECT_PATH' => ':sentry-samples:kmp-app-cocoapods:shared',
- 'PRODUCT_MODULE_NAME' => 'shared',
- }
-
- spec.script_phases = [
- {
- :name => 'Build shared',
- :execution_position => :before_compile,
- :shell_path => '/bin/sh',
- :script => <<-SCRIPT
- if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
- echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
- exit 0
- fi
- set -ev
- REPO_ROOT="$PODS_TARGET_SRCROOT"
- "$REPO_ROOT/../../../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
- -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
- -Pkotlin.native.cocoapods.archs="$ARCHS" \
- -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
- SCRIPT
- }
- ]
-
-end
\ No newline at end of file
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/AndroidManifest.xml b/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/AndroidManifest.xml
deleted file mode 100644
index 8072ee00d..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/Platform.kt b/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/Platform.kt
deleted file mode 100644
index c371e4ef9..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/Platform.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package sample.kmp.app
-
-actual class Platform actual constructor() {
- actual val platform: String = "Android ${android.os.Build.VERSION.SDK_INT}"
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/SentrySetup.android.kt b/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/SentrySetup.android.kt
deleted file mode 100644
index 11c6831d7..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/androidMain/kotlin/sample/kmp/app/SentrySetup.android.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package sample.kmp.app
-
-import io.sentry.kotlin.multiplatform.PlatformOptionsConfiguration
-
-actual fun createPlatformOptionsConfiguration(): PlatformOptionsConfiguration = {
- it.dsn = "https://83f281ded2844eda83a8a413b080dbb9@o447951.ingest.sentry.io/5903800"
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/LoginImpl.kt b/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/LoginImpl.kt
deleted file mode 100644
index 21fc2cd00..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/LoginImpl.kt
+++ /dev/null
@@ -1,106 +0,0 @@
-package sample.kmp.app
-
-import io.sentry.kotlin.multiplatform.Sentry
-import io.sentry.kotlin.multiplatform.SentryAttributes
-import io.sentry.kotlin.multiplatform.SentryLevel
-import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
-import io.sentry.kotlin.multiplatform.protocol.User
-import io.sentry.kotlin.multiplatform.protocol.UserFeedback
-import kotlin.uuid.ExperimentalUuidApi
-import kotlin.uuid.Uuid
-
-class InvalidUsernameException(message: String) : Exception(message)
-
-object LoginImpl {
- /**
- * login() throws either a checked InvalidUsernameException
- * or an IllegalArgumentException that crashes the app.
- */
- @OptIn(ExperimentalUuidApi::class)
- fun login(username: String? = null) {
- // Simple message with varargs
- Sentry.logger.info("Login request received for user: %s (session %s)", username, Uuid.random().toString())
-
- // Message with inline attributes lambda
- Sentry.logger.info("Looking up credentials for user") {
- this["username"] = username ?: "null"
- this["login-id"] = Uuid.random().toString()
- this["attempt-count"] = 1
- this["is-retry"] = false
- this["latency-ms"] = 23.5
- }
-
- // Message with varargs AND inline attributes lambda
- Sentry.logger.info("User %s login attempt from %s", username, "mobile-app") {
- this["attempt-count"] = 1
- this["is-retry"] = false
- }
-
- // Full DSL builder with message() and attributes()
- Sentry.logger.info {
- message("Authenticating user: %s against identity provider %s", username, "sentry-auth")
- attributes {
- this["auth-method"] = "password"
- }
- }
-
- // DSL builder with plain message (no template)
- Sentry.logger.warn {
- message("Password policy check: account may be rate-limited soon")
- }
-
- // DSL builder with prebuilt SentryAttributes
- val prebuiltAttrs = SentryAttributes.of(
- "source" to "login-form",
- "version" to 2
- )
- Sentry.logger.debug {
- message("Session token generated for user: %s", username)
- attributes(prebuiltAttrs)
- }
-
- // DSL builder with multiple attributes blocks (they merge)
- Sentry.logger.trace {
- message("Writing login audit trail entry")
- attributes {
- this["step"] = "pre-validation"
- }
- attributes {
- this["component"] = "auth"
- }
- }
-
- try {
- validateUsername(username)
- } catch (exception: InvalidUsernameException) {
- val sentryId = Sentry.captureException(exception) {
- val breadcrumb = Breadcrumb.debug("this is a test breadcrumb")
- breadcrumb.setData("touch event", "on login")
- it.addBreadcrumb(breadcrumb)
- it.setContext("Login", "Failed with Invalid Username")
- it.setTag("login", "failed auth")
- it.level = SentryLevel.WARNING
- val user = User().apply {
- this.username = "John Doe"
- this.email = "john@doe.com"
- }
- it.user = user
- }
- val userFeedback = UserFeedback(sentryId).apply {
- name = "John Doe"
- email = "john@doe.com"
- comments = "I had an error during login on ${Platform().platform}"
- }
- Sentry.captureUserFeedback(userFeedback)
- } catch (exception: IllegalArgumentException) {
- throw exception
- }
- }
-
- private fun validateUsername(username: String?) {
- if (username == null) {
- throw IllegalArgumentException("Username cannot be null")
- }
- throw InvalidUsernameException("Username does not exist")
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/Platform.kt b/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/Platform.kt
deleted file mode 100644
index 9f081fcec..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/Platform.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package sample.kmp.app
-
-expect class Platform() {
- val platform: String
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/SentrySetup.kt b/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/SentrySetup.kt
deleted file mode 100644
index 8ed65c638..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/commonMain/kotlin/sample.kmp.app/SentrySetup.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-package sample.kmp.app
-
-import io.sentry.kotlin.multiplatform.Attachment
-import io.sentry.kotlin.multiplatform.HttpStatusCodeRange
-import io.sentry.kotlin.multiplatform.OptionsConfiguration
-import io.sentry.kotlin.multiplatform.PlatformOptionsConfiguration
-import io.sentry.kotlin.multiplatform.Sentry
-
-/** Configure scope applicable to all platforms */
-fun configureSentryScope() {
- Sentry.configureScope {
- it.setContext("Custom Context", "Shared Context")
- it.setTag("custom-tag", "from shared code")
- it.addAttachment(
- Attachment(
- "This is a shared text attachment".encodeToByteArray(),
- "shared.log"
- )
- )
- }
-}
-
-/**
- * Initializes Sentry with given options.
- * Make sure to hook this into your native platforms as early as possible
- */
-fun initializeSentry(useNativeOptions: Boolean = false) {
- if (useNativeOptions) {
- Sentry.initWithPlatformOptions(createPlatformOptionsConfiguration())
- } else {
- Sentry.init(optionsConfiguration())
- }
-}
-
-expect fun createPlatformOptionsConfiguration(): PlatformOptionsConfiguration
-
-/** Returns a shared options configuration */
-private fun optionsConfiguration(): OptionsConfiguration {
- return {
- it.dsn = "https://83f281ded2844eda83a8a413b080dbb9@o447951.ingest.sentry.io/5903800"
- it.attachStackTrace = true
- it.attachThreads = true
- it.attachScreenshot = true
- it.attachViewHierarchy = true
- it.release = "kmp-release@0.0.1"
- it.debug = true
- it.failedRequestStatusCodes = listOf(HttpStatusCodeRange(400, 599))
- it.failedRequestTargets = listOf("httpbin.org")
- it.sessionReplay.onErrorSampleRate = 1.0
- it.sessionReplay.sessionSampleRate = 1.0
- it.logs.enabled = true
- it.logs.beforeSend = { log ->
- if (log.attributes["dont send log"]?.value == true) {
- null
- } else {
- log
- }
- }
- it.beforeBreadcrumb = { breadcrumb ->
- breadcrumb.message = "Add message before every breadcrumb"
- breadcrumb
- }
- it.beforeSend = { event ->
- if (event.environment == "test") {
- null
- } else {
- event
- }
- }
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/commonTest/kotlin/CompilationTest.kt b/sentry-samples/kmp-app-cocoapods/shared/src/commonTest/kotlin/CompilationTest.kt
deleted file mode 100644
index 6b9d1f345..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/commonTest/kotlin/CompilationTest.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-import kotlin.test.Test
-
-// Simple compilation check that is run during CI
-class CompilationTest {
- @Test
- fun test() {
- print("see if this runs")
- }
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/HttpClient.kt b/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/HttpClient.kt
deleted file mode 100644
index b63d03af6..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/HttpClient.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-package sample.kmp.app
-
-import platform.Foundation.NSURL
-import platform.Foundation.NSURLRequest
-import platform.Foundation.NSURLSession
-import platform.Foundation.dataTaskWithRequest
-
-@Suppress("Unused") // Called from Swift
-fun captureHttpClientError() {
- val url = NSURL(string = "https://httpbin.org/status/404")
- val request = NSURLRequest(uRL = url)
- NSURLSession.sharedSession.dataTaskWithRequest(request) { data, response, error ->
- if (error != null) {
- // handle error
- println("error: $error")
- } else {
- // handle successful response
- println("response: $response")
- }
- }.resume()
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/Platform.kt b/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/Platform.kt
deleted file mode 100644
index d9b1e6c25..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/Platform.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package sample.kmp.app
-
-import platform.UIKit.UIDevice
-
-actual class Platform actual constructor() {
- actual val platform: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/SentrySetup.ios.kt b/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/SentrySetup.ios.kt
deleted file mode 100644
index 11c6831d7..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/iosMain/kotlin/sample.kmp.app/SentrySetup.ios.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package sample.kmp.app
-
-import io.sentry.kotlin.multiplatform.PlatformOptionsConfiguration
-
-actual fun createPlatformOptionsConfiguration(): PlatformOptionsConfiguration = {
- it.dsn = "https://83f281ded2844eda83a8a413b080dbb9@o447951.ingest.sentry.io/5903800"
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/Platform.kt b/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/Platform.kt
deleted file mode 100644
index a755bffa2..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/Platform.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package sample.kmp.app
-
-actual class Platform actual constructor() {
- actual val platform: String = "JVM Desktop"
-}
diff --git a/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/SentrySetup.jvm.kt b/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/SentrySetup.jvm.kt
deleted file mode 100644
index 11c6831d7..000000000
--- a/sentry-samples/kmp-app-cocoapods/shared/src/jvmMain/kotlin/sample/kmp/app/SentrySetup.jvm.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package sample.kmp.app
-
-import io.sentry.kotlin.multiplatform.PlatformOptionsConfiguration
-
-actual fun createPlatformOptionsConfiguration(): PlatformOptionsConfiguration = {
- it.dsn = "https://83f281ded2844eda83a8a413b080dbb9@o447951.ingest.sentry.io/5903800"
-}
diff --git a/sentry-samples/kmp-app-spm/desktopApp/build.gradle.kts b/sentry-samples/kmp-app-spm/desktopApp/build.gradle.kts
index 519005fef..430ab9814 100644
--- a/sentry-samples/kmp-app-spm/desktopApp/build.gradle.kts
+++ b/sentry-samples/kmp-app-spm/desktopApp/build.gradle.kts
@@ -31,7 +31,7 @@ kotlin {
sourceSets {
val jvmMain by getting {
dependencies {
- implementation(rootProject.project(":sentry-samples:kmp-app-cocoapods:shared"))
+ implementation(rootProject.project(":sentry-samples:kmp-app-spm:shared"))
implementation(compose.desktop.currentOs)
}
}
diff --git a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme
index cfbcecaef..1ac636203 100644
--- a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme
+++ b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme
@@ -50,6 +50,10 @@
ReferencedContainer = "container:iosApp.xcodeproj">
+
+