From ba3382a3e39980d0d37be87c0b5307faa55c9686 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 16 Jul 2025 16:09:01 +0200 Subject: [PATCH 1/5] Update --- .../kotlin/multiplatform/gradle/SentryPlugin.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/SentryPlugin.kt b/sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/SentryPlugin.kt index 25283376..6635bf29 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/SentryPlugin.kt +++ b/sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/SentryPlugin.kt @@ -99,9 +99,9 @@ private fun maybeLinkCocoaFramework( project.gradle.taskGraph.whenReady { graph -> // Check which of the Kotlin/Native targets are actually in the graph - val activeTarget = getActiveTarget(project, appleTargets, graph) + val activeTargets = getActiveTargets(project, appleTargets, graph) - if (activeTarget == null) { + if (activeTargets.isEmpty()) { project.logger.lifecycle( "No Apple compile task scheduled for this build " + "- skipping Sentry Cocoa framework linking" @@ -109,22 +109,22 @@ private fun maybeLinkCocoaFramework( return@whenReady } - project.logger.lifecycle("Set up Sentry Cocoa linking for target: ${activeTarget.name}") + project.logger.lifecycle("Set up Sentry Cocoa linking for targets: ${activeTargets.map { it.name }}") CocoaFrameworkLinker( logger = project.logger, pathResolver = FrameworkPathResolver(project), binaryLinker = FrameworkLinker(project.logger) - ).configure(appleTargets = listOf(activeTarget)) + ).configure(appleTargets = activeTargets) } } } -private fun getActiveTarget( +private fun getActiveTargets( project: Project, appleTargets: List, graph: TaskExecutionGraph -): KotlinNativeTarget? = appleTargets.firstOrNull { target -> +): List = appleTargets.filter { target -> val targetName = target.name.replaceFirstChar { it.uppercase() } From 4f73d5271559145df50fe49c03e7e910fc4826aa Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 16 Jul 2025 16:10:31 +0200 Subject: [PATCH 2/5] Update --- .github/workflows/kotlin-multiplatform.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/kotlin-multiplatform.yml b/.github/workflows/kotlin-multiplatform.yml index 01c97893..9a1f53a9 100644 --- a/.github/workflows/kotlin-multiplatform.yml +++ b/.github/workflows/kotlin-multiplatform.yml @@ -5,12 +5,6 @@ on: - main - release/** pull_request: - paths: - - '.github/workflows/kotlin-multiplatform.yml' - - 'kotlin-multiplatform/**' - - 'sentry-samples/**' - - 'buildSrc/src/' - - '!**/*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 9f7f1c995f7a01413b191ade09679a1d014248bd Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 16 Jul 2025 16:27:03 +0200 Subject: [PATCH 3/5] Update --- .../multiplatform/gradle/CocoaFrameworkLinkerIntegrationTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-kotlin-multiplatform-gradle-plugin/src/test/java/io/sentry/kotlin/multiplatform/gradle/CocoaFrameworkLinkerIntegrationTest.kt b/sentry-kotlin-multiplatform-gradle-plugin/src/test/java/io/sentry/kotlin/multiplatform/gradle/CocoaFrameworkLinkerIntegrationTest.kt index 4639d8f8..d67263cb 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/src/test/java/io/sentry/kotlin/multiplatform/gradle/CocoaFrameworkLinkerIntegrationTest.kt +++ b/sentry-kotlin-multiplatform-gradle-plugin/src/test/java/io/sentry/kotlin/multiplatform/gradle/CocoaFrameworkLinkerIntegrationTest.kt @@ -45,7 +45,7 @@ class CocoaFrameworkLinkerIntegrationTest { .build() assertThat(output.toString()) - .contains("Set up Sentry Cocoa linking for target: iosSimulatorArm64") + .contains("Set up Sentry Cocoa linking for targets: [iosSimulatorArm64]") assertThat(output.toString()) .contains("Start resolving Sentry Cocoa framework paths for target: iosSimulatorArm64") } From fdac946c2e8789dbb9e9b4ab8e37d75d034ecb60 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 16 Jul 2025 16:27:55 +0200 Subject: [PATCH 4/5] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8effc3c..b96ac29b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Enhancements -- Gradle Plugin: implement conditional Cocoa linking for targets ([#421](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/421)) +- Gradle Plugin: implement conditional Cocoa linking for targets ([#421](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/421), [#423](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/423)) ## 0.14.0 From 49705d8dddaf5da6235441b85b8235b28af3dbc6 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Thu, 17 Jul 2025 11:25:03 +0200 Subject: [PATCH 5/5] Revert workflow --- .github/workflows/kotlin-multiplatform.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/kotlin-multiplatform.yml b/.github/workflows/kotlin-multiplatform.yml index 9a1f53a9..01c97893 100644 --- a/.github/workflows/kotlin-multiplatform.yml +++ b/.github/workflows/kotlin-multiplatform.yml @@ -5,6 +5,12 @@ on: - main - release/** pull_request: + paths: + - '.github/workflows/kotlin-multiplatform.yml' + - 'kotlin-multiplatform/**' + - 'sentry-samples/**' + - 'buildSrc/src/' + - '!**/*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }}