From af3112d81af637a735809e42ff97c331c6e29aff Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 14 Mar 2023 17:57:00 +0100 Subject: [PATCH 01/15] update sdk version --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index dbea34fb..efb4f805 100644 --- a/README.md +++ b/README.md @@ -24,28 +24,21 @@ This SDK is a wrapper around different platforms such as JVM, Android, iOS, macO ## Configure Repository -The Kotlin Multiplatform SDK is available only on `mavenLocal`. You can declare this repository in your build script as follows: +The Kotlin Multiplatform SDK is available on `mavenCentral`. You can declare this repository in your build script as follows: ```gradle repositories { - // Currently only supported locally - mavenLocal() + mavenCentral() } ``` -and then run: - -```bash -./gradlew publishToMavenLocal -``` - ## Add dependency For a multiplatform project, you need to add the sentry-kotlin-multiplatform artifact to the `commonMain` source set: ```Kotlin val commonMain by getting { dependencies { - api("io.sentry:sentry-kotlin-multiplatform:0.0.1") + api("io.sentry:sentry-kotlin-multiplatform:0.0.1-alpha.2") } } ``` @@ -66,7 +59,7 @@ cocoapods { baseName = "shared" // Export the SDK in order to be able to access it directly in the iOS project - export("io.sentry:sentry-kotlin-multiplatform:0.0.1") + export("io.sentry:sentry-kotlin-multiplatform:0.0.1-alpha.2") } } ``` From 707c4d67c26a458aaba619799461430ac67f4ff5 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 14 Mar 2023 17:57:43 +0100 Subject: [PATCH 02/15] update cocoa version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efb4f805..e402cf5a 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ val commonMain by getting { ### Cocoa 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. -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` +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 `~> 8.2.0` ```gradle cocoapods { From 5f6ec0104cf24cfc3a5bd400ba5ac7e394218038 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 00:40:52 +0100 Subject: [PATCH 03/15] add updateReadme task --- .github/workflows/format.yml | 3 +++ Makefile | 4 ++++ README.md | 8 ++++++-- build.gradle.kts | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 14c70e51..67747b3a 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -29,6 +29,9 @@ jobs: - name: Make format run: make format + - name: Update README + run: make update-readme + # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. diff --git a/Makefile b/Makefile index 81cf1e51..b31a9e77 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,10 @@ checkFormat: format: ./gradlew spotlessApply +# Update the README.md file +update-readme: + ./gradlew updateReadme + # build and run tests compile: ./gradlew build diff --git a/README.md b/README.md index e402cf5a..78bcfdd5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ This project is an experimental SDK for Kotlin Multiplatform. This SDK is a wrapper around different platforms such as JVM, Android, iOS, macOS, watchOS, tvOS that can be used on Kotlin Multiplatform. +| Packages | Maven Central +|-----------------------------------------| ------- +| sentry-kotlin-multiplatform | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform) + ## Supported Platforms | Target Platform | Target preset | @@ -46,14 +50,14 @@ val commonMain by getting { ### Cocoa 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. -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 `~> 8.2.0` +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 `pod("Sentry", "~> 8.1.0")` ```gradle cocoapods { // ... // Make sure Sentry Cocoa in your project matches this version - pod("Sentry", "~> 8.2.0") + pod("Sentry", "~> 8.1.0") framework { baseName = "shared" diff --git a/build.gradle.kts b/build.gradle.kts index 6a3ccb15..488bb39f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,6 +50,20 @@ subprojects { } } +tasks.register("updateReadme") { + doLast { + val readmeFile = File("README.md") + + // Replace sentry-kotlin-multiplatform version + val regex = Regex("io\\.sentry:sentry-kotlin-multiplatform:[^\"]*") + var newContents = readmeFile.readText().replace(regex, "io.sentry:sentry-kotlin-multiplatform:${project.version}") + + // Replace sentry cocoa version + newContents = newContents.replace(Regex("pod\\(\"Sentry\", \"~>[^\"]*\"\\)"), "pod(\"Sentry\", \"~> ${Config.Libs.sentryCocoaVersion}\")") + readmeFile.writeText(newContents) + } +} + spotless { lineEndings = LineEnding.UNIX From d8df4d6592bc4dbe8894d68d73cfaca5611c7728 Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Tue, 14 Mar 2023 23:43:44 +0000 Subject: [PATCH 04/15] Format code --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78bcfdd5..0359c921 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,14 @@ val commonMain by getting { ### Cocoa 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. -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 `pod("Sentry", "~> 8.1.0")` +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 `pod("Sentry", "~> 8.2.0")` ```gradle cocoapods { // ... // Make sure Sentry Cocoa in your project matches this version - pod("Sentry", "~> 8.1.0") + pod("Sentry", "~> 8.2.0") framework { baseName = "shared" From d4f4fc4598cfd1634c2ac132e246e18ce2939138 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 11:01:03 +0100 Subject: [PATCH 05/15] surround with trycatch when reading the file --- build.gradle.kts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 488bb39f..f9b345d0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,17 +50,24 @@ subprojects { } } + tasks.register("updateReadme") { + val filename = "README.md" + val kmpRegex = Regex("io\\.sentry:sentry-kotlin-multiplatform:[^\"]*") + val cocoaRegex = Regex("pod\\(\"Sentry\", \"~>[^\"]*\"\\)") + doLast { - val readmeFile = File("README.md") + try { + val readmeFile = File(filename) - // Replace sentry-kotlin-multiplatform version - val regex = Regex("io\\.sentry:sentry-kotlin-multiplatform:[^\"]*") - var newContents = readmeFile.readText().replace(regex, "io.sentry:sentry-kotlin-multiplatform:${project.version}") + val newContents = readmeFile.readText() + .replace(kmpRegex, "io.sentry:sentry-kotlin-multiplatform:${project.version}") + .replace(cocoaRegex, "pod(\"Sentry\", \"~> ${Config.Libs.sentryCocoaVersion}\")") - // Replace sentry cocoa version - newContents = newContents.replace(Regex("pod\\(\"Sentry\", \"~>[^\"]*\"\\)"), "pod(\"Sentry\", \"~> ${Config.Libs.sentryCocoaVersion}\")") - readmeFile.writeText(newContents) + readmeFile.writeText(newContents) + } catch (e: Exception) { + throw GradleException("Failed to update README file: ${e.message}") + } } } From 314e2ef579453f3191d33e2bf0a89628101c8e04 Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Wed, 15 Mar 2023 10:08:04 +0000 Subject: [PATCH 06/15] Format code --- build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f9b345d0..34037b43 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,7 +50,6 @@ subprojects { } } - tasks.register("updateReadme") { val filename = "README.md" val kmpRegex = Regex("io\\.sentry:sentry-kotlin-multiplatform:[^\"]*") From b33b69c7e9f50a3c80d6262543a6454c288da2f4 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 11:18:59 +0100 Subject: [PATCH 07/15] update podspec --- sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec index e76009dc..4e588c39 100644 --- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec +++ b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'sentry_kotlin_multiplatform' - spec.version = '0.0.1' + spec.version = '0.0.1-alpha.2' spec.homepage = 'https://github.com/getsentry/sentry-kotlin-multiplatform' spec.source = { :http=> ''} spec.authors = '' From fa601f7106423582ca16edf7b45f4423dcdd1cd6 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 13:03:03 +0100 Subject: [PATCH 08/15] use latest placeholder and track cocoa version manually --- .github/workflows/format.yml | 3 --- Makefile | 4 ---- README.md | 8 ++++---- build.gradle.kts | 20 -------------------- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 67747b3a..f305ab4b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -26,9 +26,6 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Make format - run: make format - - name: Update README run: make update-readme diff --git a/Makefile b/Makefile index b31a9e77..81cf1e51 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,6 @@ checkFormat: format: ./gradlew spotlessApply -# Update the README.md file -update-readme: - ./gradlew updateReadme - # build and run tests compile: ./gradlew build diff --git a/README.md b/README.md index 0359c921..9adcf260 100644 --- a/README.md +++ b/README.md @@ -42,15 +42,15 @@ For a multiplatform project, you need to add the sentry-kotlin-multiplatform art ```Kotlin val commonMain by getting { dependencies { - api("io.sentry:sentry-kotlin-multiplatform:0.0.1-alpha.2") + api("io.sentry:sentry-kotlin-multiplatform:latest") } } ``` ### Cocoa -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. -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 `pod("Sentry", "~> 8.2.0")` +If you are targeting Apple platforms (iOS, macOS, watchOS, tvOS), then you can use CocoaPods to include [Sentry Cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK. +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 version used in the KMP SDK. ```gradle cocoapods { @@ -63,7 +63,7 @@ cocoapods { baseName = "shared" // Export the SDK in order to be able to access it directly in the iOS project - export("io.sentry:sentry-kotlin-multiplatform:0.0.1-alpha.2") + export("io.sentry:sentry-kotlin-multiplatform:latest") } } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 34037b43..6a3ccb15 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,26 +50,6 @@ subprojects { } } -tasks.register("updateReadme") { - val filename = "README.md" - val kmpRegex = Regex("io\\.sentry:sentry-kotlin-multiplatform:[^\"]*") - val cocoaRegex = Regex("pod\\(\"Sentry\", \"~>[^\"]*\"\\)") - - doLast { - try { - val readmeFile = File(filename) - - val newContents = readmeFile.readText() - .replace(kmpRegex, "io.sentry:sentry-kotlin-multiplatform:${project.version}") - .replace(cocoaRegex, "pod(\"Sentry\", \"~> ${Config.Libs.sentryCocoaVersion}\")") - - readmeFile.writeText(newContents) - } catch (e: Exception) { - throw GradleException("Failed to update README file: ${e.message}") - } - } -} - spotless { lineEndings = LineEnding.UNIX From 9083be983f11d8648164e5a70766e54bd76d790a Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 13:04:17 +0100 Subject: [PATCH 09/15] remove updateReadme from format workflow --- .github/workflows/format.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index f305ab4b..21a6deab 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -26,9 +26,6 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Update README - run: make update-readme - # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. From 030de669b9fca8634eff1e5d288398b137d23c29 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 14:04:49 +0100 Subject: [PATCH 10/15] re-add make format --- .github/workflows/format.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 21a6deab..17322c63 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -25,6 +25,9 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- + + - name: Make format + run: make format # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. From 683cad2e96918840a67db4fe05c48ce533818f37 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 15 Mar 2023 15:27:40 +0100 Subject: [PATCH 11/15] replace placeholder --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9adcf260..8d1ae296 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For a multiplatform project, you need to add the sentry-kotlin-multiplatform art ```Kotlin val commonMain by getting { dependencies { - api("io.sentry:sentry-kotlin-multiplatform:latest") + api("io.sentry:sentry-kotlin-multiplatform:[version]") } } ``` @@ -63,7 +63,7 @@ cocoapods { baseName = "shared" // Export the SDK in order to be able to access it directly in the iOS project - export("io.sentry:sentry-kotlin-multiplatform:latest") + export("io.sentry:sentry-kotlin-multiplatform:[version]") } } ``` From ad4abe2973ca9e948b01024054e026c7461f4c80 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 16 Mar 2023 10:46:35 +0100 Subject: [PATCH 12/15] update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8d1ae296..55d122cf 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For a multiplatform project, you need to add the sentry-kotlin-multiplatform art ```Kotlin val commonMain by getting { dependencies { - api("io.sentry:sentry-kotlin-multiplatform:[version]") + api("io.sentry:sentry-kotlin-multiplatform:") } } ``` @@ -63,7 +63,7 @@ cocoapods { baseName = "shared" // Export the SDK in order to be able to access it directly in the iOS project - export("io.sentry:sentry-kotlin-multiplatform:[version]") + export("io.sentry:sentry-kotlin-multiplatform:") } } ``` @@ -76,7 +76,7 @@ There are two main strategies for initializing the SDK: Shared initializer will initialize the SDK in your shared codebase but you will use the same configuration options for all platforms. -Platform specific initializers initialize the SDK directly in the target platform. The benefit is being able to customize the configuration options specific to the platforms. +Platform-specific initializers initialize the SDK directly in the target platform. The benefit is being able to customize the configuration options specific to the platforms. It is also possible to mix those two strategies based on your needs and project setup. @@ -137,7 +137,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { } ``` -## Platform Specific Initializers +## Platform-Specific Initializers ### Android ```Kotlin From f0a7224e87af532e01a57085af549dcf098fa7dd Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 16 Mar 2023 11:21:11 +0100 Subject: [PATCH 13/15] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55d122cf..dfc854f4 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ cocoapods { There are two main strategies for initializing the SDK: - Shared initializer - - Platform specific initializers + - Platform-specific initializers Shared initializer will initialize the SDK in your shared codebase but you will use the same configuration options for all platforms. From 076051771c54e8c86d9542ad2258ed217dd13d7f Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:29:13 +0100 Subject: [PATCH 14/15] Update sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec --- sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec index 4e588c39..e76009dc 100644 --- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec +++ b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'sentry_kotlin_multiplatform' - spec.version = '0.0.1-alpha.2' + spec.version = '0.0.1' spec.homepage = 'https://github.com/getsentry/sentry-kotlin-multiplatform' spec.source = { :http=> ''} spec.authors = '' From a6fe7cdca94f02a4d5c0076f5115bfef07af2593 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:29:21 +0100 Subject: [PATCH 15/15] Update .github/workflows/format.yml --- .github/workflows/format.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 17322c63..da2c3684 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -25,7 +25,6 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Make format run: make format